Revision 728
Added by Aaron Marcuse-Kubitza almost 13 years ago
inputs/input.Makefile | ||
---|---|---|
20 | 20 |
test_n ?= 2 |
21 | 21 |
tablesSort ?= plots organisms stems |
22 | 22 |
|
23 |
# Paths |
|
24 |
viaMaps := $(filter-out maps/VegBIEN.%.csv,$(wildcard maps/*.csv)) |
|
25 |
via := $(firstword $(sort $(basename $(basename $(notdir $(viaMaps)))))) |
|
26 |
viaMapsSort := $(wildcard $(tablesSort:%=maps/$(via).%.csv)) |
|
27 |
viaMaps := $(viaMapsSort) $(filter-out $(viaMapsSort),$(viaMaps)) |
|
28 |
tables := $(viaMaps:maps/$(via).%.csv=%) |
|
29 |
directMaps := $(subst $(via).,VegBIEN.,$(viaMaps)) |
|
30 |
directMaps += $(filter-out $(directMaps),$(wildcard maps/VegBIEN.*.csv)) |
|
31 |
dbFile := $(firstword $(wildcard src/db.*.sql)) |
|
32 |
|
|
33 | 23 |
+maps = $(filter maps/%,$(+_)) |
34 | 24 |
+in = $(filter-out maps/%,$(+_)) |
35 | 25 |
|
... | ... | |
63 | 53 |
|
64 | 54 |
##### |
65 | 55 |
|
56 |
allViaMaps := $(filter-out maps/VegBIEN.%.csv,$(wildcard maps/*.csv)) |
|
57 |
via := $(firstword $(sort $(basename $(basename $(notdir $(allViaMaps)))))) |
|
58 |
viaMapsSort := $(wildcard $(tablesSort:%=maps/$(via).%.csv)) |
|
59 |
viaMaps := $(viaMapsSort) $(filter-out $(viaMapsSort),$(viaMaps)) |
|
60 |
tables := $(viaMaps:maps/$(via).%.csv=%) |
|
61 |
autogenMaps := $(subst $(via).,VegBIEN.,$(viaMaps)) |
|
62 |
directMaps := $(autogenMaps) $(filter-out $(autogenMaps),\ |
|
63 |
$(wildcard maps/VegBIEN.*.csv)) |
|
64 |
|
|
66 | 65 |
maps: $(directMaps) _always ; |
67 | 66 |
|
68 |
all += $(directMaps)
|
|
67 |
.PRECIOUS: $(allViaMaps) $(directMaps)
|
|
69 | 68 |
|
69 |
all += $(autogenMaps) |
|
70 |
|
|
70 | 71 |
maps/VegBIEN.%.csv: maps/$(via).%.csv $(root)/mappings/$(via)-VegBIEN.%.csv |
71 | 72 |
$(root)/bin/join_sort <$+ >$@ |
72 |
.PRECIOUS: maps/VegBIEN.%.csv |
|
73 |
.PRECIOUS: maps/VegBIEN.%.csv $(root)/mappings/$(via)-VegBIEN.%.csv
|
|
73 | 74 |
|
74 | 75 |
##### |
75 | 76 |
|
77 |
dbFile := $(firstword $(wildcard src/db.*.sql)) |
|
78 |
|
|
76 | 79 |
ifneq ($(wildcard $(dbFile)),) |
77 | 80 |
|
78 | 81 |
import: _always import-all verify ; |
Also available in: Unified diff
input.Makefile: Preserve as many intermediate files as possible (make likes to delete intermediates if they aren't marked as .PRECIOUS)