summaryrefslogtreecommitdiff
path: root/graphics/gpsmanshp/files/patch-Makefile
blob: b2df5d6e57825baf509f4806a645cf4792ee867d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- Makefile.orig	2013-10-06 18:44:14 UTC
+++ Makefile
@@ -24,12 +24,16 @@
 
 VERSION = 1.2.3
 
-TCLVERSION = 8.4
+TCLVERSION ?= 8.4
+TCLLVERSION = $(TCLVERSION:S/.//)
 
-INSTALLDIR = /usr/lib/tcl$(TCLVERSION)
+INSTALLDIR = ${DESTDIR}${PREFIX}/lib/tcl$(TCLVERSION)/gpsmanshp-$(VERSION)
 
-CFLAGS = -Wall -fPIC -c -I/usr/include/tcl$(TCLVERSION)
-LINKOPT = -lshp -ltcl$(TCLVERSION)
+CFLAGS += -Wall -fPIC -c -I${LOCALBASE}/include/tcl$(TCLVERSION)
+CFLAGS += -I${LOCALBASE}/include
+LINKOPT = -L${LOCALBASE}/lib -lshp -ltcl$(TCLLVERSION)
+
+all:	pkgIndex.tcl
 
 gpsmanshp.so: gpsmanshp.o
 	$(CC) -shared -o gpsmanshp.so $(LINKOPT) gpsmanshp.o
@@ -42,8 +46,9 @@ pkgIndex.tcl: gpsmanshp.so
 	chmod 644 gpsmanshp.so pkgIndex.tcl
 
 install: pkgIndex.tcl
-	-mkdir $(INSTALLDIR)
-	cp gpsmanshp.so pkgIndex.tcl $(INSTALLDIR)
+	-mkdir -p $(INSTALLDIR)
+	$(BSD_INSTALL_LIB) gpsmanshp.so $(INSTALLDIR)/
+	$(BSD_INSTALL_SCRIPT) pkgIndex.tcl $(INSTALLDIR)/
 
 clean:
 	rm -f gpsmanshp.o gpsmanshp.so pkgIndex.tcl G*.aux G*.log