-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
451 lines (377 loc) · 12.7 KB
/
Makefile.am
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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
#-----------------------------------------------------------------------------
# Project Makefile for WDB
#
# This file is processed by automake to generate the non-recursive
# project Makefile
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Global Settings
#-----------------------------------------------------------------------------
# Scanned by Autoreconf; must be static (no expansion)
ACLOCAL_AMFLAGS = -I config/m4
AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\"
AM_LDFLAGS = -L@builddir@
LIBTOOL_VERSION_FLAG = -release $(DEBIAN_VERSION)
# Compiler Settings
SED_SUBSTITUTION = sed s%__WDB_VERSION__%$(VERSION)%g $< \
| sed s%__WDB_LOGDIR__%@abs_builddir@/var/logs%g \
| sed s%__WDB_BUILDDIR__%@abs_builddir@%g \
| sed s%__WDB_SRCDIR__%@srcdir@%g \
| sed s%__WDB_BINDIR__%@bindir@%g \
| sed s%__WDB_LIBDIR__%@libdir@%g \
| sed s%__WDB_PKGLIBDIR__%$(libdir)/wdb%g \
| sed s%__WDB_PKGDATADIR__%$(pkgdatadir)%g \
| sed s%__WDB_DATADIR__%$(wdbdatadir)%g \
| sed s%__WDB_SYSCONFDIR__%@sysconfdir@%g \
| sed s%__WDB_LOCALSTATEDIR__%@localstatedir@%g \
| sed s%__WDB_BINDIR__%@bindir@%g \
| sed s%__POSTGIS_DIR__%@postgis_SQL@%g \
| sed s%__WDB_DBNAME__%$(DATABASE_NAME)%g \
| sed s%__WDB_LIB__%wdb.so%g \
| sed s%__WDB_SCHEMA__%wdb_int%g \
| sed s%__WCI_SCHEMA__%wci_int%g \
| sed s%__WCI_LIB__%wdb.so%g \
| sed s%__WDB_SRID__%$(DEFAULT_SRID)%g \
| sed s%__SCHEMA_VERSION__%$(SCHEMA_VERSION)%g \
| sed s%__OLD_VERSION__%$(OLD_MAJOR_VERSION).$(OLD_MINOR_VERSION).$(OLD_MICRO_VERSION)%g \
| sed s%__WDB_DISTDIR__%$(PACKAGE)-$(VERSION)%g \
> $@
CRON_COMPILE = $(SED_SUBSTITUTION);\
chmod 754 $@
CSV_COMPILE = $(SED_SUBSTITUTION)
ENT_COMPILE = $(SED_SUBSTITUTION)
SH_COMPILE = $(SED_SUBSTITUTION);\
chmod 754 $@
SQL_COMPILE = $(SED_SUBSTITUTION)
TEST_COMPILE = $(SED_SUBSTITUTION);\
chmod 754 $@
SUFFIXES = .in.cron .cron \
.in.csv .csv \
.in.ent .ent \
.in.sh .sh \
.in.sql .sql \
.in.test .test
# Compile Rules
.in.cron.cron:
$(CRON_COMPILE)
.in.csv.csv:
$(CSV_COMPILE)
.in.ent.ent:
$(ENT_COMPILE)
.in.sh.sh:
$(SH_COMPILE)
.in.sql.sql:
$(SQL_COMPILE)
.in.test.test:
$(TEST_COMPILE)
# Setting Targets
bin_PROGRAMS =
bin_SCRIPTS =
pkglib_PROGRAMS =
pkglib_SCRIPTS =
pkginclude_HEADERS =
lib_LTLIBRARIES =
sysconf_DATA =
man_MANS =
EXTRA_DIST =
EXTRA_PROGRAMS = $(installchecks)
CLEANFILES =
DISTCLEANFILES =
MOSTLYCLEANFILES =
dist_bin_SCRIPTS = wdb-config
dist_sysconf_DATA =
noinst_PROGRAMS =
noinst_SCRIPTS =
noinst_LIBRARIES =
noinst_DATA =
check_PROGRAMS =
check_LTLIBRARIES =
TESTS =
INSTALLTESTS =
PERFORMANCETESTS =
STABILITYTESTS =
# Share directory organization
wdbdatadir = $(datadir)/wdb
wdbdata_DATA =
sqldir = $(wdbdatadir)/sql
sql_DATA =
# Include directory organization
pkgincludedir = $(includedir)/wdb
#-----------------------------------------------------------------------------
# WDB Configuration
#-----------------------------------------------------------------------------
nodist_bin_SCRIPTS = wdb-config
DISTCLEANFILES += wdb-config
include src/wdb.mk
include doc/wdb.mk
include doc/doxygen/wdb.mk
include etc/metadata/wdb.mk
include etc/wdb/wdb.mk
include install/wdb.mk
include package/wdb.mk
include test/unit/wdb.mk
include src/callInterface/wdb.mk
include src/callInterface/core/wdb.mk
include src/callInterface/types/wdb.mk
include src/callInterface/api/wdb.mk
include src/callInterface/util/wdb.mk
include src/cleaningProgram/wdb.mk
include src/common/configuration/wdb.mk
include src/common/exception/wdb.mk
include src/common/logHandler/wdb.mk
include src/common/math/wdb.mk
include src/common/projection/wdb.mk
include src/database/wdb.mk
include src/blob/wdb.mk
include src/admin/wdb.mk
include src/admin/operations/wdb.mk
include src/admin/ui/cmdLine/wdb.mk
include test/install/callInterface/wdb.mk
include test/install/cleaningProgram/wdb.mk
include test/performance/callInterface/wdb.mk
include test/stability/callInterface/wdb.mk
include test/upgrade/wdb.mk
include test/utility/configuration/wdb.mk
include test/utility/testWrite/wdb.mk
# Unit Tests
include src/common/projection/test/wdb.mk
include src/callInterface/core/test/wdb.mk
include src/callInterface/types/test/wdb.mk
include examples/wdb.mk
include examples/C++/wdb.mk
include examples/sql/wdb.mk
#-----------------------------------------------------------------------------
# Cleaning
#-----------------------------------------------------------------------------
clean-local:
rm -f $(CLEANFILES)
$(DOCCLEAN_HOOK)
rm -rf @builddir@/var/
rm -f core.*
# Should not remove cores - hack for v0.3
# The dbclean target is used by Buildbot to clean-up after a failed distcheck.
dbclean:
dropdb wdb_distcheck
# @builddir@/install/uninstall_database -d wdb_distcheck
#-----------------------------------------------------------------------------
# Install Hooks
#-----------------------------------------------------------------------------
install-database:
mkdir -p @builddir@/var/logs/
rm -f @builddir@/var/logs/*
@builddir@/install/install_database -d $(DATABASE_NAME)
uninstall-database: install/uninstall_database
@builddir@/install/uninstall_database
# We cannot install the database unless we have installed the binaries in
# @prefix@, therefore we ommit database installation if DESTDIR has been set.
install-data-hook:
@if [[ $(DO_INSTALL_DATABASE) = "true" && ! "$(DESTDIR)" ]]; then \
$(MAKE) install-database; \
else \
echo "-------------------------------------------------------------------------------"; \
echo "Run <$(MAKE) install-database> to create the database"; \
echo "-------------------------------------------------------------------------------"; \
fi
uninstall-local:
@if [[ $(DO_INSTALL_DATABASE) = "true" && ! "$(DESTDIR)" ]]; then \
$(MAKE) uninstall-database; \
else \
echo "-------------------------------------------------------------------------------"; \
echo "Run <$(MAKE) uninstall-database> to drop the database and its users"; \
echo "-------------------------------------------------------------------------------"; \
fi
DISTCHECK_DATABASE_NAME = wdb_distcheck
DISTCHECK_CONFIGURE_FLAGS = --enable-database-install --with-database-name=$(DISTCHECK_DATABASE_NAME)
override distuninstallcheck_listfiles = find . -type f -! -name wdb.conf -print
distcheck-hook:
mkdir $(distdir)/_inst/etc/
echo "database = $(DISTCHECK_DATABASE_NAME)" > $(distdir)/_inst/etc/wdb.conf
#-----------------------------------------------------------------------------
# Makefile Maintenance
#-----------------------------------------------------------------------------
update-makefiles:
@for dir in @build_subdirs@ ; do \
echo "cp $(top_srcdir)/config/Makefile.am.subdir \
$(top_srcdir)/$$dir/Makefile.am" ; \
cp "$(top_srcdir)/config/Makefile.am.subdir" \
"$(top_srcdir)/$$dir/Makefile.am" || \
exit 1 ; \
done
#-----------------------------------------------------------------------------
# Install Check Framework
#-----------------------------------------------------------------------------
installcheck-local: run_installchecks installcheck_cleanup
# In case any tests are not well-behaved:
installcheck_cleanup:
psql `./wdbConfiguration --psqlArgs` -c "SELECT wci.begin('cleantest',999,999,999); SELECT cleanupdb()" >> /dev/null
run_installchecks: $(INSTALLTESTS)
@failed=0; \
all=0; \
xfail=0; \
xpass=0; \
skip=0; \
list='$(INSTALLTESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
echo " "; \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="test/install"; \
fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; \
fi
#-----------------------------------------------------------------------------
# Performance Check Framework
#-----------------------------------------------------------------------------
performancecheck: $(PERFORMANCETESTS)
@failed=0; \
all=0; \
xfail=0; \
xpass=0; \
skip=0; \
list='$(PERFORMANCETESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
echo " "; \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="test/install"; \
fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; \
fi
#-----------------------------------------------------------------------------
# Upgrade Check Framework
#-----------------------------------------------------------------------------
UPGRADECHECK_DATABASE_NAME = wdb_upgradecheck
UPGRADECHECK_CONFIGURE_FLAGS = --enable-database-install --with-database-name=$(UPGRADECHECK_DATABASE_NAME)
upgradecheck: all
@builddir@/test/upgrade/upgrade_test.sh
#-----------------------------------------------------------------------------
# WDB Debian Package
#-----------------------------------------------------------------------------
include config/mk/debian.mk
debian: common-debian