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