summaryrefslogtreecommitdiffstats
path: root/rasodmg/test/Makefile
blob: 07385a26ab112e7198814860ce7d21190b8b9632 (plain)
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# -*-Makefile-*-
#
# This file is part of rasdaman community.
#
# Rasdaman community is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Rasdaman community is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with rasdaman community.  If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
# rasdaman GmbH.
#
# For more information please see <http://www.rasdaman.org>
# or contact Peter Baumann via <baumann@rasdaman.com>. # Top Level makefile. This points to the various modules that have to be build
# and/or deployed
# 
# MAKEFILE FOR:  
#   test programs of module rasodmg
# 
# COMMENTS: 
# - the rasql situated here is obsolete, see applications/rasql
#
##################################################################
#
# This is just an example Makefile for a test program.
# The dependency of the test program on the lib of the 
# corresponding module is in the Makefile of the module.
#

######################### Definitions ############################

# standard include with general options
include $(RMANBASE)/Makefile.inc

DEFCLIENTLIBS = $(RASODMG) $(CLIENTCOMM) $(COMPRESSION) $(RASLIB) $(CONVERSION)

# use client specific flags
CXXFLAGS := $(CLIENTCXXFLAGS)
LDFLAGS  := $(CLIENTLDFLAGS) 

# add communication flags
CXXFLAGS += $(COMMCXXFLAGS)
LDFLAGS += $(COMMLDFLAGS)

# COMPDATE must be made more general at the final destination
COMPDATE = `date +\"%d.%m.%Y %H:%M:%S\"`
CXXFLAGS +=  -DCOMPDATE="\"$(COMPDATE)\""

## a symbol for not writing too much when linking
QL = $(SUPPORT_BASE)/lib/lib
SUPPORTLIBS= $(QL)tiff.a $(QL)jpeg.a $(QL)png.a $(QL)crypto.a $(QL)z.a \
	$(QL)mfhdf.a $(QL)df.a  $(QL)ppm.a $(QL)pgm.a $(QL)pbm.a $(LIBAKINSIDE) \
	$(LIBAKNET)

# all test programs
ALLTESTS =  test_oqlquery test_collection test_set test_iterator \
	   test_marray deletecollection \
	   test_ref test_insert test_lookup test_query test_insert3 \
	   test_breakdown test_benchmark test_storage test_alignedtiling \
           test_dirtiling test_interesttiling test_stattiling test_bmark_dir \
	   gen_pattern test_bmark_int test_bmark_stat test_bmark_dir1 \
	   test_bmark_int1 test_gmarray test_transaction test_fastscale \
	   test_polygon exporttif defdiff defconv system_update system_compare \
	   system_insert system_query

SRCCXX= defconv.cc system_compare.cc test_bmark_dir1.cc test_dirtiling.cc test_lookup.cc \
	test_stattiling.cc defdiff.cc system_insert.cc test_bmark_int.cc test_fastscale.cc \
	test_marray.cc test_storage.cc deletecollection.cc system_query.cc test_bmark_int1.cc \
	test_gmarray.cc test_oqlquery.cc test_transaction.cc gen_pattern.cc system_update.cc \
	test_bmark_pet.cc test_insert.cc test_polygon.cc rasql.cc test_alignedtiling.cc \
	test_bmark_stat.cc test_insert3.cc test_query.cc readln.cc test_benchmark.cc \
	test_breakdown.cc test_interesttiling.cc test_ref.cc system_basic.cc test_bmark_dir.cc \
	test_collection.cc  test_iterator.cc test_set.cc

OBJS  = ${SRCCXX:%.cc=%.o}

ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
LDFLAGS+= -lsocket
endif

MISCCLEAN = $(OBJS) $(ALLTESTS)

########################### Targets ##############################
# all tests
tests: $(ALLTESTS)

# test target for class r_Collection
# test target for class r_OQL_Query
.PHONY : oqlquery
oqlquery: test_module test_oqlquery

# test target for class r_Collection
.PHONY : collection
collection: test_module test_collection

# test target for class r_Set
.PHONY : set
set: test_module test_set

# test target for class r_Iterator
.PHONY : iterator
iterator: test_module test_iterator

# test target for class r_Marray
.PHONY : marray
marray: test_module test_marray

# test target for class r_GMarray
.PHONY : gmarray
gmarray: test_module test_gmarray

# test target for class r_Ref, r_Transaction
.PHONY : ref
ref: test_module test_ref

# test target for ODMG conformant insertion of r_Marrays
.PHONY : insert
insert: test_module test_insert

# test target for ODMG conformant lookup of r_Marrays
.PHONY : lookup
lookup: test_module test_lookup

# test target for RasQL queries
.PHONY : query
query: test_module test_query

# test target for test_insert3
.PHONY : insert3
insert3: test_module test_insert3

# test target for deletecollection
.PHONY : deletecoll
insert3: test_module deletecollection

# test target for simulation of communication breakdown
.PHONY : breakdown
breakdown: test_module test_breakdown

# test target for RasQL benchmark
.PHONY : benchmark
benchmark: test_module test_benchmark

# test target for storage layout
storage: test_module test_storage test_alignedtiling test_dirtiling

# test target for transactions
transaction: test_module test_transaction

.PHONY : test_module
test_module:
	cd $(RMANBASE)/rasodmg; $(MAKE)
	cd $(RMANBASE)/raslib; $(MAKE)

test_oqlquery: test_oqlquery.o  $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_collection: test_collection.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_set: test_set.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_iterator: test_iterator.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_marray: test_marray.o  $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_gmarray: test_gmarray.o  $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_ref: test_ref.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_insert: test_insert.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_lookup: test_lookup.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) 

test_fastscale: test_fastscale.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

