forked from ngageoint/hootenanny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.hoot
591 lines (492 loc) · 26.6 KB
/
Makefile.hoot
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# If the silent flag is passed to make then make Maven and npm quiet too.
ifneq (,$(findstring s,$(MAKEFLAGS)))
MVN_QUIET='-q'
NPM_QUIET=-s > /dev/null 2>&1
else
HOOT_TEST_DIFF='--diff'
endif
SHELL=/bin/bash
.PHONY: clean-ccache
# If you're adding another schema file be sure and update the archive target
# too.
# NOTE: This is the list that gets deleted in "make clean"
SCHEMA_FILES=translations/tds61_schema.js translations/tds61_full_schema.js translations/etds61_rules.js translations/etds61_osm_rules.js translations/tds40_schema.js translations/tds40_full_schema.js translations/etds40_rules.js translations/etds40_osm_rules.js translations/mgcp_schema.js translations/emgcp_rules.js translations/emgcp_osm_rules.js translations/ggdm30_schema.js translations/ggdm30_full_schema.js translations/eggdm30_rules.js translations/eggdm30_osm_rules.js translations/tds70_schema.js translations/tds70_full_schema.js translations/etds70_rules.js translations/etds70_osm_rules.js
-include Makefile.inc
default: build
all: build
always:
# builds everything
build: core ui-build
# This is a bit of misnomer, as it builds core and services. It should be modified to build core and
# the services db only.
core: makedirs js-make qt-make services-build model-build conf/dictionary/words.sqlite osmapidb \
conf/dictionary/WordsAbridged.sqlite hoot-services/src/main/resources/language-translation/langdetect-183.bin
makedirs:
mkdir -p $$HOOT_HOME/userfiles/changesets
mkdir -p $$HOOT_HOME/userfiles/customscript
mkdir -p $$HOOT_HOME/userfiles/ingest/processed/BASEMAP
mkdir -p $$HOOT_HOME/userfiles/ingest/upload/BASEMAP
mkdir -p $$HOOT_HOME/userfiles/reports
mkdir -p $$HOOT_HOME/userfiles/tmp/upload
clean: Makefile.qmake ui-clean services-clean clean-coverage
$(MAKE) -f Makefile.qmake clean 2>&1 \
| grep -v -e ".*WARNING: Failure to find: tmp/swig/HootSwig.cxx.*" \
|| true \
; [ "$${PIPESTATUS[0]}" == "0" ] && true || false
rm -f `find . -name Makefile.qmake`
rm -f `find . -name \*.gcov`
rm -f lib/*
rm -rf test-output/*
rm -rf tgs/libTgs.a
rm -rf hoot-core/tmp/debug/* hoot-core-test/tmp/debug/* tbs/tmp/debug/* hoot-js/tmp/debug/* hoot-test/tmp/debug/* tgs/tmp/debug/* hoot-cmd/tmp/debug/*
rm -rf bin/*
rm -f translations/config.js
rm -f conf/core/ConfigOptions.json
rm -f conf/services/conflationTypeGroups.json
rm -f translations/*.pyc
rm -f $(SCHEMA_FILES)
rm -f hoot-core/src/main/cpp/hoot/core/HootConfig.h
# The following bits are due to moving files in git. Since the Output.osm
# file is written to the test-files/cases/**/ directory git won't remove
# the directory. Doing this as part of clean will ensure that the
# directories are removed.
# remove any empty test cases
find test-files/cases -type f -name Output.osm -exec rm {} \;
# call this command 3 times b/c there may be sub-dirs that need deleteing.
rm -rf `find test-files/cases -type d -empty`
rm -rf `find test-files/cases -type d -empty`
rm -rf `find test-files/cases -type d -empty`
cd docs; $(MAKE) clean
ifeq ($(BUILD_SERVICES),services)
scripts/database/CleanOsmApiDB.sh
rm -f scripts/database/blank_osmapidb.sql
endif
ifeq ($(BUILD_UI_TESTS),uitests)
cd $$HOOT_HOME/test-files/ui && $(MAKE) -f Makefile clean
endif
clean-db: services-clean-db
# start over as close to a new build as is reasonable
clean-all: clean clean-db clean-ccache clean-coverage
clean-coverage: services-clean-coverage ui-clean-coverage
rm -rf coverage
rm -f `find . -name *.gcda`
# clean-all should call `ccache -C` to clear the cache if ccache is available
clean-ccache:
ifneq (, $(shell command -v ccache))
@ccache -C >/dev/null 2>&1
endif
check: test
test: build services-test-all translations-test
bin/HootTest $(HOOT_TEST_DIFF) --glacial --parallel
docs: always HOOT_VERSION_FILE services-docs
echo Building documentation...
cd docs; $(MAKE)
test-quick: build
bin/HootTest $(HOOT_TEST_DIFF) --quick --parallel
test-all-core: services-test-all translations-test
# Don't run services tests at the same time as glacial -- that may stomp
# on each other's DB changes.
bin/HootTest $(HOOT_TEST_DIFF) --glacial --parallel
test-all-no-core: services-test-all translations-test
$(MAKE) ui-test ui2x-test
test-all: test-all-no-core
# Don't run services tests at the same time as glacial -- that may stomp
# on each other's DB changes.
bin/HootTest $(HOOT_TEST_DIFF) --glacial --parallel
licenses:
scripts/copyright/UpdateAllCopyrightHeaders.sh
translations-test: build
ifneq ($(shell which mocha),)
cd translations; npm install && npm test
else
@echo Skipping mocha tests
endif
# Prepend HOOT_ to all config variables.
hoot-core/src/main/cpp/hoot/core/HootConfig.h: config.h
echo "#ifndef __HOOT_CONFIG_H__" > hoot-core/src/main/cpp/hoot/core/HootConfig.h
echo "#define __HOOT_CONFIG_H__" >> hoot-core/src/main/cpp/hoot/core/HootConfig.h
/bin/sed -r -e 's/^(#[ \t]*define) /\1 HOOT_/' config.h >> hoot-core/src/main/cpp/hoot/core/HootConfig.h
echo "#endif" >> hoot-core/src/main/cpp/hoot/core/HootConfig.h
hoot-core/src/main/cpp/hoot/core/util/ConfigDefaults.h: hoot-core/src/main/cpp/hoot/core/util/ConfigOptions.h
hoot-core/src/main/cpp/hoot/core/util/ConfigOptions.h: conf/core/ConfigOptions.asciidoc scripts/core/CreateConfigCode.py
python scripts/core/CreateConfigCode.py conf/core/ConfigOptions.asciidoc hoot-core/src/main/cpp/hoot/core/util/ConfigOptions.h hoot-core/src/main/cpp/hoot/core/util/ConfigDefaults.h
conf/core/ConfigOptions.json: scripts/core/CreateConfigAsJSON.py conf/core/ConfigOptions.asciidoc
python $^ $@ || (rm -f $@ ; exit -1)
conf/services/conflationHoot2Ops.json: scripts/services/CreateConflationTypeGroups.py conf/services/conflationTypes.json conf/core/ConfigOptions.json conf/services/conflationTypeDefaults.json
python $^ $@ || (rm -f $@ ; exit -1)
conf/services/importHoot2Ops.json: scripts/services/CreateConflationTypeGroups.py conf/services/importTypes.json conf/core/ConfigOptions.json conf/services/conflationTypeDefaults.json
python $^ $@ || (rm -f $@ ; exit -1)
translations/config.js: conf/core/ConfigOptions.asciidoc scripts/core/CreateJsConfigCode.py
python scripts/core/CreateJsConfigCode.py conf/core/ConfigOptions.asciidoc translations/config.js
tgs/src/main/cpp/tgs/TgsConfig.h: config.h
echo "#ifndef __TGS_CONFIG_H__" > tgs/src/main/cpp/tgs/TgsConfig.h
echo "#define __TGS_CONFIG_H__" >> tgs/src/main/cpp/tgs/TgsConfig.h
/bin/sed -r -e 's/^(#[ \t]*define) /\1 TGS_/' config.h >> tgs/src/main/cpp/tgs/TgsConfig.h
echo "#endif" >> tgs/src/main/cpp/tgs/TgsConfig.h
# We now have different versions of the TDS Schema that are built from Excel files:
# LTDSv40.csv.gz - Local TDS v4.0
# SUTDSv40.csv.gz - Specialized Urban TDS v4.0
# TDSv40.csv.gz - Full TDS v4.0
# The default is to use the LTDSv40 file so we can append to existing LTDS templates
#
# The MGCP schema is built from an XML file
#
# The Macro's are for Jason :-)
##### MGCP
# Build the MGCP schema
translations/mgcp_schema.js: scripts/schema/ConvertMGCPSchema_XML.py conf/translations/MGCP_FeatureCatalogue_TRD4_v4.5_20190208.xml.gz
mkdir -p $(@D)
$^ > $@ || (rm -f $@ ; exit -1)
# Build the MGCP "To English" rules
translations/emgcp_rules.js: scripts/schema/ConvertMGCPSchema_XML.py conf/translations/MGCP_FeatureCatalogue_TRD4_v4.5_20190208.xml.gz
mkdir -p $(@D)
$< --toenglish $(word 2,$^) > $@ || (rm -f $@ ; exit -1)
# Build the MGCP "From English" rules
translations/emgcp_osm_rules.js: scripts/schema/ConvertMGCPSchema_XML.py conf/translations/MGCP_FeatureCatalogue_TRD4_v4.5_20190208.xml.gz
mkdir -p $(@D)
$< --fromenglish $(word 2,$^) > $@ || (rm -f $@ ; exit -1)
# $< --fromenglish $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
#### TDSv40
translations/tds40_schema.js: scripts/schema/ConvertTDSv40Schema.py conf/translations/TDSv40.csv.gz
mkdir -p $(@D)
$^ > $@ || (rm -f $@ ; exit -1)
translations/tds40_full_schema.js: scripts/schema/ConvertTDSv40Schema.py conf/translations/TDSv40.csv.gz
mkdir -p $(@D)
$< --fullschema $(word 2,$^) > $@ || (rm -f $@ ; exit -1)
# Build the TDS40 "To English" rules
# This need to be full TDS so we have access to the full range of attributes
translations/etds40_rules.js: scripts/schema/ConvertTDSv40Schema.py conf/translations/TDSv40.csv.gz
mkdir -p $(@D)
$< --toenglish $(word 2,$^) > $@ || (rm -f $@ ; exit -1)
# Build the TDS40 "From English" rules
translations/etds40_osm_rules.js: scripts/schema/ConvertTDSv40Schema.py conf/translations/TDSv40.csv.gz
mkdir -p $(@D)
$< --fromenglish $(word 2,$^) > $@ || (rm -f $@ ; exit -1)
# $< --fromenglish $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
#### TDSv61
# TDSv61 is built from the TDSv60 spec with NGA's extensions
translations/tds61_schema.js: scripts/schema/ConvertTDSv61Schema.py conf/translations/TDSv60.csv.gz conf/translations/TDS_NGAv01.csv.gz
mkdir -p $(@D)
$< $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
# TDSv61 full schema is built from the TDSv60 spec with NGA's extensions.
# This one has all of the Text Enumerations
translations/tds61_full_schema.js: scripts/schema/ConvertTDSv61Schema.py conf/translations/TDSv60.csv.gz conf/translations/TDS_NGAv01.csv.gz
mkdir -p $(@D)
$< --fullschema $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
# Build the TDS61 "To English" rules
translations/etds61_rules.js: scripts/schema/ConvertTDSv61Schema.py conf/translations/TDSv60.csv.gz conf/translations/TDS_NGAv01.csv.gz
mkdir -p $(@D)
$< --toenglish $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
# Build the TDS61 "From English" rules
translations/etds61_osm_rules.js: scripts/schema/ConvertTDSv61Schema.py conf/translations/TDSv60.csv.gz conf/translations/TDS_NGAv01.csv.gz
mkdir -p $(@D)
$< --fromenglish $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
#### TDSv70
# TDSv70 schema is built from an XML file made from a sample FGDB
#translations/tds70_schema.js: scripts/schema/ConvertTDSv70Schema_XML.py conf/translations/TDSv70.xml.gz conf/translations/TDSv70.xml.gz
translations/tds70_schema.js: scripts/schema/ConvertTDSv70Schema.py conf/translations/TDSv70_Features.csv.gz conf/translations/TDSv70_Values.csv.gz
mkdir -p $(@D)
$^ > $@ || (rm -f $@ ; exit -1)
# TDSv70 full schema is built from an XML file made from a sample FGDB
# This one has all of the Text Enumerations
#translations/tds70_full_schema.js: scripts/schema/ConvertTDSv70Schema_XML.py conf/translations/TDSv70.xml.gz
translations/tds70_full_schema.js: scripts/schema/ConvertTDSv70Schema.py conf/translations/TDSv70_Features.csv.gz conf/translations/TDSv70_Values.csv.gz
mkdir -p $(@D)
$< --fullschema $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
# Build the TDS70 "To English" rules
#translations/etds70_rules.js: scripts/schema/ConvertTDSv70Schema_XML.py conf/translations/TDSv70.xml.gz
translations/etds70_rules.js: scripts/schema/ConvertTDSv70Schema.py conf/translations/TDSv70_Features.csv.gz conf/translations/TDSv70_Values.csv.gz
mkdir -p $(@D)
$< --toenglish $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
# Build the TDS70 "From English" rules
#translations/etds70_osm_rules.js: scripts/schema/ConvertTDSv70Schema_XML.py conf/translations/TDSv70.xml.gz
translations/etds70_osm_rules.js: scripts/schema/ConvertTDSv70Schema.py conf/translations/TDSv70_Features.csv.gz conf/translations/TDSv70_Values.csv.gz
mkdir -p $(@D)
$< --fromenglish $(word 2,$^) $(word 3,$^) > $@ || (rm -f $@ ; exit -1)
#### GGDMv30
# GGDMv30 is built from the GGDMv30 spec with additional layers and values files
translations/ggdm30_schema.js: scripts/schema/ConvertGGDMv30Schema.py conf/translations/GGDM30_Features.csv.gz conf/translations/GGDM30_Layers.csv.gz conf/translations/GGDM30_Values.csv.gz
mkdir -p $(@D)
$< $(word 2,$^) $(word 3,$^) $(word 4,$^) > $@ || (rm -f $@ ; exit -1)
# GGDMv30 full schema
# This one has all of the Text Enumerations
translations/ggdm30_full_schema.js: scripts/schema/ConvertGGDMv30Schema.py conf/translations/GGDM30_Features.csv.gz conf/translations/GGDM30_Layers.csv.gz conf/translations/GGDM30_Values.csv.gz
mkdir -p $(@D)
$< --fullschema $(word 2,$^) $(word 3,$^) $(word 4,$^) > $@ || (rm -f $@ ; exit -1)
# Build the GGDMv30 "To English" rules
translations/eggdm30_rules.js: scripts/schema/ConvertGGDMv30Schema.py conf/translations/GGDM30_Features.csv.gz conf/translations/GGDM30_Layers.csv.gz conf/translations/GGDM30_Values.csv.gz
mkdir -p $(@D)
$< --toenglish $(word 2,$^) $(word 3,$^) $(word 4,$^) > $@ || (rm -f $@ ; exit -1)
# Build the GGDMv30 "From English" rules
translations/eggdm30_osm_rules.js: scripts/schema/ConvertGGDMv30Schema.py conf/translations/GGDM30_Features.csv.gz conf/translations/GGDM30_Layers.csv.gz conf/translations/GGDM30_Values.csv.gz
mkdir -p $(@D)
$< --fromenglish $(word 2,$^) $(word 3,$^) $(word 4,$^) > $@ || (rm -f $@ ; exit -1)
# Build osmapi db
osmapidb:
ifeq ($(BUILD_SERVICES),services)
scripts/database/SetupOsmApiDB.sh
endif
# Build automatically generated JS files
js-make: $(SCHEMA_FILES) translations/config.js
# The older .arff files don't have the precision to recreate the exact model. That is a task for
# another time.
ARFFS=$(wildcard conf/models/*.arff.bz2)
RF_MODELS=$(ARFFS:.arff.bz2=.rf)
model-build: $(RF_MODELS)
# These are not cleaned b/c they take a long time to build and it would simply
# be unnecessary. Use the appropriate git command if you want everything
# cleaned.
conf/models/%.rf: conf/models/%.arff.bz2 qt-make always
if test ! -e $@ || \
test $< -nt $@ ||\
(test -e $(@:.rf=.sha1sum) && test "$$(sha1sum $@)" != "$$(cat $(@:.rf=.sha1sum))"); then \
test -e $(@:.rf=.sha1sum) || echo "Please create a sha1sum for $@."; \
( test -e $(@:.rf=.sha1sum) && test -e $@ && test "$$(sha1sum $@)" != "$$(cat $(@:.rf=.sha1sum))" ) && echo "Rebuilding $@ due to mismatched sha1sum." ; \
hoot build-model $< $@ ; \
sha1sum $@ > $(@:.rf=.sha1sum); \
fi
qt-make: HOOT_VERSION_FILE Makefile.qmake hoot-core/src/main/cpp/hoot/core/HootConfig.h tgs/src/main/cpp/tgs/TgsConfig.h hoot-core/src/main/cpp/hoot/core/util/ConfigOptions.h hoot-core/src/main/cpp/hoot/core/util/ConfigDefaults.h bin/hoot bin/HootTest
$(MAKE) -f Makefile.qmake 2>&1 | grep -v -e ".*WARNING: Failure to find: tmp/swig/HootSwig.cxx.*" \
|| true \
; [ "$${PIPESTATUS[0]}" == "0" ] && true || false
services-build: HOOT_VERSION_FILE conf/services/conflationHoot2Ops.json conf/services/importHoot2Ops.json
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile build
endif
services-docs:
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile docs
endif
services-clean:
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile clean
endif
services-clean-db:
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile clean-db
endif
services-clean-coverage:
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile clean-coverage
endif
services-coverage:
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile coverage
endif
services-test: services-build
ifeq ($(BUILD_SERVICES),services)
echo "Running services tests..."
cd hoot-services && $(MAKE) -f Makefile test
endif
services-test-all: services-build
ifeq ($(BUILD_SERVICES),services)
cd hoot-services && $(MAKE) -f Makefile test-all
endif
ui-build: HOOT_VERSION_FILE
ifeq ($(BUILD_SERVICES),services)
cd hoot-ui && $(MAKE) -f Makefile clean && $(MAKE) -f Makefile all
endif
ui-clean:
ifeq ($(BUILD_UI_TESTS),uitests)
cd test-files/ui && $(MAKE) -f Makefile clean
endif
ui2x-build:
ifeq ($(BUILD_SERVICES),services)
cd $$HOOT_HOME/hoot-ui-2x && \
(npm i $(NPM_QUIET) || npm i $(NPM_QUIET)) && \
(npm run production $(NPM_QUIET) || npm run production $(NPM_QUIET))
endif
ui-test: services-build build docs
ifeq ($(BUILD_UI_TESTS),uitests)
ifeq ($(BUILD_SERVICES),services)
cd $$HOOT_HOME/test-files/ui && $(MAKE) -f Makefile test CUKE_OPTS=--fail-fast
else
echo "UI tests must specify both --with-services and --with-uitests."
endif
else
echo "UI tests must specify both --with-services and --with-uitests."
endif
ui2x-test: services-build build
ifeq ($(BUILD_UI_TESTS),uitests)
ifeq ($(BUILD_SERVICES),services)
scripts/database/AddKarmaTestUser.sh
cd $$HOOT_HOME/hoot-ui-2x && \
npm i && \
npm test
else
echo "UI tests must specify both --with-services and --with-uitests."
endif
else
echo "UI tests must specify both --with-services and --with-uitests."
endif
ui-coverage: services-build build
ifeq ($(BUILD_UI_TESTS),uitests)
ifeq ($(BUILD_SERVICES),services)
cd $$HOOT_HOME/test-files/ui && $(MAKE) -f Makefile coverage
else
echo "UI coverage must specify both --with-services and --with-uitests."
endif
else
echo "UI coverage must specify both --with-services and --with-uitests."
endif
ui-clean-coverage:
ifeq ($(BUILD_UI_TESTS),uitests)
ifeq ($(BUILD_SERVICES),services)
cd $$HOOT_HOME/test-files/ui && $(MAKE) -f Makefile clean-coverage
else
echo "UI clean coverage must specify both --with-services and --with-uitests."
endif
else
echo "UI clean coverage must specify both --with-services and --with-uitests."
endif
FORCE: vagrant
HOOT_VERSION_FILE: FORCE
$(SHELL_PATH) ./HOOT_VERSION_GEN;
-include HOOT_VERSION_FILE
rebuild-db:
scripts/database/DeleteAllTables.sh
cd hoot-services && $(MAKE) -f Makefile build
HOOT_TARNAME=hootenanny-$(HOOT_VERSION)
JAVADOC_TARBALL=docs/hootenanny-services-javadoc-$(HOOT_VERSION).tar.gz
dist: archive
archive: js-make services-docs docs
mkdir -p $(HOOT_TARNAME)/docs/
if [ "$(BUILD_SERVICES)" == "services" ]; then \
tar czf $(HOOT_TARNAME)/$(JAVADOC_TARBALL) hoot-services/target/site/apidocs; fi
rm -f $(HOOT_TARNAME).tar.gz
scripts/git/git-archive-all.sh --prefix $(HOOT_TARNAME)/ $(HOOT_TARNAME).tar
cp docs/*.pdf docs/*.html docs/*.text $(HOOT_TARNAME)/docs/
# Put the docs in their own compressed file
tar czf hootenanny-documentation-$(HOOT_VERSION).tar.gz $(HOOT_TARNAME)
cp Makefile.in missing aclocal.m4 configure config.h.in $(HOOT_TARNAME)
# Copy the protocol buffer generated files. Eases a dependency when building
# on CentOS
mkdir -p $(HOOT_TARNAME)/hoot-core/src/main/cpp/hoot/core/proto/
# Copy the auto-generated schema definitions. This eases another dependency on CentOS
mkdir -p $(HOOT_TARNAME)/translations/
# TDSv40
cp translations/tds40_schema.js $(HOOT_TARNAME)/translations/tds40_schema.js
cp translations/tds40_full_schema.js $(HOOT_TARNAME)/translations/tds40_full_schema.js
cp translations/etds40_rules.js $(HOOT_TARNAME)/translations/etds40_osm_rules.js
cp translations/etds40_osm_rules.js $(HOOT_TARNAME)/translations/etds40_osm_rules.js
# TDSv61
cp translations/tds61_schema.js $(HOOT_TARNAME)/translations/tds61_schema.js
cp translations/tds61_full_schema.js $(HOOT_TARNAME)/translations/tds61_full_schema.js
cp translations/etds61_rules.js $(HOOT_TARNAME)/translations/etds61_rules.js
cp translations/etds61_osm_rules.js $(HOOT_TARNAME)/translations/etds61_osm_rules.js
# TDSv70
cp translations/tds70_schema.js $(HOOT_TARNAME)/translations/tds70_schema.js
cp translations/tds70_full_schema.js $(HOOT_TARNAME)/translations/tds70_full_schema.js
cp translations/etds70_rules.js $(HOOT_TARNAME)/translations/etds70_rules.js
cp translations/etds70_osm_rules.js $(HOOT_TARNAME)/translations/etds70_osm_rules.js
# MGCP
cp translations/mgcp_schema.js $(HOOT_TARNAME)/translations/mgcp_schema.js
cp translations/emgcp_rules.js $(HOOT_TARNAME)/translations/emgcp_rules.js
cp translations/emgcp_osm_rules.js $(HOOT_TARNAME)/translations/emgcp_osm_rules.js
# GGDMv30
cp translations/ggdm30_schema.js $(HOOT_TARNAME)/translations/ggdm30_schema.js
cp translations/ggdm30_full_schema.js $(HOOT_TARNAME)/translations/ggdm30_full_schema.js
cp translations/eggdm30_rules.js $(HOOT_TARNAME)/translations/eggdm30_osm_rules.js
cp translations/eggdm30_osm_rules.js $(HOOT_TARNAME)/translations/eggdm30_osm_rules.js
# Create the version file
echo $(HOOT_VERSION) > $(HOOT_TARNAME)/version
# tar the file and zip it
tar rf $(HOOT_TARNAME).tar $(HOOT_TARNAME)/*
rm -rf $(HOOT_TARNAME)
gzip -9 $(HOOT_TARNAME).tar
LocalConfig.pri:
cp LocalConfig.pri.orig LocalConfig.pri
Makefile.qmake: Hootenanny.pro Configure.pri LocalConfig.pri
# suppress the harmless warning about generated HootSwig.cxx
# All the true craziness is so we use the qmake return code rather than
# the grep code.
qmake-qt5 2>&1 | grep -v -e ".*WARNING: Failure to find: tmp/swig/HootSwig.cxx.*" \
|| true \
; [ "$${PIPESTATUS[0]}" == "0" ] && true || false
tmp/schema.dot: qt-make
HootTest --single hoot::OsmSchemaTest
tmp/schema.png: tmp/schema.dot
neato -Tpng -Gsize=50,50\! -GK=3 -Gratio=.5 -Gmindist=1 -Gmclimit=10 -Gnodesep=4 -Granksep=4 -Gsplines=true -Glen=0.5 -Gconcentrate=true -Gdpi=50 -Goverlap=false -Elen=3 -o tmp/schema.png tmp/schema.dot
# Code Coverage
IGNORED=/usr/\* \*test/cpp\* \*/local/\* \*/tmp/moc/\* \*core/proto\* /opt/\* \*8/\*
# Passing the --quiet switch to lcov when -s is present is causing errors, so writing out to a log every time instead.
coverage/core/core/index.html:
echo "Generating core code coverage report..."
mkdir -p coverage/core/core
rm -f coverage/core/core/log
lcov --capture --ignore-errors source -d hoot-core/tmp/debug -b hoot-core/ --output-file coverage/core/core/Core.info 2>&1 | grep -v -F "geninfo" >> coverage/core/core/log
lcov -r coverage/core/core/Core.info $(IGNORED) \*tgs/src\* \*tbs/src\* -o coverage/core/core/CoreTrimmed.info 2>&1 | grep -v -F "geninfo" >> coverage/core/core/log
genhtml coverage/core/core/CoreTrimmed.info --output-directory coverage/core/core/ 2>&1 | grep -v -F "geninfo" >> coverage/core/core/log
coverage/core/tbs/index.html:
echo "Generating core tbs code coverage report..."
mkdir -p coverage/core/tbs
rm -f coverage/core/tbs/log
lcov --capture --ignore-errors source -d tbs/tmp/debug -b tbs/ --output-file coverage/core/tbs/Tbs.info 2>&1 | grep -v -F "geninfo" >> coverage/core/tbs/log
lcov -r coverage/core/tbs/Tbs.info $(IGNORED) -o coverage/core/tbs/TbsTrimmed.info 2>&1 | grep -v -F "geninfo" >> coverage/core/tbs/log
genhtml coverage/core/tbs/TbsTrimmed.info --output-directory coverage/core/tbs/ 2>&1 | grep -v -F "geninfo" >> coverage/core/tbs/log
coverage/core/tgs/index.html:
echo "Generating core tgs code coverage report..."
mkdir -p coverage/core/tgs
rm -f coverage/core/tgs/log
lcov --capture --ignore-errors source -d tgs/tmp/debug -b tgs/ --output-file coverage/core/tgs/Tgs.info 2>&1 | grep -v -F "geninfo" >> coverage/core/tgs/log
lcov -r coverage/core/tgs/Tgs.info $(IGNORED) -o coverage/core/tgs/TgsTrimmed.info 2>&1 | grep -v -F "geninfo" >> coverage/core/tgs/log
genhtml coverage/core/tgs/TgsTrimmed.info --output-directory coverage/core/tgs/ 2>&1 | grep -v -F "geninfo" >> coverage/core/tgs/log
coverage/core/cmd/index.html:
echo "Generating cmd code coverage report..."
mkdir -p coverage/core/cmd
rm -f coverage/core/cmd/log
lcov --capture --ignore-errors source -d hoot-cmd/tmp/debug -b hoot-cmd/ --output-file coverage/core/cmd/Cmd.info 2>&1 | grep -v -F "geninfo" >> coverage/core/cmd/log
lcov -r coverage/core/cmd/Cmd.info $(IGNORED) \*tgs/src\* \*hoot-core/src\* \*hoot-js/src\* -o coverage/core/cmd/CmdTrimmed.info 2>&1 | grep -v -F "geninfo" >> coverage/core/cmd/log
genhtml coverage/core/cmd/CmdTrimmed.info --output-directory coverage/core/cmd/ 2>&1 | grep -v -F "geninfo" >> coverage/core/cmd/log
coverage/core/js/index.html:
echo "Generating core js code coverage report..."
mkdir -p coverage/core/js
rm -f coverage/core/js/log
lcov --capture --ignore-errors source -d hoot-js/tmp/debug -b hoot-js/ --output-file coverage/core/js/Js.info 2>&1 | grep -v -F "geninfo" >> coverage/core/js/log
lcov -r coverage/core/js/Js.info $(IGNORED) \*hoot-core/src\* \*tgs/src\* -o coverage/core/js/JsTrimmed.info 2>&1 | grep -v -F "geninfo" >> coverage/core/js/log
genhtml coverage/core/js/JsTrimmed.info --output-directory coverage/core/js/ 2>&1 | grep -v -F "geninfo" >> coverage/core/js/log
coverage/core/josm/index.html:
ifeq ($(BUILD_JOSM),josm)
echo "Generating core JOSM code coverage report..."
mkdir -p coverage/core/josm
rm -f coverage/core/josm/log
lcov --capture --ignore-errors source -d hoot-josm/tmp/debug -b hoot-josm/ --output-file coverage/core/josm/Josm.info 2>&1 | grep -v -F "geninfo" >> coverage/core/josm/log
lcov -r coverage/core/josm/Josm.info $(IGNORED) \*hoot-core/src\* \*tgs/src\* -o coverage/core/josm/JosmTrimmed.info 2>&1 | grep -v -F "geninfo" >> coverage/core/josm/log
genhtml coverage/core/josm/JosmTrimmed.info --output-directory coverage/core/josm/ 2>&1 | grep -v -F "geninfo" >> coverage/core/josm/log
endif
core-coverage: coverage/core/core/index.html coverage/core/tbs/index.html coverage/core/tgs/index.html coverage/core/cmd/index.html coverage/core/js/index.html coverage/core/rnd/index.html coverage/core/josm/index.html
coverage: services-coverage ui-coverage core-coverage
conf/dictionary/WordsAbridged.sqlite: conf/dictionary/WordsAbridged.sqlite.gz
gunzip -c $^ > $@
conf/dictionary/words.sqlite: conf/dictionary/words1.sqlite
rm -f conf/dictionary/words.sqlite
[ -e $^ ] && ln -s words1.sqlite conf/dictionary/words.sqlite
# If you create a new words.sqlite please just increment the number rather than
# replacing the old file. This way we can maintain the history.
conf/dictionary/words1.sqlite:
([ -e /tmp/words1.sqlite.bz2 ] && \
test "`sha1sum /tmp/words1.sqlite.bz2`" == 'cdf47302fec4c8ec6c576849ae877feb1a9cf220 /tmp/words1.sqlite.bz2' && \
bzcat /tmp/words1.sqlite.bz2 > conf/dictionary/words1.sqlite) || \
(wget --quiet -N -P /tmp/ https://hoot-support.s3.amazonaws.com/words1.sqlite.bz2 && \
bzcat /tmp/words1.sqlite.bz2 > conf/dictionary/words1.sqlite) || \
echo "Failure downloading words1.sqlite. Build will continue, but conflation accuracy may suffer."
hoot-services/src/main/resources/language-translation/langdetect-183.bin:
if [ ! -f $@ ]; then echo "Downloading OpenNLP language detection model..."; wget --quiet -O $@ https://hoot-support.s3.amazonaws.com/langdetect-183.bin; fi
echo '2ddf585fac2e02a9dcfb9a4a9cc9417562eaac351be2efb506a2eaa87f19e9d4 hoot-services/src/main/resources/language-translation/langdetect-183.bin' | sha256sum -c || echo "OpenNLP language detection not available due to failure downloading model."
bin/HootEnv.sh: scripts/HootEnv.sh
mkdir -p bin
cp scripts/HootEnv.sh bin/HootEnv.sh
bin/HootTest: scripts/HootTest.sh bin/HootEnv.sh
mkdir -p bin
cp scripts/HootTest.sh bin/HootTest
bin/hoot: scripts/RunHoot.sh bin/HootEnv.sh
mkdir -p bin
cp scripts/RunHoot.sh bin/hoot
chmod +x bin/hoot
eclipse:
ifeq ($(BUILD_SERVICES),services)
scripts/maven/mvn-build $(MVN_QUIET) eclipse
endif
vagrant:
# Check the Vagrant.marker file data to see if provisioning needs to run
if [ -f Vagrant.marker ]; then if [ Vagrant.marker -ot VagrantProvision.sh ]; then echo; echo; echo "New dependencies have been added to Vagrant!"; echo "Please exit the vm and run 'vagrant provision' or"; echo "run 'touch Vagrant.marker' and re-run 'make' to continue."; echo; echo; false; fi fi