-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (41 loc) · 1.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# housekeeping
.PHONY: all archive clean documentation
.SUFFIXES:
.SECONDARY:
# variables
DATA=$(HOME)/root/data/seqspace
MODELS=
NORMED=
DIRECTORIES=\
drosophila
# commands
JULIA = julia --project=.
NORMALIZE = @echo ">generating $(@:$(DATA)/%=%)";\
$(JULIA) bin/normalize.jl
FITMODEL = @echo ">generating $(@:$(DATA)/%=%)";\
$(JULIA) bin/fitmodel.jl
# recipe template
define RULE
$(DATA)/$(DIR)/model/norms.jld2: param/$(DIR)/normalize.jl $(shell find $(DATA)/$(DIR)/raw -type f)
$$(NORMALIZE) -o $$@ -p $$< $(DATA)/$(DIR)/raw
$(DATA)/$(DIR)/model/model.jld2: param/$(DIR)/model.jl $(DATA)/$(DIR)/model/norms.jld2
$$(FITMODEL) -o $$@ -p $$^
MODELS+=$(DATA)/$(DIR)/model/model.jld2
NORMED+=$(DATA)/$(DIR)/model/norms.jld2
endef
all: models
# generate individual data rules
data.mk: Makefile
$(file > $@,) $(foreach DIR,$(DIRECTORIES),$(file >> $@,$(RULE)) )
-include data.mk
normed: $(NORMED)
models: $(MODELS)
archive:
@echo ">archiving current models";\
$(JULIA) bin/archive.jl $(DATA) $(DIRECTORIES)
documentation:
cd docs && $(JULIA). make.jl
# TODO: clean up figures
clean:
@echo ">removing models";\
rm -f $(NORMED) $(MODELS)