Project

General

Profile

« Previous | Next » 

Revision 3572

input.Makefile: Maps building: Via maps cleanup: Match maps/$(via).%.csv with pattern instead of $(viaMaps) var so that a non-existing via map will have the recipe run, too. When auto-creating via maps is later added, this will be required.

View differences:

inputs/input.Makefile
207 207
	-+$(subMake)
208 208
# ignore errors if $(coreSelfMap) does not exist
209 209

  
210
# Via maps cleanup
211
ifneq ($(filter maps/.%.last_cleanup,$(MAKECMDGOALS)),)
212
maps/.$(via).%.csv.last_cleanup: maps/$(via).%.csv $(coreMap)
213
	$(bin)/in_place $< env ignore=1 $(bin)/subtract $(word 2,$+) 0 1 2
214
	touch $@
215
# Include comment column so commented mappings are never removed
216
else
217
$(viaMaps): _always
218
	$(selfMake) $(@:maps/%=maps/.%.last_cleanup)
219
endif
220

  
221 210
joinSrcMap = $(if $(hasSrc),$(bin)/in_place $@ $(bin)/intersect $(word 3,$+) 0)
222 211
hasSrc = $(shell test -s $(word 3,$+) && echo t)
223 212

  
......
225 214
env ignore=1 $(bin)/union <$(wordlist 1,2,$+)|,<$< )$(bin)/sort_map >$@
226 215
# can't use $(wildcard) because it won't recheck file after $(coreSelfMap) runs
227 216

  
217
# Must come before maps/$(via).%.csv to override it
228 218
maps/$(via).%.full.csv: maps/$(via).%.csv $(coreSelfMap) $(srcMap)
229 219
	$(makeFullCsv)
230 220
	$(joinSrcMap)
231 221
maps += $(patsubst maps/%.csv,maps/%.full.csv,$(viaMaps))
232 222

  
223
# Via maps cleanup
224
ifneq ($(filter maps/.%.last_cleanup,$(MAKECMDGOALS)),)
225
maps/.$(via).%.csv.last_cleanup: maps/$(via).%.csv $(coreMap)
226
	$(bin)/in_place $< env ignore=1 $(bin)/subtract $(word 2,$+) 0 1 2
227
	touch $@
228
# Include comment column so commented mappings are never removed
229
else
230
maps/$(via).%.csv: _always
231
	+$(selfMake) $(@:maps/%=maps/.%.last_cleanup)
232
endif
233

  
233 234
maps/VegBIEN.%.csv: maps/$(via).%.full.csv $(coreMap)
234 235
	$(bin)/join <$+|$(bin)/sort_map >$@
235 236
maps += $(autogenMaps)

Also available in: Unified diff