Revision 4117
Added by Aaron Marcuse-Kubitza over 12 years ago
input.Makefile | ||
---|---|---|
117 | 117 |
coreMap := $(mappings)/$(via)-VegBIEN.csv |
118 | 118 |
coreSelfMap := $(mappings)/$(via).self.csv |
119 | 119 |
|
120 |
viaMaps := $(wildcard $(tablesSort:%=maps/$(via).%.csv))
|
|
121 |
viaMaps += $(filter-out $(viaMaps),$(srcMaps:maps/src.%=maps/$(via).%))
|
|
122 |
viaMaps += $(filter-out $(viaMaps) $(fullViaMap),$(wildcard maps/$(via).*.csv))
|
|
120 |
viaMaps := $(wildcard $(tablesSort:%=maps/map.%.csv))
|
|
121 |
viaMaps += $(filter-out $(viaMaps),$(srcMaps:maps/src.%=maps/map.%))
|
|
122 |
viaMaps += $(filter-out $(viaMaps) $(fullViaMap),$(wildcard maps/map.*.csv))
|
|
123 | 123 |
|
124 |
autogenMaps := $(subst $(via).,VegBIEN.,$(viaMaps))
|
|
124 |
autogenMaps := $(subst map.,VegBIEN.,$(viaMaps))
|
|
125 | 125 |
directMaps := $(autogenMaps) $(filter-out $(autogenMaps),\ |
126 | 126 |
$(wildcard maps/VegBIEN.*.csv)) |
127 | 127 |
tables := $(directMaps:maps/VegBIEN.%.csv=%) |
... | ... | |
206 | 206 |
env ignore=1 $(bin)/union <$(wordlist 1,2,$+)|,<$< )$(bin)/sort_map >$@ |
207 | 207 |
# can't use $(wildcard) because it won't recheck file after $(coreSelfMap) runs |
208 | 208 |
|
209 |
# Must come before maps/$(via).%.csv to override it
|
|
210 |
maps/$(via).%.full.csv: maps/$(via).%.csv $(coreSelfMap) $(srcMap)
|
|
209 |
# Must come before maps/map.%.csv to override it
|
|
210 |
maps/map.%.full.csv: maps/map.%.csv $(coreSelfMap) $(srcMap)
|
|
211 | 211 |
$(makeFullCsv) |
212 | 212 |
$(joinSrcMap) |
213 | 213 |
maps += $(patsubst maps/%.csv,maps/%.full.csv,$(viaMaps)) |
214 | 214 |
|
215 | 215 |
# Via maps cleanup |
216 | 216 |
ifneq ($(filter maps/.%.last_cleanup,$(MAKECMDGOALS)),) |
217 |
maps/.$(via).%.csv.last_cleanup: maps/$(via).%.csv $(coreMap)
|
|
217 |
maps/.map.%.csv.last_cleanup: maps/map.%.csv $(coreMap)
|
|
218 | 218 |
$(bin)/in_place $< env ignore=1 $(bin)/subtract $(word 2,$+) 0 1 2 |
219 | 219 |
touch $@ |
220 | 220 |
# Include comment column so commented mappings are never removed |
221 | 221 |
else |
222 |
maps/$(via).%.csv: maps/src.%.csv _always
|
|
222 |
maps/map.%.csv: maps/src.%.csv _always
|
|
223 | 223 |
$(if $(wildcard $@),,$(if $(wildcard $<),$(CP) $< $@)) |
224 | 224 |
+$(selfMake) $(@:maps/%=maps/.%.last_cleanup) |
225 | 225 |
endif |
226 | 226 |
|
227 |
maps/VegBIEN.%.csv: maps/$(via).%.full.csv $(coreMap)
|
|
227 |
maps/VegBIEN.%.csv: maps/map.%.full.csv $(coreMap)
|
|
228 | 228 |
$(bin)/join <$+|$(bin)/sort_map >$@ |
229 | 229 |
maps += $(autogenMaps) |
230 | 230 |
|
Also available in: Unified diff
inputs: Replaced Veg+ prefix with map on via maps, using the steps at <https://projects.nceas.ucsb.edu/nceas/projects/bien/wiki/VegCSV_subfolders#Replace-Veg-prefix-with-map-on-via-maps>