include ../lib/common.Makefile ##### Vars/functions # Make SHELL := /bin/bash # Paths bin := ../bin inputCoreMaps := VegCore-VegBIEN.csv VegX-VegCore.csv vocab := VegCore.vocab.csv thesaurus := VegCore.thesaurus.csv ##### General targets all: _always $(vocab) $(thesaurus) VegCore.tables.redmine $(inputCoreMaps) ; clean: _always $(RM) $(all) all := ##### Core maps VegCore.htm: php -r 'fpassthru(fopen("https://projects.nceas.ucsb.edu/nceas/projects/bien/wiki/VegCore", "r"));' >$@ $(vocab): VegCore.htm (echo VegCore; $(sed) -n 's/^]*>(]*>)? *$@ $(thesaurus): VegCore.htm (echo "Veg+,VegCore"; $(bin)/redmine_synonyms|grep -vE '^\??[A-Z][a-z]';\ true) <$< >$@ # true: ignore errors if grep found no match # Canonicalize alternatives of ambiguous terms using unambiguous mappings $(bin)/in_place $@ $(bin)/translate 1 <(grep -vE '^\?' $(thesaurus)) $(bin)/in_place $@ $(bin)/collapse_multimap # Replace ambiguous terms with alternatives lists $(bin)/in_place $@ $(bin)/translate 1 $(thesaurus) $(bin)/in_place $@ $(bin)/sort 0 1 VegCore.tables.csv: VegCore.htm <$< $(sed) -n 's/^.*