-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
113 lines (83 loc) · 2.85 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
PREFIX = /usr/local
CFLAGS = -g -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
default: all
all: $(SHPBIN) shptest lib
shpopen.o: shpopen.c shapefil.h
$(CC) $(CFLAGS) -c shpopen.c
shptree.o: shptree.c shapefil.h
$(CC) $(CFLAGS) -c shptree.c
dbfopen.o: dbfopen.c shapefil.h
$(CC) $(CFLAGS) -c dbfopen.c
safileio.o: safileio.c shapefil.h
$(CC) $(CFLAGS) -c safileio.c
shpcreate: shpcreate.c shpopen.o safileio.o
$(CC) $(CFLAGS) shpcreate.c shpopen.o safileio.o $(LINKOPT) -o shpcreate
shpadd: shpadd.c shpopen.o safileio.o
$(CC) $(CFLAGS) shpadd.c shpopen.o safileio.o $(LINKOPT) -o shpadd
shpdump: shpdump.c shpopen.o safileio.o
$(CC) $(CFLAGS) shpdump.c shpopen.o safileio.o $(LINKOPT) -o shpdump
shprewind: shprewind.c shpopen.o safileio.o
$(CC) $(CFLAGS) shprewind.c shpopen.o safileio.o $(LINKOPT) -o shprewind
dbfcreate: dbfcreate.c dbfopen.o safileio.o
$(CC) $(CFLAGS) dbfcreate.c dbfopen.o safileio.o $(LINKOPT) -o dbfcreate
dbfadd: dbfadd.c dbfopen.o safileio.o
$(CC) $(CFLAGS) dbfadd.c dbfopen.o safileio.o $(LINKOPT) -o dbfadd
dbfdump: dbfdump.c dbfopen.o safileio.o
$(CC) $(CFLAGS) dbfdump.c dbfopen.o safileio.o $(LINKOPT) -o dbfdump
shptest: shptest.c shpopen.o safileio.o
$(CC) $(CFLAGS) shptest.c shpopen.o safileio.o $(LINKOPT) -o shptest
shputils: shputils.c shpopen.o safileio.o dbfopen.o
$(CC) $(CFLAGS) shputils.c shpopen.o safileio.o dbfopen.o $(LINKOPT) -o shputils
shptreedump: shptreedump.c shptree.o shpopen.o safileio.o
$(CC) $(CFLAGS) shptreedump.c shptree.o shpopen.o safileio.o $(LINKOPT) \
-o shptreedump
clean:
rm -f *.o shptest $(SHPBIN) libshp.a
test: test2 test3
#
# Note this stream only works if example data is accessable.
# Fetch ftp://gdal.velocet.ca/pub/outgoing/shape_eg_data.zip
#
test1:
@./stream1.sh > s1.out
@if test "`diff s1.out stream1.out`" = '' ; then \
echo "******* Stream 1 Succeeded *********"; \
rm s1.out; \
else \
echo "******* Stream 1 Failed *********"; \
diff s1.out stream1.out; \
fi
test2:
@./stream2.sh > s2.out
@if test "`diff s2.out stream2.out`" = '' ; then \
echo "******* Stream 2 Succeeded *********"; \
rm s2.out; \
rm test*.s??; \
else \
echo "******* Stream 2 Failed *********"; \
diff s2.out stream2.out; \
fi
test3:
@./makeshape.sh > s3.out
@if test "`diff s3.out stream3.out`" = '' ; then \
echo "******* Stream 3 Succeeded *********"; \
rm s3.out; \
rm test.*; \
else \
echo "******* Stream 3 Failed *********"; \
diff s3.out stream3.out; \
fi
lib: libshp.a
libshp.a: $(LIBOBJ)
ar r libshp.a $(LIBOBJ)
lib_install: libshp.a
cp libshp.a $(PREFIX)/lib
cp shapefil.h $(PREFIX)/include
bin_install: $(SHPBIN)
cp $(SHPBIN) $(PREFIX)/bin
install: lib_install bin_install