fa3761e53e4875b40e877bad083ae4879774942d
[tiger.ml.git] / exercises / ch01 / Makefile
1 MAKEFLAGS := --no-builtin-rules
2
3 OCAMLC_OPTIONS := -w A -warn-error A
4 OCAMLC_BYTE := ocamlc.opt $(OCAMLC_OPTIONS)
5
6 EXECUTABLES := \
7 straight_line_program_interpreter \
8 tree
9
10 .PHONY: build clean demo_unbalanced
11
12 build : $(EXECUTABLES)
13
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
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
35 clean:
36 rm -f $(EXECUTABLES) tree.dot # There's also tree.png, but I'm keeping it.
37
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
43
44 demo_unbalanced: tree.png
45 sxiv ./tree.png
This page took 0.041499 seconds and 3 git commands to generate.