ifeq ($(OSTYPE),$(OSTYPE_LINUX))
exporttif_static: exporttif.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o test_polygon -Xlinker -Bstatic $^ $(SUPPORTLIBS) -lstdc++ 
endif

ifeq ($(OSTYPE),$(OSTYPE_LINUX))
exporttif: exporttif.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) -nodefaultlibs $(LDFLAGS) -o $@ -Xlinker -Bstatic $^ \
	$(SUPPORTLIBS)  -lstdc++ -Xlinker -Bdynamic -lm -lgcc -lc -lgcc
endif


ifeq ($(OSTYPE),$(OSTYPE_LINUX))
test_polygon_static: test_polygon.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o test_polygon -Xlinker -Bstatic $^ \
	$(SUPPORTLIBS) -lstdc++ 
endif

ifeq ($(OSTYPE),$(OSTYPE_LINUX))
test_polygon: test_polygon.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) -nodefaultlibs $(LDFLAGS) -o $@ -Xlinker -Bstatic $^ \
	$(SUPPORTLIBS) -lstdc++ -Xlinker -Bdynamic -lm -lgcc -lc -lgcc
endif

ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
test_polygon: test_polygon.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ $(SUPPORTLIBS)
endif

test_query: test_query.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

ifeq ($(OSTYPE),$(OSTYPE_LINUX))
test_query_static: test_query.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) -nodefaultlibs $(LDFLAGS) -o test_query $^ -Xlinker -Bstatic \
	$(SUPPORTLIBS) -lstdc++ -Xlinker -Bdynamic -lgcc -lc -lgcc 
endif

system_compare: system_basic.o system_compare.o $(DEFCLIENTLIBS)
ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lstdc++ -lm $(SUPPORTLIBS)
else
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -Xlinker -Bstatic $(SUPPORTLIBS)
endif

system_update: system_update.o system_basic.o $(DEFCLIENTLIBS)
ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) -lNCSCNet -lNCSEcw -lNCSUtil -mt
endif
ifeq ($(OSTYPE),$(OSTYPE_LINUX))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -Xlinker -Bstatic $(SUPPORTLIBS) 
endif
ifeq ($(OSTYPE),$(OSTYPE_OSF1))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ $(SUPPORTLIBS)
endif

system_insert: system_insert.o system_basic.o $(DEFCLIENTLIBS)
ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lstdc++ -lm $(SUPPORTLIBS)
else
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ $(SUPPORTLIBS)
endif

system_query: system_query.o system_basic.o $(DEFCLIENTLIBS)
ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ $(SUPPORTLIBS) -lstdc++ -lm
else
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -Xlinker -Bstatic $(SUPPORTLIBS)
endif

defdiff: defdiff.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -Xlinker -Bstatic -lstdc++ -lm $(SUPPORTLIBS)

defconv: defconv.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -Xlinker -Bstatic -lstdc++ -lm $(SUPPORTLIBS)

test_insert3: test_insert3.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

ifeq ($(OSTYPE),$(OSTYPE_LINUX))
test_insert3_static: test_insert3.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) -nodefaultlibs $(LDFLAGS) -o test_insert3 $^  -Xlinker -Bstatic \
	$(SUPPORTLIBS) -lstdc++ -Xlinker -Bdynamic -lgcc -lc -lgcc
endif 

deletecollection: deletecollection.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_breakdown: test_breakdown.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_benchmark: test_benchmark.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_storage: test_storage.o $(DEFCLIENTLIBS) $(TOOLS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_alignedtiling: test_alignedtiling.o $(DEFCLIENTLIBS) 
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_dirtiling: test_dirtiling.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_interesttiling: test_interesttiling.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_stattiling: test_stattiling.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_bmark_dir: test_bmark_dir.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_bmark_dir1: test_bmark_dir1.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_bmark_int: test_bmark_int.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_bmark_int1: test_bmark_int1.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_bmark_pet: test_bmark_pet.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_bmark_stat: test_bmark_stat.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

gen_pattern: gen_pattern.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) $(TOOLS)

test_transaction: test_transaction.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS)

test_db2blob: test_db2blob.o $(DEFCLIENTLIBS)
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ -mt $^ -lm $(DB2LDFLAGS) $(SUPPORTLIBS)

test_db2blob.cc: test_db2blob.sqC
	db2 connect to sample
	db2 prep $< bindfile OUTPUT $@
	db2 bind test_db2blob.bnd
	db2 connect reset

.PHONY : raslib
raslib:
	cd $(RMANBASE)/raslib; $(MAKE)

.PHONY : rasodmg
rasodmg:
	cd $(RMANBASE)/rasodmg; $(MAKE)

.PHONY : clientcomm
clientcomm:
	cd $(RMANBASE)/clientcomm; $(MAKE)


rasql:  readln.o rasql.o 
	$(CXX) -o rasql $^ -L$(SUPPORT_BASE)/lib -lreadline -lcurses
	ln -s -f $(RMANHOME)/rasodmg/test/rasql $(RMANHOME)/bin/rasql


updatemap: updatemap.o updatemap_util.o updatemap_error.o $(DEFCLIENTLIBS)
ifeq ($(OSTYPE),$(OSTYPE_SOLARIS))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -lm $(SUPPORTLIBS) -lNCSCNet -lNCSEcw -lNCSUtil -mt
endif
ifeq ($(OSTYPE),$(OSTYPE_LINUX))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ -Xlinker -Bstatic $(SUPPORTLIBS) 
endif
ifeq ($(OSTYPE),$(OSTYPE_OSF1))
	$(PURIFY) $(CXX) $(LDFLAGS) -o $@ $^ $(SUPPORTLIBS)
endif

PHONY: clean
clean:
	-rm $(MISCCLEAN)

######################## Dependencies ############################

# automatically created dependencies
include Makefile.dep