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 5045 aaronmk
# 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 895 aaronmk
ifneq ($(filter .%.last_cleanup,$(MAKECMDGOALS)),)
30 3967 aaronmk
31 4850 aaronmk
.VegCore.csv.last_cleanup: .%.last_cleanup: %
32
	$(bin)/in_place $< $(bin)/sort 2 0
33
	touch $@
34
35 4891 aaronmk
.Veg+-VegCore.csv.last_cleanup .VegX-VegCore.csv.last_cleanup: \
36
.%.last_cleanup: %
37 4890 aaronmk
	$(bin)/in_place $< $(bin)/sort_map
38
	touch $@
39
40 4892 aaronmk
.VegCore-VegBIEN.csv.last_cleanup: .%.last_cleanup: %
41 1132 aaronmk
	$(bin)/in_place $< $(bin)/sort_map
42 895 aaronmk
	touch $@
43 4692 aaronmk
	$(bin)/review 1 <$< >for_review/$<
44 5045 aaronmk
	$(MAKE) VegCore-VegBIEN.unsourced_terms.csv
45 3967 aaronmk
46 895 aaronmk
else
47 1824 aaronmk
$(inputCoreMaps): _always
48 895 aaronmk
	$(MAKE) $(@:%=.%.last_cleanup)
49
endif