$OpenBSD: patch-Makefile_am,v 1.1.1.1 2004/06/26 05:56:20 mjc Exp $
--- Makefile.am.orig	Wed Oct 29 15:02:29 2003
+++ Makefile.am	Tue Jun 22 21:00:50 2004
@@ -1,21 +1,21 @@
-CC=gcc
-LIB=-lpcre -L./pcre-3.9/ -I./pcre-3.9/
+LIB=-lpcre -L${LOCALBASE}/lib
 OPT=-O2
 OPT_DEBUG=-ggdb -Wall -lefence
 DIR=/bin
 SCRIPTS=appdefs.trig appdefs.resp appdefs.rpc
+SCRIPTDIR=${PREFIX}/share/amap
 MANPAGE=amap.1
-all:	pcre strip
+all:	amap amapcrap
 
 pcre:
 	cd pcre-3.9 && make
 
 amap:	amap.c
 	@echo
-	$(CC) $(OPT) -o amap amap.c $(LIB) $(XLIBS) $(XLIBPATHS) $(XIPATHS) $(XDEFINES)
+	$(CC) $(CFLAGS) -o amap amap.c $(LIB) $(XLIBS) $(XLIBPATHS) $(XIPATHS) $(XDEFINES)
 
 amapcrap:	amapcrap.c
-	$(CC) $(OPT) -o amapcrap amapcrap.c $(XLIBS) $(XLIBPATHS) $(XIPATHS) $(XDEFINES)
+	$(CC) $(CFLAGS) -o amapcrap amapcrap.c $(XLIBS) $(XLIBPATHS) $(XIPATHS) $(XDEFINES)
 	@echo
 
 strip:	amap amapcrap
@@ -29,9 +29,10 @@ debug:	amap.c
 
 install:	all
 	@echo Installing to $(PREFIX)$(DIR), change this by running ./configure --prefix=path
-	-mkdir -vp $(PREFIX)$(DIR) 2> /dev/null
-	cp amap amapcrap $(SCRIPTS) $(PREFIX)$(DIR)
-	cp $(MANPAGE) $(MANDIR)
+	${BSD_INSTALL_PROGRAM} amap amapcrap $(PREFIX)$(DIR)
+	${BSD_INSTALL_DATA_DIR} $(SCRIPTDIR)
+	${BSD_INSTALL_DATA} $(SCRIPTS) $(SCRIPTDIR)
+	${BSD_INSTALL_MAN} $(MANPAGE) $(MANDIR)
 
 clean:	
 	cd pcre-3.9 && make clean
