-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (65 loc) · 1.86 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
EXEC = model
FIGDIR = Figures
ANIDIR = Animations
OUTPUTS = \
animation.mp4 \
animationinfo.csv \
Izhikevich.csv \
plot.pdf \
RasterPlot.pdf \
rasterplotinfo.csv \
SlugOutput2.csv
# When a target is not specified, the default executable is built
.PHONY: default
default: $(EXEC)
$(EXEC): DEFINES =
debug: DEFINES = -D debug
.PHONY: debug
$(EXEC) debug: Aplysia\ Feeding\ Kinetic\ Model.cpp
g++ $(DEFINES) -o $(EXEC) "$<"
.PHONY: clean
clean:
rm -rf $(EXEC) $(FIGDIR) $(ANIDIR) $(OUTPUTS) *~ .*~
BEHAVIORS = \
Bite \
RejectionA \
RejectionB \
SwallowA \
SwallowB \
SwallowPerturbed
CHECKBEHAVIORS = $(addprefix CHECK-, $(BEHAVIORS))
BLESSBEHAVIORS = $(addprefix BLESS-, $(BEHAVIORS))
FIGBEHAVIORS = $(addprefix $(FIGDIR)/Plot-, $(addsuffix .pdf, $(BEHAVIORS)))
ANIBEHAVIORS = $(addprefix $(ANIDIR)/Animation-, $(addsuffix .mp4, $(BEHAVIORS)))
.PHONY: check
check: $(CHECKBEHAVIORS)
.PHONY: $(CHECKBEHAVIORS)
$(CHECKBEHAVIORS): CHECK-%: $(EXEC)
@echo -n "Checking $*...\t"
@./$< $* # run the model for this behavior
@echo `diff --strip-trailing-cr SlugOutput2.csv Check/Output-$*.csv | wc -l` "deviations"
.PHONY: bless
bless: $(BLESSBEHAVIORS)
.PHONY: $(BLESSBEHAVIORS)
$(BLESSBEHAVIORS): BLESS-%: $(EXEC)
@echo -n "Blessing $*...\t"
@./$< $* # run the model for this behavior
@mv SlugOutput2.csv Check/Output-$*.csv
@echo "done"
.PHONY: figures
figures: $(FIGBEHAVIORS)
$(FIGBEHAVIORS): $(FIGDIR)/Plot-%.pdf: $(EXEC) PlotVariablesSlugOutput.py
@echo -n "Plotting $*...\t"
@./$< $* # run the model for this behavior
@python PlotVariablesSlugOutput.py
@mkdir -p $(FIGDIR)
@mv plot.pdf $@
@echo "done"
.PHONY: animations
animations: $(ANIBEHAVIORS)
$(ANIBEHAVIORS): $(ANIDIR)/Animation-%.mp4: $(EXEC) newanimation.py
@echo "Animating $*...\t"
@./$< $* # run the model for this behavior
@python newanimation.py
@mkdir -p $(ANIDIR)
@mv animation.mp4 $@