1
|
coreMaps := DwC-VegBIEN.specimens.csv VegX-VegBIEN.organisms.csv
|
2
|
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
|
./join VegX VegBIEN
|
9
|
./review
|
10
|
|
11
|
.SUFFIXES:
|
12
|
|
13
|
_always:
|
14
|
.PHONY: _always
|
15
|
|
16
|
clean: _always
|
17
|
$(RM) $(all)
|
18
|
|
19
|
remake: _always clean all ;
|
20
|
|
21
|
#####
|
22
|
|
23
|
bin := ../bin
|
24
|
|
25
|
$(coreMaps): %: .%.last_cleanup
|
26
|
$(bin)/in_place $@ $(bin)/simplify_xpath
|
27
|
$(bin)/in_place $@ $(bin)/sort 1 0
|
28
|
touch -r $@ $<
|
29
|
.PRECIOUS: .%.last_cleanup
|
30
|
# Ignore last_cleanup file if it doesn't exist
|
31
|
.%.last_cleanup:
|
32
|
|
33
|
#####
|
34
|
|
35
|
chRoot = $(bin)/ch_root <$< >$@
|
36
|
|
37
|
VegX-VegBIEN.plots.csv: VegX-VegBIEN.organisms.csv
|
38
|
env \
|
39
|
left_in_root='/*s/individualOrganismObservation/*ID->/*s/plotObservation' \
|
40
|
left_out_root='/*s/plotObservation' \
|
41
|
right_in_root='/taxonoccurrence/*_id/locationevent' \
|
42
|
right_out_root='/locationevent' \
|
43
|
$(chRoot)
|
44
|
|
45
|
VegX-VegBIEN.stems.csv: VegX-VegBIEN.organisms.csv
|
46
|
env \
|
47
|
left_in_root='/*s/individualOrganismObservation->/*s/individualOrganismObservation[relatedItem[relationshipType=stemParent]/relatedItemID]' \
|
48
|
left_out_root='/*s/individualOrganismObservation[relatedItem[relationshipType=stemParent]/relatedItemID]' \
|
49
|
right_in_root='/taxonoccurrence/aggregateoccurrence/*_id/plantobservation/stemobservation' \
|
50
|
right_out_root='/stemobservation' \
|
51
|
$(chRoot)
|