$NetBSD: patch-Makefile,v 1.2 2017/05/27 14:15:26 schmonz Exp $

DESTDIR support.

--- Makefile.orig	2014-05-15 02:54:21.000000000 +0000
+++ Makefile
@@ -965,12 +965,13 @@ libcompile idxthread.c error.h alloc.h s
 
 install: \
 it man installer conf-bin conf-etc conf-lang conf-lib conf-man BIN ETC LIB MAN
-	./installer "`head -n 1 conf-bin`" < BIN
-	./installer "`head -n 1 conf-etc`" < ETC
-	./installer "`head -n 1 conf-man`" < MAN
-	./installer "`head -n 1 conf-lib`" < LIB
-	rm -f "`head -n 1 conf-etc`"/default
-	ln -sf "`head -n 1 conf-lang`" "`head -n 1 conf-etc`"/default
+	./installer "`head -1 conf-destdir``head -n 1 conf-bin`" < BIN
+	./installer "`head -1 conf-destdir``head -n 1 conf-cgibin`" < CGIBIN
+	./installer "`head -1 conf-destdir``head -n 1 conf-egdir`" < ETC
+	./installer "`head -1 conf-destdir``head -n 1 conf-man`" < MAN
+	./installer "`head -1 conf-destdir``head -n 1 conf-lib`" < LIB
+	rm -f "`head -1 conf-destdir``head -n 1 conf-egdir`"/default
+	ln -sf "`head -n 1 conf-lang`" "`head -1 conf-destdir``head -n 1 conf-egdir`"/default
 
 installer: \
 load installer.o getln.a strerr.a substdio.a stralloc.a alloc.a open.a error.a str.a fs.a
