Project

General

Profile

« Previous | Next » 

Revision 3764

root Makefile, input.Makefile: Maps validation: Treat missing join mappings differently from missing non-empty join mappings, because they indicate mapping to an invalid location, which is a bug. Factored maps validation code out into new lib/mappings.Makefile.

View differences:

inputs/input.Makefile
248 248

  
249 249
##### Maps validation
250 250

  
251
missing_mappings: _always missing_join_mappings missing_input_mappings ;
251
missingMappingsCmd = +$(selfMake) remake 2>&1\
252
|$(SED) -n 's/^.*No $(*2Space) mapping for ([0-9A-Za-z_-]+).*$$/\1/p'\
253
$(if $(filter non-empty_join,$*),|$(bin)/ucase_first 0)|sort|uniq
252 254

  
253
missing_%_mappings: _always # stem is one of join|input
254
	@echo $(emph)"Missing $* mappings:"$(endEmph)
255
	@+$(selfMake) remake 2>&1\
256
|$(SED) -n 's/^.*No.* $* mapping for ([0-9A-Za-z_-]+).*$$/\1/p'\
257
$(if $(filter join,$*),|$(bin)/ucase_first 0)|sort|uniq
255
include $(root)/lib/mappings.Makefile
258 256

  
259 257
##### External dependencies
260 258

  
lib/mappings.Makefile
1
ifndef missingMappingsCmd
2
$(error $$(missingMappingsCmd) required)
3
endif
4

  
5
missingMappingTypes = join non-empty_join input
6

  
7
missing_mappings: _always $(missingMappingTypes:%=missing_%_mappings) ;
8

  
9
missingMappingsMsg = Missing $(*2Space) mappings:$(if\
10
$(filter join,$*), (indicates mapping to invalid location))
11

  
12
missing_%_mappings: _always # stem is one of $(missingMappingTypes)
13
	@echo $(emph)"$(missingMappingsMsg)"$(endEmph)
14
	@$(missingMappingsCmd)
Makefile
327 327

  
328 328
# Must come after Subdir forwarding to avoid infinite recursion, for some reason
329 329

  
330
missing_mappings: _always missing_join_mappings missing_input_mappings ;
330
missingMappingsCmd = +$(MAKE) inputs/$@|grep -vEe '(common|mappings).Makefile'\
331
-e ' Missing ' $(if $(filter non-empty_join,$*), -e '^make '|sort|uniq)
331 332

  
332
missing_%_mappings: _always # stem is one of join|input
333
	@echo $(emph)"Missing $* mappings:"$(endEmph)
334
	@+$(MAKE) inputs/$@|grep -v -e 'common.Makefile' -e ' Missing '\
335
$(if $(filter join,$*), -e '^make '|sort|uniq)
333
include lib/mappings.Makefile

Also available in: Unified diff