-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile
189 lines (127 loc) · 4.78 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# -*- makefile -*-
# Makefile for Unix with g++ compiler
#WITH_JUDY=1
CC=g++
# if you use egcs-2.90.* version of GCC please add option -fno-exceptions
# to reduce code size and increase performance
# Debug version
#CFLAGS = -c -Wall -O0 -g -DDEBUG_LEVEL=DEBUG_TRACE
# Optimized version
CFLAGS = -c -Wall -O6 -g -DDEBUG_LEVEL=DEBUG_CHECK
# Optimized version with switched off asserts
#CFLAGS = -c -Wall -O6 -g -DNDEBUG
LFLAGS=-g
AR=ar
ARFLAGS=-cru
EXAMPLES=guess testtree testtext testspat testperf testiter dumpmem testnew
STL_EXAMPLES=testmap stltest
INSTALL_LIB_PATH=/usr/local/post/lib
INSTALL_INC_PATH=/usr/local/post/inc
HEADERS=stdtp.h file.h storage.h classinfo.h object.h
OBJS=file.o storage.o classinfo.o avltree.o rtree.o ttree.o array.o hashtab.o textobj.o post_c_api.o iterator.o
ifdef WITH_JUDY
OBJS += judyarr.o
STDLIBS += Judy/src/obj/.libs/libJudy.a
EXAMPLES += testjudy
endif
all: libstorage.a postnew.o $(EXAMPLES)
judyarr.o: judyarr.cxx judyarr.h
$(CC) $(CFLAGS) -IJudy/src judyarr.cxx
file.o: file.cxx $(HEADERS)
$(CC) $(CFLAGS) file.cxx
storage.o: storage.cxx $(HEADERS)
$(CC) $(CFLAGS) storage.cxx
classinfo.o: classinfo.cxx $(HEADERS)
$(CC) $(CFLAGS) classinfo.cxx
avltree.o: avltree.cxx avltree.h $(HEADERS)
$(CC) $(CFLAGS) avltree.cxx
rtree.o: rtree.cxx rtree.h dnmarr.h $(HEADERS)
$(CC) $(CFLAGS) rtree.cxx
ttree.o: ttree.cxx ttree.h dnmarr.h $(HEADERS)
$(CC) $(CFLAGS) ttree.cxx
array.o: array.cxx array.h $(HEADERS)
$(CC) $(CFLAGS) array.cxx
hashtab.o: hashtab.cxx hashtab.h $(HEADERS)
$(CC) $(CFLAGS) hashtab.cxx
iterator.o: iterator.cxx iterator.h $(HEADERS)
$(CC) $(CFLAGS) iterator.cxx
textobj.o: textobj.cxx textobj.h $(HEADERS)
$(CC) $(CFLAGS) textobj.cxx
postnew.o: postnew.cxx $(HEADERS)
$(CC) $(CFLAGS) postnew.cxx
post_c_api.o: post_c_api.cxx post_c_api.h $(HEADERS)
$(CC) $(CFLAGS) post_c_api.cxx
libstorage.a: $(OBJS)
$(AR) $(ARFLAGS) libstorage.a $(OBJS)
install: libstorage.a
mkdir -p $(INSTALL_LIB_PATH)
cp libstorage.a $(INSTALL_LIB_PATH)
mkdir -p $(INSTALL_INC_PATH)
cp *.h $(INSTALL_INC_PATH)
#
# Examples
#
guess.o: guess.cxx $(HEADERS)
$(CC) $(CFLAGS) guess.cxx
testtext.o: testtext.cxx textobj.h array.h $(HEADERS)
$(CC) $(CFLAGS) testtext.cxx
testtree.o: testtree.cxx avltree.h hashtab.h $(HEADERS)
$(CC) $(CFLAGS) testtree.cxx
testspat.o: testspat.cxx rtree.h dnmarr.h hashtab.h $(HEADERS)
$(CC) $(CFLAGS) testspat.cxx
testperf.o: testperf.cxx ttree.h dnmarr.h $(HEADERS)
$(CC) $(CFLAGS) testperf.cxx
testiter.o: testiter.cxx iterator.h ttree.h dnmarr.h $(HEADERS)
$(CC) $(CFLAGS) testiter.cxx
testrans.o: testrans.cxx avltree.h $(HEADERS)
$(CC) $(CFLAGS) testrans.cxx
dumpmem.o: dumpmem.cxx $(HEADERS)
$(CC) $(CFLAGS) dumpmem.cxx
testnew.o: testnew.cxx $(HEADERS)
$(CC) $(CFLAGS) testnew.cxx
testjudy.o: testjudy.cxx judyarr.h $(HEADERS)
$(CC) $(CFLAGS) testjudy.cxx
guess: guess.o comptime.cxx libstorage.a
$(CC) $(LFLAGS) -o guess guess.o comptime.cxx libstorage.a $(STDLIBS)
testtext: testtext.o comptime.cxx libstorage.a
$(CC) $(LFLAGS) -o testtext testtext.o comptime.cxx libstorage.a $(STDLIBS)
testtree: testtree.o comptime.cxx libstorage.a
$(CC) $(LFLAGS) -o testtree testtree.o comptime.cxx libstorage.a $(STDLIBS)
testspat: testspat.o comptime.cxx libstorage.a
$(CC) $(LFLAGS) -o testspat testspat.o comptime.cxx libstorage.a $(STDLIBS)
testperf: testperf.o libstorage.a
$(CC) $(LFLAGS) -o testperf testperf.o libstorage.a $(STDLIBS)
testiter: testiter.o libstorage.a
$(CC) $(LFLAGS) -o testiter testiter.o libstorage.a $(STDLIBS)
testrans: testrans.o comptime.cxx libstorage.a
$(CC) $(LFLAGS) -o testrans testrans.o comptime.cxx libstorage.a $(STDLIBS)
dumpmem: dumpmem.o libstorage.a
$(CC) $(LFLAGS) -o dumpmem dumpmem.o libstorage.a $(STDLIBS)
testnew: testnew.o postnew.o
$(CC) $(LFLAGS) -o testnew testnew.o postnew.o libstorage.a $(STDLIBS)
testjudy: testjudy.o libstorage.a
$(CC) $(LFLAGS) -o testjudy -Xlinker --allow-multiple-definition testjudy.o libstorage.a $(STDLIBS)
#
# Service targets
#
cleanobj:
rm -f *.o core *~ $(EXAMPLES) $(STL_EXAMPLES) testrans
cleandbs:
rm -f *.odb *.log *.tmp
clean: cleanobj cleandbs
cleanall: clean
rm -f *.a
tgz: cleanall
chmod +x GiST/tests/runtests.sh
cd ..; tar cvzf post.tgz post
copytgz: tgz
mcopy -o ../post.tgz a:
STL_INCLUDES=/usr/local/include
stltest.o: stltest.cxx post_stl.h $(HEADERS)
$(CC) $(CFLAGS) -I$(STL_INCLUDES) -DREDEFINE_DEFAULT_ALLOCATOR -DNO_NAMESPACES -DUSE_STD_ALLOCATORS -DREDEFINE_STRING stltest.cxx
stltest: stltest.o libstorage.a
$(CC) $(LFLAGS) -o stltest stltest.o libstorage.a
testmap.o: testmap.cxx post_stl.h $(HEADERS)
$(CC) $(CFLAGS) -I$(STL_INCLUDES) -DREDEFINE_DEFAULT_ALLOCATOR -DNO_NAMESPACES -DUSE_STD_ALLOCATORS -DREDEFINE_STRING testmap.cxx
testmap: testmap.o libstorage.a
$(CC) $(LFLAGS) -o testmap testmap.o libstorage.a