Commit | Line | Data |
---|---|---|
e6273b7a SK |
1 | MAKEFLAGS := --no-builtin-rules |
2 | ||
3 | OCAMLC_OPTIONS := -w A -warn-error A | |
4 | OCAMLC_BYTE := ocamlc.opt $(OCAMLC_OPTIONS) | |
5 | ||
b743073d | 6 | EXECUTABLES := \ |
958f7268 SK |
7 | straight_line_program_interpreter \ |
8 | tree_demo | |
9 | EXECUTABLES := $(addsuffix .byte,$(EXECUTABLES)) | |
e6273b7a | 10 | |
958f7268 SK |
11 | SET_MEMBERS := \ |
12 | a b c d e f g h i j k l m n o p q r s t u v foo bar kgkvbkvg \ | |
13 | lkhjlk gfjyfjf fdtrdchfhtr trhfgfch hjlilijhl iygkyugkgkhy | |
b743073d | 14 | |
b743073d | 15 | |
958f7268 SK |
16 | .PHONY: \ |
17 | all \ | |
18 | clean \ | |
19 | build \ | |
20 | demos | |
e6273b7a | 21 | |
958f7268 SK |
22 | all: |
23 | $(MAKE) clean | |
24 | $(MAKE) build | |
25 | $(MAKE) demos | |
e6273b7a | 26 | |
958f7268 SK |
27 | clean: |
28 | rm -rf ./_build/ | |
29 | rm -f $(EXECUTABLES) | |
30 | # There're also tree demo PNGs, but I want to keep them around, for | |
31 | # referencing without having to build the project. | |
88cc262a | 32 | |
958f7268 SK |
33 | build: |
34 | ocamlbuild $(EXECUTABLES) | |
88cc262a | 35 | |
958f7268 SK |
36 | demos: \ |
37 | run_straight_line_program_interpreter \ | |
38 | tree_demo_unbalanced.png \ | |
39 | tree_demo_balanced.png | |
88cc262a | 40 | |
958f7268 SK |
41 | run_straight_line_program_interpreter: straight_line_program_interpreter.byte |
42 | ./$< | |
88cc262a | 43 | |
958f7268 SK |
44 | tree_demo_unbalanced.dot: tree_demo.byte |
45 | ./$< unbalanced $(SET_MEMBERS) > $@ | |
564eb9f3 | 46 | |
958f7268 SK |
47 | tree_demo_unbalanced.png: tree_demo_unbalanced.dot |
48 | neato -T png $< > $@ | |
06d3ef4a | 49 | |
958f7268 SK |
50 | tree_demo_balanced.dot: tree_demo.byte |
51 | ./$< balanced $(SET_MEMBERS) > $@ | |
564eb9f3 | 52 | |
958f7268 SK |
53 | tree_demo_balanced.png: tree_demo_balanced.dot |
54 | neato -T png $< > $@ |