--- wol/Makefile.orig	Sat May 18 12:02:28 2002
+++ wol/Makefile	Sat May 18 13:01:59 2002
@@ -39,7 +39,7 @@
 ## or some other directory, depending on your installation.
 ##
 
-XINCLUDEDIR = .
+XINCLUDEDIR = ${X11BASE}/include
 
 ##
 ## If X isn't in the library path (the case for many MachTen and Linux 
@@ -54,7 +54,7 @@
 ## depending on your installation. 
 ##
 
-LIBX11 = -lX11
+LIBX11 = -lX11 -L${X11BASE}/lib
 
 
 
@@ -66,7 +66,7 @@
 ##
 ## on some systems, -ldl must be added to the following line
 
-OTHERLIBS= -lm
+OTHERLIBS= -lm -lcompat
 
 
 ##
@@ -97,11 +97,11 @@
 ##
 
 CHIPMUNKCC = gcc -O3
-CC = $(CHIPMUNKCC) 
+CC ?= $(CHIPMUNKCC) 
 
-LIBDIR = `pwd`/
+LIBDIR = ${PREFIX}/share/chipmunk
 WOLPL = $(LIBDIR)
-BINDIR = ../bin
+BINDIR = ${PREFIX}/bin
 
 
 ##
@@ -157,7 +157,7 @@
 
 CHIPMUNKFLAGS =
 
-CFLAGS= $(CHIPMUNKFLAGS) -I$(LOCINC) -I$(XINCLUDEDIR) -DWOLLIBDIR=\"$(WOLPL)\"
+CFLAGS += -DBSD -DF_OK -I$(LOCINC) -I$(XINCLUDEDIR) -DWOLLIBDIR=\"$(WOLPL)\"
 
 LDFLAGS= $(LIBP2C)  $(LIBX11) $(OTHERLIBS)
 
@@ -200,7 +200,7 @@
   
 
 install: wol 
-	cp wol $(BINDIR)
+	${BSD_INSTALL_PROGRAM} wol $(BINDIR)
 
 clean:
 	-rm -f *.o wol
