$NetBSD$

Fixes CFLAGS and install stage.

--- Makefile.orig	2003-09-05 22:55:57.000000000 +0000
+++ Makefile
@@ -1,21 +1,19 @@
-#Makefile GRAPHIC
-#CXX  		=g++ -O3 -mpentium -Wall -DEMU64_DEBUG
-#CC		=gcc -O3 -I/usr/X11R6/include -fPIC -fomit-frame-pointer -funroll-loops -ffast-math -mcpu=pentium -pipe
-#CC		=gcc -O3 -mpentium -Wall -g -pg
-CC 		=gcc -O3 -fomit-frame-pointer -funroll-loops -ffast-math -mcpu=athlon -Wall -DUSE_GTK `gtk-config --cflags` -I/usr/X11R6/include -pipe
+# Blah!
 
-OBJ		=main.o
+CFLAGS+=    -Wall -DUSE_GTK `gtk-config --cflags` -I${X11BASE}/include
+OBJ=	    main.o
 
 
-all:		mupen64_input.so instruction
-
+all:		mupen64_input.so
 
 mupen64_input.so:	$(OBJ)
-			$(CC) $(OBJ) -Wl,-Bsymbolic -shared -lSDL `gtk-config --cflags --libs` -o $@
+			$(CC) $(CFLAGS) $(OBJ) -Wl,-Bsymbolic -shared `sdl-config --libs` \
+			    `gtk-config --cflags --libs` -o $@
 			strip --strip-all $@
 
-instruction:
-	$(warning please copy mupen64_input.so in the plugins/ folder of the emulator)
+install:
+	$(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(PREFIX)/share/mupen64-base/plugins
+	$(BSD_INSTALL_DATA) mupen64_input.so ${DESTDIR}$(PREFIX)/share/mupen64-base/plugins
 
 clean:
 	find . -name '*.o' -print0 | xargs -0r rm -f
