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 := \ |
f76c63f8 SK |
7 | straight_line_program_interpreter \ |
8 | tree | |
e6273b7a | 9 | |
b743073d SK |
10 | .PHONY: build clean demo_unbalanced |
11 | ||
12 | build : $(EXECUTABLES) | |
13 | ||
e6273b7a SK |
14 | %: %.ml %.cmo %.cmi |
15 | $(OCAMLC_BYTE) -o $@ $*.cmo | |
16 | ||
17 | %.cmi: %.mli | |
18 | $(OCAMLC_BYTE) -o $@ -c $< | |
19 | ||
20 | %.cmo: %.ml %.cmi | |
21 | $(OCAMLC_BYTE) -c $< | |
22 | ||
88cc262a SK |
23 | tree : tree.ml tree.cmo tree_sig.cmo tree_unbalanced_vanilla.cmo tree_balanced_red_black.cmo |
24 | $(OCAMLC_BYTE) -o tree tree_sig.cmo tree_unbalanced_vanilla.cmo tree_balanced_red_black.cmo tree.cmo | |
25 | ||
26 | tree.cmo : tree.ml tree.cmi tree_sig.cmo tree_unbalanced_vanilla.cmo tree_balanced_red_black.cmo | |
27 | $(OCAMLC_BYTE) -c $< | |
28 | ||
29 | tree_balanced_red_black.cmo : tree_balanced_red_black.ml tree_balanced_red_black.cmi tree_sig.cmo | |
30 | ocamlc.opt -w A -warn-error A-4 -c $< | |
31 | ||
32 | tree_sig.cmo tree_sig.cmi: tree_sig.ml | |
33 | $(OCAMLC_BYTE) -c $< | |
34 | ||
e6273b7a | 35 | clean: |
06d3ef4a | 36 | rm -f $(EXECUTABLES) tree.dot # There's also tree.png, but I'm keeping it. |
564eb9f3 | 37 | |
06d3ef4a SK |
38 | tree.dot: tree |
39 | ./tree 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 lkhjlk gfjyfjf fdtrdchfhtr trhfgfch hjlilijhl iygkyugkgkhy > tree.dot | |
40 | ||
41 | tree.png: tree.dot | |
42 | neato -T png tree.dot > tree.png | |
564eb9f3 SK |
43 | |
44 | demo_unbalanced: tree.png | |
45 | sxiv ./tree.png |