1# -*- makefile -*-
2# Makefile for Microsoft Windows with Intel C++ Compiler
3
4GENERATE_DLL=0
5FAULT_TOLERANT=0
6
7OBJS = class.obj compiler.obj database.obj xml.obj hashtab.obj file.obj \
8	sync.obj symtab.obj ttree.obj rtree.obj container.obj cursor.obj query.obj w32sock.obj \
9	wwwapi.obj localcli.obj stdtp.obj server.obj
10
11CLI_OBJS = cli.obj w32sock.obj sync.obj repsock.obj stdtp.obj
12
13INCS = inc/fastdb.h inc/stdtp.h inc/class.h inc/database.h inc/cursor.h inc/reference.h inc/wwwapi.h \
14	inc/array.h inc/file.h inc/hashtab.h inc/ttree.h inc/rtree.h inc/container.h inc/sync.h inc/sync_w32.h inc/config.h \
15	inc/query.h inc/datetime.h inc/harray.h inc/timeseries.h inc/rectangle.h inc/exception.h
16
17FASTDB_LIB = fastdb.lib
18CLI_LIB = cli.lib
19FASTDB_DLL = fastdb.dll
20CLI_DLL = cli.dll
21
22EXES = subsql.exe cgistub.exe forcerecovery.exe
23
24EXAMPLES = guess.exe guess2.exe guess_std.exe testdb.exe testleak.exe testjoin.exe testddl.exe testperf.exe testsync.exe testconc.exe testiref.exe testtrav.exe testidx.exe bugdb.exe clidb.exe clitest.exe clitest2.exe localclitest.exe testraw.exe testharr.exe testspat.exe testtl.exe
25
26CC = icl
27
28# DEFS macro is deprecatred, edit inc/config.h file instead
29DEFS =
30
31CFLAGS = -c  -Iinc -nologo -Zi -W3 -GX -MTd $(DEFS)
32#CFLAGS = -c  -Iinc -nologo -Od -Zi -W3 -MTd -GX -DFASTDB_DEBUG=DEBUG_TRACE $(DEFS)
33#CFLAGS = -c  -Iinc -Ox -G6 -nologo -Zi -W3 -GX -MT $(DEFS)
34
35LD = $(CC)
36LDFLAGS = -MTd -Zi -nologo
37#LDFLAGS = -MT -Zi -nologo
38
39#DLLFLAGS = -LD -nologo
40DLLFLAGS = -LDd -Zi -nologo
41
42AR = lib
43ARFLAGS =
44
45STDLIBS = advapi32.lib
46
47SOCKLIBS = wsock32.lib
48
49!IF $(FAULT_TOLERANT)
50DEFS = $(DEFS) -DREPLICATION_SUPPORT
51STDLIBS = $(STDLIBS) $(SOCKLIBS)
52!ENDIF
53
54
55!IF $(GENERATE_DLL)
56all: $(FASTDB_LIB) $(CLI_LIB) $(FASTDB_DLL) $(CLI_DLL) $(EXES) $(EXAMPLES)
57DEFS = $(DEFS) -DFASTDB_DLL
58!ELSE
59all: $(FASTDB_LIB) $(CLI_LIB) $(EXES) $(EXAMPLES)
60!ENDIF
61
62class.obj: src/class.cpp inc/compiler.h inc/compiler.d inc/symtab.h $(INCS)
63	$(CC) $(CFLAGS) src/class.cpp
64
65compiler.obj: src/compiler.cpp inc/compiler.h inc/compiler.d inc/symtab.h $(INCS)
66	$(CC) $(CFLAGS) src/compiler.cpp
67
68query.obj: src/query.cpp inc/compiler.h inc/compiler.d inc/symtab.h $(INCS)
69	$(CC) $(CFLAGS) src/query.cpp
70
71database.obj: src/database.cpp inc/compiler.h inc/compiler.d inc/symtab.h $(INCS)
72	$(CC) $(CFLAGS) src/database.cpp
73
74xml.obj: src/xml.cpp inc/compiler.h inc/compiler.d inc/symtab.h $(INCS)
75	$(CC) $(CFLAGS) src/xml.cpp
76
77localcli.obj: src/localcli.cpp inc/compiler.h inc/compiler.d inc/symtab.h inc/localcli.h $(INCS)
78	$(CC) $(CFLAGS) src/localcli.cpp
79
80cursor.obj: src/cursor.cpp inc/compiler.h inc/compiler.d $(INCS)
81	$(CC) $(CFLAGS) src/cursor.cpp
82
83hashtab.obj: src/hashtab.cpp $(INCS)
84	$(CC) $(CFLAGS) src/hashtab.cpp
85
86file.obj: src/file.cpp $(INCS)
87	$(CC) $(CFLAGS) src/file.cpp
88
89stdtp.obj: src/stdtp.cpp $(INCS)
90	$(CC) $(CFLAGS) src/stdtp.cpp
91
92sync.obj: src/sync.cpp $(INCS)
93	$(CC) $(CFLAGS) src/sync.cpp
94
95symtab.obj: src/symtab.cpp inc/symtab.h $(INCS)
96	$(CC) $(CFLAGS) src/symtab.cpp
97
98ttree.obj: src/ttree.cpp $(INCS)
99	$(CC) $(CFLAGS) src/ttree.cpp
100
101rtree.obj: src/rtree.cpp $(INCS)
102	$(CC) $(CFLAGS) src/rtree.cpp
103
104container.obj: src/container.cpp $(INCS)
105	$(CC) $(CFLAGS) src/container.cpp
106
107wwwapi.obj: src/wwwapi.cpp inc/wwwapi.h inc/stdtp.h inc/sync.h inc/sockio.h inc/sync_w32.h inc/config.h
108	$(CC) $(CFLAGS) src/wwwapi.cpp
109
110w32sock.obj: src/w32sock.cpp inc/w32sock.h inc/sockio.h inc/stdtp.h
111	$(CC) $(CFLAGS) src/w32sock.cpp
112
113repsock.obj: src/repsock.cpp inc/repsock.h inc/sockio.h inc/stdtp.h inc/sync.h inc/sync_w32.h inc/config.h
114	$(CC) $(CFLAGS) src/repsock.cpp
115
116cli.obj: src/cli.cpp inc/cli.h inc/cliproto.h inc/repsock.h inc/sockio.h inc/stdtp.h inc/sync.h inc/sync_w32.h inc/config.h
117	$(CC) $(CFLAGS) src/cli.cpp
118
119
120fastdb.lib: $(OBJS)
121	$(AR) $(ARFLAGS) /OUT:fastdb.lib $(OBJS)
122
123fastdb.dll: $(OBJS)
124	$(CC) $(DLLFLAGS) /Fefastdb.dll $(OBJS) $(STDLIBS) $(SOCKLIBS)
125
126cli.lib: $(CLI_OBJS)
127	$(AR) $(ARFLAGS) /OUT:cli.lib $(CLI_OBJS)
128
129cli.dll: $(CLI_OBJS)
130	$(CC) $(DLLFLAGS) /Fecli.dll $(CLI_OBJS) $(STDLIBS) $(SOCKLIBS)
131
132subsql.obj: src/subsql.cpp inc/compiler.h inc/server.h inc/compiler.d inc/subsql.h inc/symtab.h $(INCS)
133	$(CC) $(CFLAGS) src/subsql.cpp
134
135server.obj: src/server.cpp inc/server.h inc/compiler.h inc/compiler.d inc/subsql.h inc/symtab.h $(INCS)
136	$(CC) $(CFLAGS) src/server.cpp
137
138subsql.exe: subsql.obj $(FASTDB_LIB)
139	$(LD) $(LDFLAGS) subsql.obj $(FASTDB_LIB) $(STDLIBS) $(SOCKLIBS)
140
141
142clitest.obj: examples/clitest.c inc/cli.h
143	$(CC) $(CFLAGS) examples/clitest.c
144
145clitest.exe: clitest.obj $(CLI_LIB)
146	$(LD) $(LDFLAGS) clitest.obj $(CLI_LIB) $(STDLIBS) $(SOCKLIBS)
147
148clitest2.obj: examples/clitest2.c inc/cli.h
149	$(CC) $(CFLAGS) examples/clitest2.c
150
151clitest2.exe: clitest2.obj $(FASTDB_LIB)
152	$(LD) $(LDFLAGS) /Feclitest2.exe clitest2.obj $(FASTDB_LIB) $(STDLIBS)
153
154localclitest.exe: clitest.obj $(FASTDB_LIB)
155	$(LD) $(LDFLAGS) /Felocalclitest.exe clitest.obj $(FASTDB_LIB) $(STDLIBS)
156
157bugdb.obj: examples/bugdb.cpp examples/bugdb.h $(INCS)
158	$(CC) $(CFLAGS) examples/bugdb.cpp
159
160bugdb.exe: bugdb.obj  $(FASTDB_LIB)
161	$(LD) $(LDFLAGS) bugdb.obj $(FASTDB_LIB) $(STDLIBS) $(SOCKLIBS)
162
163
164clidb.obj: examples/clidb.cpp examples/clidb.h $(INCS)
165	$(CC) $(CFLAGS) examples/clidb.cpp
166
167clidb.exe: clidb.obj  $(FASTDB_LIB)
168	$(LD) $(LDFLAGS) clidb.obj $(FASTDB_LIB) $(STDLIBS) $(SOCKLIBS)
169
170
171cgistub.obj: src/cgistub.cpp inc/stdtp.h inc/sockio.h
172	$(CC) $(CFLAGS) src/cgistub.cpp
173
174cgistub.exe: cgistub.obj
175	$(LD) $(LDFLAGS) cgistub.obj $(FASTDB_LIB) $(STDLIBS) $(SOCKLIBS)
176
177
178forcerecovery.obj: src/forcerecovery.cpp inc/database.h
179	$(CC) $(CFLAGS) src/forcerecovery.cpp
180
181forcerecovery.exe: forcerecovery.obj
182	$(LD) $(LDFLAGS) forcerecovery.obj
183
184
185guess.obj: examples/guess.cpp $(INCS)
186	$(CC) $(CFLAGS) examples/guess.cpp
187
188guess.exe: guess.obj $(FASTDB_LIB)
189	$(LD) -Feguess.exe $(LDFLAGS) guess.obj $(FASTDB_LIB) $(STDLIBS)
190
191testharr.obj: examples/testharr.cpp $(INCS)
192	$(CC) $(CFLAGS) examples/testharr.cpp
193
194testharr.exe: testharr.obj $(FASTDB_LIB)
195	$(LD) $(LDFLAGS) testharr.obj $(FASTDB_LIB) $(STDLIBS)
196
197guess_std.obj: examples/guess_std.cpp $(INCS)
198	$(CC) $(CFLAGS) examples/guess_std.cpp
199
200guess_std.exe: guess_std.obj $(FASTDB_LIB)
201	$(LD) $(LDFLAGS) guess_std.obj $(FASTDB_LIB) $(STDLIBS)
202
203guess2.obj: examples/guess2.cpp $(INCS)
204	$(CC) $(CFLAGS) examples/guess2.cpp
205
206guess2.exe: guess2.obj $(FASTDB_LIB)
207	$(LD) $(LDFLAGS) guess2.obj $(FASTDB_LIB) $(STDLIBS)
208
209testdb.obj: examples/testdb.cpp $(INCS)
210	$(CC) $(CFLAGS) examples/testdb.cpp
211
212testdb.exe: testdb.obj $(FASTDB_LIB)
213	$(LD) $(LDFLAGS) testdb.obj $(FASTDB_LIB) $(STDLIBS)
214
215testraw.obj: examples/testraw.cpp $(INCS)
216	$(CC) $(CFLAGS) examples/testraw.cpp
217
218testraw.exe: testraw.obj $(FASTDB_LIB)
219	$(LD) $(LDFLAGS) testraw.obj $(FASTDB_LIB) $(STDLIBS)
220
221testleak.obj: examples/testleak.cpp $(INCS)
222	$(CC) $(CFLAGS) examples/testleak.cpp
223
224testleak.exe: testleak.obj $(FASTDB_LIB)
225	$(LD) $(LDFLAGS) testleak.obj $(FASTDB_LIB) $(STDLIBS)
226
227testjoin.obj: examples/testjoin.cpp $(INCS)
228	$(CC) $(CFLAGS) examples/testjoin.cpp
229
230testjoin.exe: testjoin.obj $(FASTDB_LIB)
231	$(LD) $(LDFLAGS) testjoin.obj $(FASTDB_LIB) $(STDLIBS)
232
233testddl.obj: examples/testddl.cpp $(INCS)
234	$(CC) $(CFLAGS) examples/testddl.cpp
235
236testddl.exe: testddl.obj $(FASTDB_LIB)
237	$(LD) $(LDFLAGS) testddl.obj $(FASTDB_LIB) $(STDLIBS)
238
239testperf.obj: examples/testperf.cpp $(INCS)
240	$(CC) $(CFLAGS) examples/testperf.cpp
241
242testperf.exe: testperf.obj $(FASTDB_LIB)
243	$(LD) $(LDFLAGS) testperf.obj $(FASTDB_LIB) $(STDLIBS)
244
245testidx.obj: examples/testidx.cpp $(INCS)
246	$(CC) $(CFLAGS) examples/testidx.cpp
247
248testidx.exe: testidx.obj $(FASTDB_LIB)
249	$(LD) $(LDFLAGS) testidx.obj $(FASTDB_LIB) $(STDLIBS)
250
251testtl.obj: examples/testtl.cpp $(INCS)
252	$(CC) $(CFLAGS) examples/testtl.cpp
253
254testtl.exe: testtl.obj $(FASTDB_LIB)
255	$(LD) $(LDFLAGS) testtl.obj $(FASTDB_LIB) $(STDLIBS)
256
257testspat.obj: examples/testspat.cpp $(INCS)
258	$(CC) $(CFLAGS) examples/testspat.cpp
259
260testspat.exe: testspat.obj $(FASTDB_LIB)
261	$(LD) $(LDFLAGS) testspat.obj $(FASTDB_LIB) $(STDLIBS)
262
263testsync.obj: examples/testsync.cpp $(INCS)
264	$(CC) $(CFLAGS) examples/testsync.cpp
265
266testsync.exe: testsync.obj $(FASTDB_LIB)
267	$(LD) $(LDFLAGS) testsync.obj $(FASTDB_LIB) $(STDLIBS)
268
269testconc.obj: examples/testconc.cpp $(INCS)
270	$(CC) $(CFLAGS) examples/testconc.cpp
271
272testconc.exe: testconc.obj $(FASTDB_LIB)
273	$(LD) $(LDFLAGS) testconc.obj $(FASTDB_LIB) $(STDLIBS)
274
275testiref.obj: examples/testiref.cpp $(INCS)
276	$(CC) $(CFLAGS) examples/testiref.cpp
277
278testiref.exe: testiref.obj $(FASTDB_LIB)
279	$(LD) $(LDFLAGS) testiref.obj $(FASTDB_LIB) $(STDLIBS)
280
281testtrav.obj: examples/testtrav.cpp $(INCS)
282	$(CC) $(CFLAGS) examples/testtrav.cpp
283
284testtrav.exe: testtrav.obj $(FASTDB_LIB)
285	$(LD) $(LDFLAGS) testtrav.obj $(FASTDB_LIB) $(STDLIBS)
286
287
288
289cleanobj:
290	-del *.odb,*.exp,*.obj,*.pch,*.pdb,*.ilk,*.dsp,*.dsw,*.ncb,*.opt
291
292cleandbs:
293	-del *.fdb
294
295clean: cleanobj cleandbs
296	-del *~,*.lib,*.dll,*.exe
297
298
299zip: clean
300	cd ..
301	-del fastdb.zip
302        zip -r fastdb.zip fastdb
303
304copyzip: zip
305	copy fastdb.zip d:
306
307
308doxygen:
309	doxygen doxygen.cfg
310
311