Revision 4601
Added by Aaron Marcuse-Kubitza about 12 years ago
input.Makefile | ||
---|---|---|
282 | 282 |
|
283 | 283 |
# Via maps cleanup |
284 | 284 |
ifneq ($(filter %/.map.csv.last_cleanup,$(MAKECMDGOALS)),) |
285 |
%/.map.csv.last_cleanup %/unmapped_terms.csv %/new_terms.csv: %/map.csv\ |
|
286 |
$(coreMap) $(vocab) $(dict) |
|
285 |
%/.map.csv.last_cleanup: %/map.csv $(coreMap) $(vocab) $(dict) |
|
287 | 286 |
$(bin)/in_place $< $(bin)/canon 1 $(word 3,$+) |
288 | 287 |
$(bin)/in_place $< $(bin)/translate 1 $(word 4,$+) |
289 | 288 |
$(bin)/in_place $< env ignore=1 $(bin)/subtract $(word 2,$+) 0 1 2 |
290 |
$(call newTerms,1,$*/unmapped_terms.csv) |
|
291 |
$(call newTerms,0,$*/new_terms.csv) |
|
292 | 289 |
touch $@ |
290 |
+$(selfMake) $(<:%/map.csv=%/unmapped_terms.csv) |
|
291 |
+$(selfMake) $(<:%/map.csv=%/new_terms.csv) |
|
293 | 292 |
# Include comment column so commented mappings are never removed |
294 |
|
|
295 |
define newTerms |
|
296 |
$(bin)/filter_out_ci $(1) $(word 3,$+) <$<|$(bin)/cols $(1)|tail +2 >$(2) |
|
297 |
$(bin)/autoremove $(2) |
|
298 |
endef |
|
299 |
|
|
300 | 293 |
else |
301 | 294 |
%/map.csv: %/src.csv _always |
302 | 295 |
$(if $(wildcard $@),,$(if $(wildcard $<),$(CP) $< $@)) |
... | ... | |
324 | 317 |
|
325 | 318 |
##### Maps validation |
326 | 319 |
|
320 |
define newTerms |
|
321 |
$(bin)/filter_out_ci <$< $(1) $(word 2,$+)|$(bin)/cols $(1)|tail +2 >$@ |
|
322 |
$(bin)/autoremove $@ |
|
323 |
endef |
|
324 |
|
|
325 |
%/unmapped_terms.csv: %/map.csv $(vocab) |
|
326 |
$(call newTerms,1) |
|
327 |
|
|
328 |
%/new_terms.csv: %/map.csv $(vocab) |
|
329 |
$(call newTerms,0) |
|
330 |
|
|
327 | 331 |
# `env -i sort`: use system's sort, not bin/sort |
328 | 332 |
missingMappingsCmd = +$(selfMake) remake 2>&1\ |
329 | 333 |
|$(SED) -n 's/^.*No $(*2Space) mapping for (.*)$$/\1/p'|$(SED) 's/\/_.*//'\ |
Also available in: Unified diff
Extracted %/unmapped_terms.csv, %/new_terms.csv as separate targets in the Maps validation section so they can be invoked even when %/.map.csv.last_cleanup is not a top-level target (in $(MAKECMDGOALS)). Continue to invoke them in %/.map.csv.last_cleanup by using $(selfMake).