Project

General

Profile

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