Project

General

Profile

1 3793 aaronmk
include ../lib/common.Makefile
2
3
4 785 aaronmk
##### Vars/functions
5
6 1272 aaronmk
# Paths
7 895 aaronmk
bin := ../bin
8 4889 aaronmk
inputCoreMaps := VegCore.csv Veg+-VegCore.csv VegCore-VegBIEN.csv \
9
VegX-VegCore.csv
10 895 aaronmk
11 785 aaronmk
##### General targets
12
13 4689 aaronmk
all: _always $(inputCoreMaps) ;
14 150 aaronmk
15 383 aaronmk
clean: _always
16 196 aaronmk
	$(RM) $(all)
17 188 aaronmk
18 924 aaronmk
all :=
19
20 785 aaronmk
##### Core maps cleanup
21 198 aaronmk
22 895 aaronmk
ifneq ($(filter .%.last_cleanup,$(MAKECMDGOALS)),)
23 3967 aaronmk
24 4850 aaronmk
.VegCore.csv.last_cleanup: .%.last_cleanup: %
25
	$(bin)/in_place $< $(bin)/sort 2 0
26
	touch $@
27
28 4891 aaronmk
.Veg+-VegCore.csv.last_cleanup .VegX-VegCore.csv.last_cleanup: \
29
.%.last_cleanup: %
30 4890 aaronmk
	$(bin)/in_place $< $(bin)/sort_map
31
	touch $@
32
33 4893 aaronmk
# This tracks VegCore terms that are mapped to VegBIEN but not documented in
34
# VegCore.csv. This file is *not* svn:ignored, so it will show up with a ? when
35
# the user runs `svn st` if there are any unsourced terms.
36
unsourcedTerms := VegCore-VegBIEN.unsourced_terms.csv
37
38 4892 aaronmk
.VegCore-VegBIEN.csv.last_cleanup: .%.last_cleanup: %
39 1132 aaronmk
	$(bin)/in_place $< $(bin)/sort_map
40 895 aaronmk
	touch $@
41 4692 aaronmk
	$(bin)/review 1 <$< >for_review/$<
42 4893 aaronmk
	$(bin)/filter_out_ci <$< 0 VegCore.csv >$(unsourcedTerms)
43
	$(bin)/autoremove $(unsourcedTerms)
44 3967 aaronmk
45 895 aaronmk
else
46 1824 aaronmk
$(inputCoreMaps): _always
47 895 aaronmk
	$(MAKE) $(@:%=.%.last_cleanup)
48
endif