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 5065 aaronmk
vocab := VegCore.csv
11
dict := Veg+-VegCore.csv
12 895 aaronmk
13 785 aaronmk
##### General targets
14
15 4689 aaronmk
all: _always $(inputCoreMaps) ;
16 150 aaronmk
17 383 aaronmk
clean: _always
18 196 aaronmk
	$(RM) $(all)
19 188 aaronmk
20 924 aaronmk
all :=
21
22 785 aaronmk
##### Core maps cleanup
23 198 aaronmk
24 5045 aaronmk
# This tracks VegCore terms that are mapped to VegBIEN but not documented in
25
# VegCore.csv. This file is *not* svn:ignored, so it will show up with a ? when
26
# the user runs `svn st` if there are any unsourced terms.
27
VegCore-VegBIEN.unsourced_terms.csv: VegCore-VegBIEN.csv VegCore.csv
28
	$(bin)/filter_out_ci 0 <$+ >$@
29
	$(bin)/autoremove $@
30
31 895 aaronmk
ifneq ($(filter .%.last_cleanup,$(MAKECMDGOALS)),)
32 3967 aaronmk
33 5065 aaronmk
.VegCore.csv.last_cleanup: .%.last_cleanup: % $(dict)
34
	$(bin)/in_place $< $(bin)/translate 0 $(dict)
35 6703 aaronmk
	$(bin)/in_place $< env text=1 $(bin)/repl $(dict) 3
36 6699 aaronmk
	$(bin)/in_place $< $(bin)/sort 3 0
37 5635 aaronmk
	$(bin)/in_place $< uniq
38 4850 aaronmk
	touch $@
39 6621 aaronmk
	$(MAKE) VegCore.redmine
40 5046 aaronmk
	$(MAKE) VegCore-VegBIEN.unsourced_terms.csv
41 5253 aaronmk
.PRECIOUS: .VegCore.csv.last_cleanup
42 4850 aaronmk
43 6597 aaronmk
.Veg+-VegCore.csv.last_cleanup: .%.last_cleanup: % $(dict)
44 5067 aaronmk
	$(bin)/in_place $< $(bin)/translate 1 $(dict)
45 6830 aaronmk
	$(bin)/in_place $< $(bin)/canon 1 $(vocab)
46 6703 aaronmk
	$(bin)/in_place $< env text=1 $(bin)/repl $(dict) 2
47 6629 aaronmk
	$(bin)/in_place $< $(bin)/sort 2 0
48 4890 aaronmk
	touch $@
49 6597 aaronmk
.PRECIOUS: .Veg+-VegCore.csv.last_cleanup
50 4890 aaronmk
51 6597 aaronmk
.VegX-VegCore.csv.last_cleanup: .%.last_cleanup: % $(dict)
52
	$(bin)/in_place $< $(bin)/translate 1 $(dict)
53
	$(bin)/in_place $< $(bin)/sort_map
54
	touch $@
55
# can't canon because this would remove ? prefixes
56
.PRECIOUS: .VegX-VegCore.csv.last_cleanup
57
58 5065 aaronmk
.VegCore-VegBIEN.csv.last_cleanup: .%.last_cleanup: % $(dict) $(vocab)
59
	$(bin)/in_place $< $(bin)/translate 0 $(dict)
60
	$(bin)/in_place $< $(bin)/canon 0 $(vocab)
61 1132 aaronmk
	$(bin)/in_place $< $(bin)/sort_map
62 895 aaronmk
	touch $@
63 4692 aaronmk
	$(bin)/review 1 <$< >for_review/$<
64 5045 aaronmk
	$(MAKE) VegCore-VegBIEN.unsourced_terms.csv
65 5253 aaronmk
.PRECIOUS: .VegCore-VegBIEN.csv.last_cleanup
66 3967 aaronmk
67 895 aaronmk
else
68 1824 aaronmk
$(inputCoreMaps): _always
69 895 aaronmk
	$(MAKE) $(@:%=.%.last_cleanup)
70 5254 aaronmk
.PRECIOUS: $(inputCoreMaps)
71 895 aaronmk
endif
72 6621 aaronmk
73
# Documentation
74
75 6626 aaronmk
VegCore.redmine: VegCore.csv
76 6699 aaronmk
	$(bin)/dict2redmine 0 1 3 <$+ >$@