1
|
misc = schemas/vegbien.sql schemas/vegbien_empty.sql VegX-VegBIEN.organisms.csv
|
2
|
|
3
|
all: FORCE $(misc)
|
4
|
$(MAKE) plots
|
5
|
./join VegX VegBank
|
6
|
./join VegX VegBIEN
|
7
|
./review
|
8
|
.PRECIOUS: $(misc)
|
9
|
|
10
|
.SUFFIXES:
|
11
|
|
12
|
FORCE:
|
13
|
.PHONY: FORCE
|
14
|
|
15
|
all =\
|
16
|
$(wildcard for_review/*.csv) \
|
17
|
$(filter-out VegX-% VegBank-%,$(wildcard *-VegBank.*.csv)) \
|
18
|
VegX-*.plots.csv $(misc)
|
19
|
|
20
|
clean: FORCE
|
21
|
$(RM) $(all)
|
22
|
|
23
|
repl = ../scripts/util/repl
|
24
|
sort = ../scripts/util/sort 1 0
|
25
|
chRoot = ../scripts/util/ch_root <$< >$@
|
26
|
empty = sed -nE 's/^CREATE TABLE ([0-9A-Za-z_]+) \($$/TRUNCATE \1 CASCADE;/p' \
|
27
|
<$< >$@
|
28
|
|
29
|
|
30
|
schemas/vegbien.sql: schemas/vegbank.sql
|
31
|
$(repl) <$< VegBank-VegBIEN.schema.csv|$(repl) VegBank-VegBIEN.csv >$@
|
32
|
|
33
|
schemas/vegbien_empty.sql: schemas/vegbien.sql
|
34
|
$(empty)
|
35
|
|
36
|
VegX-VegBIEN.organisms.csv: VegX-VegBank.organisms.csv
|
37
|
$(repl) <$< VegBank-VegBIEN.csv 1|$(sort) >$@
|
38
|
|
39
|
|
40
|
plots: FORCE $(subst .organisms.,.plots.,$(wildcard VegX-*.organisms.csv))
|
41
|
|
42
|
chRoot2PlotsLeftVegx =\
|
43
|
env \
|
44
|
left_in_root='/*s/individualOrganismObservation/*ID->/*s/plotObservation' \
|
45
|
left_out_root='/*s/plotObservation' \
|
46
|
$(chRoot)
|
47
|
|
48
|
VegX-VegBank.plots.csv: VegX-VegBank.organisms.csv
|
49
|
$(chRoot2PlotsVegxVegbank)
|
50
|
chRoot2PlotsVegxVegbank =\
|
51
|
env \
|
52
|
right_in_root='/taxonObservation/*_ID/observation' \
|
53
|
right_out_root='/observation' \
|
54
|
$(chRoot2PlotsLeftVegx)
|
55
|
|
56
|
VegX-VegBIEN.plots.csv: VegX-VegBIEN.organisms.csv
|
57
|
$(chRoot2PlotsVegxVegbien)
|
58
|
chRoot2PlotsVegxVegbien =\
|
59
|
env \
|
60
|
right_in_root='/taxonoccurrence/*_ID/plotevent' \
|
61
|
right_out_root='/plotevent' \
|
62
|
$(chRoot2PlotsLeftVegx)
|