Project

General

Profile

1
include ../lib/common.Makefile
2

    
3

    
4
##### Vars/functions
5

    
6
# Paths
7
bin := ../bin
8
inputCoreMaps := VegCore.csv Veg+-VegCore.csv VegCore-VegBIEN.csv \
9
VegX-VegCore.csv
10

    
11
##### General targets
12

    
13
all: _always $(inputCoreMaps) ;
14

    
15
clean: _always
16
	$(RM) $(all)
17

    
18
all :=
19

    
20
##### Core maps cleanup
21

    
22
# This tracks VegCore terms that are mapped to VegBIEN but not documented in
23
# VegCore.csv. This file is *not* svn:ignored, so it will show up with a ? when
24
# the user runs `svn st` if there are any unsourced terms.
25
VegCore-VegBIEN.unsourced_terms.csv: VegCore-VegBIEN.csv VegCore.csv
26
	$(bin)/filter_out_ci 0 <$+ >$@
27
	$(bin)/autoremove $@
28

    
29
ifneq ($(filter .%.last_cleanup,$(MAKECMDGOALS)),)
30

    
31
.VegCore.csv.last_cleanup: .%.last_cleanup: %
32
	$(bin)/in_place $< $(bin)/sort 2 0
33
	touch $@
34
	$(MAKE) VegCore-VegBIEN.unsourced_terms.csv
35

    
36
.Veg+-VegCore.csv.last_cleanup .VegX-VegCore.csv.last_cleanup: \
37
.%.last_cleanup: %
38
	$(bin)/in_place $< $(bin)/sort_map
39
	touch $@
40

    
41
.VegCore-VegBIEN.csv.last_cleanup: .%.last_cleanup: %
42
	$(bin)/in_place $< $(bin)/sort_map
43
	touch $@
44
	$(bin)/review 1 <$< >for_review/$<
45
	$(MAKE) VegCore-VegBIEN.unsourced_terms.csv
46

    
47
else
48
$(inputCoreMaps): _always
49
	$(MAKE) $(@:%=.%.last_cleanup)
50
endif
(5-5/13)