1 |
235
|
aaronmk
|
os = $(shell uname)
|
2 |
224
|
aaronmk
|
|
3 |
235
|
aaronmk
|
SED = sed -$(if $(filter Darwin,$(os)),E,r)
|
4 |
|
|
|
5 |
240
|
aaronmk
|
#####
|
6 |
224
|
aaronmk
|
|
7 |
383
|
aaronmk
|
all: _always misc
|
8 |
197
|
aaronmk
|
$(MAKE) plots
|
9 |
198
|
aaronmk
|
./join VegX VegBIEN
|
10 |
199
|
aaronmk
|
./review
|
11 |
150
|
aaronmk
|
|
12 |
223
|
aaronmk
|
.SUFFIXES:
|
13 |
|
|
|
14 |
383
|
aaronmk
|
_always:
|
15 |
|
|
.PHONY: _always
|
16 |
188
|
aaronmk
|
|
17 |
382
|
aaronmk
|
misc := schemas/vegbien.sql schemas/vegbien_empty.sql
|
18 |
240
|
aaronmk
|
|
19 |
382
|
aaronmk
|
all = $(wildcard for_review/*.csv) \
|
20 |
|
|
$(filter-out VegX-%,$(wildcard *-VegBIEN.*.csv)) VegX-*.plots.csv $(misc)
|
21 |
196
|
aaronmk
|
|
22 |
383
|
aaronmk
|
clean: _always
|
23 |
196
|
aaronmk
|
$(RM) $(all)
|
24 |
188
|
aaronmk
|
|
25 |
380
|
aaronmk
|
%:: %.make
|
26 |
|
|
./$< >$@
|
27 |
|
|
.PRECIOUS: %
|
28 |
|
|
|
29 |
240
|
aaronmk
|
#####
|
30 |
198
|
aaronmk
|
|
31 |
240
|
aaronmk
|
misc: $(misc)
|
32 |
|
|
.PRECIOUS: $(misc)
|
33 |
|
|
|
34 |
350
|
aaronmk
|
bin = ../bin
|
35 |
|
|
repl = $(bin)/repl
|
36 |
|
|
sort = $(bin)/sort 1 0
|
37 |
|
|
chRoot = $(bin)/ch_root <$< >$@
|
38 |
240
|
aaronmk
|
empty = $(SED) -n \
|
39 |
|
|
's/^CREATE TABLE ([0-9A-Za-z_]+) \($$/TRUNCATE \1 CASCADE;/p' <$< >$@
|
40 |
|
|
|
41 |
223
|
aaronmk
|
schemas/vegbien_empty.sql: schemas/vegbien.sql
|
42 |
|
|
$(empty)
|
43 |
|
|
|
44 |
383
|
aaronmk
|
VegX-VegBIEN.organisms.csv: _always
|
45 |
359
|
aaronmk
|
$(bin)/in_place $@ $(sort)
|
46 |
350
|
aaronmk
|
|
47 |
240
|
aaronmk
|
#####
|
48 |
212
|
aaronmk
|
|
49 |
383
|
aaronmk
|
plots: _always $(subst .organisms.,.plots.,$(wildcard VegX-*.organisms.csv))
|
50 |
197
|
aaronmk
|
|
51 |
188
|
aaronmk
|
chRoot2PlotsLeftVegx =\
|
52 |
|
|
env \
|
53 |
|
|
left_in_root='/*s/individualOrganismObservation/*ID->/*s/plotObservation' \
|
54 |
|
|
left_out_root='/*s/plotObservation' \
|
55 |
|
|
$(chRoot)
|
56 |
|
|
|
57 |
|
|
VegX-VegBIEN.plots.csv: VegX-VegBIEN.organisms.csv
|
58 |
|
|
$(chRoot2PlotsVegxVegbien)
|
59 |
|
|
chRoot2PlotsVegxVegbien =\
|
60 |
|
|
env \
|
61 |
200
|
aaronmk
|
right_in_root='/taxonoccurrence/*_ID/plotevent' \
|
62 |
188
|
aaronmk
|
right_out_root='/plotevent' \
|
63 |
|
|
$(chRoot2PlotsLeftVegx)
|