summaryrefslogtreecommitdiff
path: root/devel/shapelib/files/patch-Makefile
blob: b21d85e31ef50c5df603f807d2c5bedce9a4060d (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- Makefile.orig	2011-07-24 12:32:26.000000000 +0800
+++ Makefile	2013-10-13 21:38:40.590435497 +0800
@@ -1,16 +1,19 @@
 
-PREFIX	=	/usr/local
-CFLAGS	=	-g -Wall -fPIC
+PREFIX	?=	/usr/local
+CFLAGS	+=	-Wall -fPIC
 #CFLAGS  =       -g -DUSE_CPL
 #CC = g++
 
 LIBOBJ	=	shpopen.o dbfopen.o safileio.o shptree.o 
 SHPBIN	=	shpcreate shpadd shpdump shprewind dbfcreate dbfadd dbfdump \
-		shptreedump 
+		shptreedump shputils shptest
 
 default:	all
 
-all:	$(SHPBIN) shptest lib
+all:	$(SHPBIN) lib contrib_tools
+
+contrib_tools:
+	(cd contrib/; ${MAKE} %%PROJ%% all; cd ..)
 
 shpopen.o:	shpopen.c shapefil.h
 	$(CC) $(CFLAGS) -c shpopen.c
@@ -98,16 +101,21 @@
 
 
 lib:	libshp.a
+	$(CC) -shared -Wl,-soname,libshp.so.1 -o libshp.so.1 $(LDFLAGS) dbfopen.o safileio.o shpopen.o shptree.o
 
 libshp.a:	$(LIBOBJ)
 	ar r libshp.a $(LIBOBJ)
 
 lib_install:	libshp.a
-	cp libshp.a $(PREFIX)/lib
-	cp shapefil.h $(PREFIX)/include
+	$(BSD_INSTALL_DATA) shapefil.h $(DESTDIR)$(PREFIX)/include/
+	$(BSD_INSTALL_DATA) libshp.a $(DESTDIR)$(PREFIX)/lib/
+	$(BSD_INSTALL_LIB) libshp.so.1 $(DESTDIR)$(PREFIX)/lib/
 
 bin_install:	$(SHPBIN)
-	cp $(SHPBIN) $(PREFIX)/bin
+	$(BSD_INSTALL_PROGRAM) $(SHPBIN) $(DESTDIR)$(PREFIX)/bin/
+
+contrib_install:
+	(cd contrib/; ${MAKE} %%PROJ%% install; cd ..)
 
-install:	lib_install bin_install
+install:	lib_install bin_install contrib_install