Revision 1524
Added by Aaron Marcuse-Kubitza over 12 years ago
inputs/input.Makefile | ||
---|---|---|
43 | 43 |
|
44 | 44 |
# Commands |
45 | 45 |
join = $(bin)/join_union_sort |
46 |
selfMap = $(bin)/cols 0 0 |
|
46 | 47 |
psqlOpts := --set ON_ERROR_STOP=1 --quiet |
47 | 48 |
psqlAsBien := $(bin)/psql_vegbien $(psqlOpts) |
48 | 49 |
|
... | ... | |
86 | 87 |
via := $(firstword $(sort $(basename $(basename $(notdir $(allViaMaps)))))) |
87 | 88 |
|
88 | 89 |
coreMap := $(mappings)/$(via)-VegBIEN.%.csv |
89 |
selfMap := $(mappings)/$(via).self.%.csv
|
|
90 |
coreSelfMap := $(mappings)/$(via).self.%.csv
|
|
90 | 91 |
noEmptyMap := $(mappings)/$(via)-VegBIEN.%.no_empty.csv |
91 | 92 |
|
92 | 93 |
viaMaps := $(wildcard $(tablesSort:%=maps/$(via).%.csv)) |
... | ... | |
101 | 102 |
srcJoinMaps := $(srcMaps:maps/src.%.csv=maps/src.join.%.csv) |
102 | 103 |
|
103 | 104 |
# Must come before $(root)/% to override it |
104 |
$(selfMap): _always
|
|
105 |
$(coreSelfMap): _always
|
|
105 | 106 |
-+$(subMake) |
106 |
# ignore errors if $(selfMap) does not exist
|
|
107 |
# ignore errors if $(coreSelfMap) does not exist
|
|
107 | 108 |
|
108 | 109 |
# Via maps cleanup |
109 | 110 |
ifneq ($(filter maps/.%.last_cleanup,$(MAKECMDGOALS)),) |
110 |
maps/.$(via).%.csv.last_cleanup: maps/$(via).%.csv $(selfMap)
|
|
111 |
maps/.$(via).%.csv.last_cleanup: maps/$(via).%.csv $(coreSelfMap)
|
|
111 | 112 |
$(bin)/in_place $< $(bin)/subtract $(word 2,$+) 0 1 |
112 | 113 |
touch $@ |
113 | 114 |
# default: |
... | ... | |
125 | 126 |
|
126 | 127 |
makeFullCsv = $(if $(shell test -e $(word 2,$+) && echo t),\ |
127 | 128 |
env ignore=1 $(bin)/union <$+|$(bin)/sort_map >$@,$(CP) $< $@) |
128 |
# can't use $(wildcard) because it won't recheck file after $(selfMap) is run
|
|
129 |
# can't use $(wildcard) because it won't recheck file after $(coreSelfMap) runs
|
|
129 | 130 |
|
130 |
maps/$(via).%.full.csv: maps/$(via).%.csv $(selfMap)
|
|
131 |
maps/$(via).%.full.csv: maps/$(via).%.csv $(coreSelfMap)
|
|
131 | 132 |
$(makeFullCsv) |
132 | 133 |
maps += $(patsubst maps/%.csv,maps/%.full.csv,$(viaMaps)) |
133 | 134 |
|
134 | 135 |
maps/src.join.%.csv: maps/src.%.csv maps/$(via).%.full.csv $(noEmptyMap) |
135 |
$(bin)/cols 0 0 <$<|$(bin)/join $(word 2,$+)|$(join) $(word 3,$+) >$@
|
|
136 |
$(selfMap) <$<|$(bin)/join $(word 2,$+)|$(join) $(word 3,$+) >$@
|
|
136 | 137 |
maps += $(srcJoinMaps) |
137 | 138 |
|
138 | 139 |
maps: $(maps) _always ; |
Also available in: Unified diff
input.Makefile: Use var $(selfMap) instead of spelling out $(bin)/cols 0 0