Revision 502
Added by Aaron Marcuse-Kubitza almost 13 years ago
inputs/input.Makefile | ||
---|---|---|
10 | 10 |
DIFF = diff --unified=2 |
11 | 11 |
|
12 | 12 |
tablesSort := plots organisms stems |
13 |
vegxMaps := $(wildcard $(tablesSort:%=map.VegX.%.csv))
|
|
14 |
vegxMaps += $(filter-out $(vegxMaps),$(wildcard map.VegX.*.csv))
|
|
15 |
tables := $(vegxMaps:map.VegX.%.csv=%)
|
|
16 |
vegbienMaps := $(subst .VegX.,.VegBIEN.,$(vegxMaps))
|
|
13 |
vegxMaps := $(wildcard $(tablesSort:%=maps/VegX.%.csv))
|
|
14 |
vegxMaps += $(filter-out $(vegxMaps),$(wildcard maps/VegX.*.csv))
|
|
15 |
tables := $(vegxMaps:maps/VegX.%.csv=%)
|
|
16 |
vegbienMaps := $(subst VegX.,VegBIEN.,$(vegxMaps))
|
|
17 | 17 |
|
18 | 18 |
root := $(selfDir_3d1bc249).. |
19 | 19 |
psqlAsBien := $(root)/bin/psql_vegbien |
... | ... | |
39 | 39 |
./$* >$@ |
40 | 40 |
.PRECIOUS: %.out |
41 | 41 |
|
42 |
all += $(wildcard *.out) |
|
43 |
|
|
44 | 42 |
$(root)/%: _always |
45 | 43 |
+$(subMake) |
46 | 44 |
|
... | ... | |
54 | 52 |
|
55 | 53 |
all += $(vegbienMaps) |
56 | 54 |
|
57 |
map.VegBIEN.%.csv: map.VegX.%.csv $(root)/mappings/VegX-VegBIEN.%.csv
|
|
55 |
maps/VegBIEN.%.csv: maps/VegX.%.csv $(root)/mappings/VegX-VegBIEN.%.csv
|
|
58 | 56 |
$(root)/bin/join_sort <$+ >$@ |
59 |
.PRECIOUS: map.VegBIEN.%.csv
|
|
57 |
.PRECIOUS: maps/VegBIEN.%.csv
|
|
60 | 58 |
|
61 | 59 |
##### |
62 | 60 |
|
... | ... | |
73 | 71 |
|
74 | 72 |
verify: _always $(addprefix verify-,$(tables)) ; |
75 | 73 |
|
76 |
verify-%: verify.%.ref verify.%.out _always
|
|
74 |
verify-%: verify/%.ref verify/%.out _always
|
|
77 | 75 |
$(DIFF) $(+_) |
78 | 76 |
|
79 | 77 |
%.out: %.sql _always |
... | ... | |
82 | 80 |
out_cmd = $(psqlAsBien) --no-align --field-separator=' ' --pset=footer=off \ |
83 | 81 |
--pset=null=NULL <$< >$@ |
84 | 82 |
|
83 |
all += $(wildcard verify/*.out) |
|
84 |
|
|
85 | 85 |
##### |
86 | 86 |
|
87 | 87 |
test: _always $(addprefix test-,$(tables)) ; |
88 | 88 |
|
89 |
test-%: test.%.out _always
|
|
89 |
test-%: test/%.out _always
|
|
90 | 90 |
$(DIFF) $(<:.out=.ref) $< |
91 | 91 |
|
92 | 92 |
accept-%: _always |
93 | 93 |
$(CP) $* $(*:.out=.ref) |
94 | 94 |
|
95 |
all += $(wildcard test/*.out) |
|
96 |
|
|
95 | 97 |
##### |
96 | 98 |
|
97 | 99 |
ifdef db |
... | ... | |
107 | 109 |
mysqlAsRoot := $(call mysqlAs,root) |
108 | 110 |
mysqlAsBien := $(call mysqlAs,bien) |
109 | 111 |
|
110 |
import-%: map.VegBIEN.%.csv _always
|
|
112 |
import-%: maps/VegBIEN.%.csv _always
|
|
111 | 113 |
-$(import_cmd) |
112 | 114 |
import_cmd = (set -x; "time" env commit=1 $(map) $<) \ |
113 | 115 |
$(if $(n),,>>$(log)) 2>&1$(if $(n),|tee -a $(log)) |
... | ... | |
140 | 142 |
|
141 | 143 |
#### |
142 | 144 |
|
143 |
test.%.out: map.VegBIEN.%.csv _always
|
|
145 |
test/%.out: maps/VegBIEN.%.csv _always
|
|
144 | 146 |
env test=1 n=$(test_n) $(map) $< >$@ 2>&1 || { e=$$?; cat $@; exit $$e;} |
145 |
.PRECIOUS: test.%.out
|
|
147 |
.PRECIOUS: test/%.out
|
|
146 | 148 |
|
147 | 149 |
##### |
148 | 150 |
|
Also available in: Unified diff
input.Makefile: Remove *.out in new verify and test subdirs