Project

General

Profile

1 785 aaronmk
##### Vars/functions
2
3 748 aaronmk
coreMaps := DwC-VegBIEN.specimens.csv VegX-VegBIEN.organisms.csv
4 744 aaronmk
chRootMaps := VegX-VegBIEN.plots.csv VegX-VegBIEN.stems.csv
5 882 aaronmk
all := $(wildcard for_review/*) $(chRootMaps)
6 744 aaronmk
7 785 aaronmk
##### General targets
8
9 744 aaronmk
all: _always $(coreMaps) $(chRootMaps)
10 199 aaronmk
	./review
11 150 aaronmk
12 223 aaronmk
.SUFFIXES:
13
14 383 aaronmk
_always:
15
.PHONY: _always
16 188 aaronmk
17 383 aaronmk
clean: _always
18 196 aaronmk
	$(RM) $(all)
19 188 aaronmk
20 423 aaronmk
remake: _always clean all ;
21
22 785 aaronmk
##### Core maps cleanup
23 198 aaronmk
24 744 aaronmk
bin := ../bin
25 240 aaronmk
26 779 aaronmk
$(coreMaps): %: .%.last_cleanup
27 612 aaronmk
	$(bin)/in_place $@ $(bin)/simplify_xpath
28 438 aaronmk
	$(bin)/in_place $@ $(bin)/sort 1 0
29 779 aaronmk
	touch -r $@ $<
30
.PRECIOUS: .%.last_cleanup
31
# Ignore last_cleanup file if it doesn't exist
32
.%.last_cleanup:
33 350 aaronmk
34 785 aaronmk
##### Maps generated with ch_root
35 212 aaronmk
36 744 aaronmk
chRoot = $(bin)/ch_root <$< >$@
37 197 aaronmk
38 438 aaronmk
VegX-VegBIEN.plots.csv: VegX-VegBIEN.organisms.csv
39 188 aaronmk
	env \
40 439 aaronmk
left_in_root='/*s/individualOrganismObservation/*ID->/*s/plotObservation' \
41
left_out_root='/*s/plotObservation' \
42 525 aaronmk
right_in_root='/taxonoccurrence/*_id/locationevent' \
43
right_out_root='/locationevent' \
44 439 aaronmk
$(chRoot)
45
46
VegX-VegBIEN.stems.csv: VegX-VegBIEN.organisms.csv
47
	env \
48 441 aaronmk
left_in_root='/*s/individualOrganismObservation->/*s/individualOrganismObservation[relatedItem[relationshipType=stemParent]/relatedItemID]' \
49 504 aaronmk
left_out_root='/*s/individualOrganismObservation[relatedItem[relationshipType=stemParent]/relatedItemID]' \
50 681 aaronmk
right_in_root='/taxonoccurrence/aggregateoccurrence/*_id/plantobservation/stemobservation' \
51 673 aaronmk
right_out_root='/stemobservation' \
52 439 aaronmk
$(chRoot)