Make a basic Makefile for a small OCaml program
[tiger.ml.git] / exercises / ch01 / Makefile
diff --git a/exercises/ch01/Makefile b/exercises/ch01/Makefile
new file mode 100644 (file)
index 0000000..65c4991
--- /dev/null
@@ -0,0 +1,20 @@
+MAKEFLAGS := --no-builtin-rules
+
+OCAMLC_OPTIONS := -w A -warn-error A
+OCAMLC_BYTE    := ocamlc.opt   $(OCAMLC_OPTIONS)
+
+.PHONY: build clean
+
+build : straight_line_program_interpreter
+
+%: %.ml %.cmo %.cmi
+       $(OCAMLC_BYTE) -o $@ $*.cmo
+
+%.cmi: %.mli
+       $(OCAMLC_BYTE) -o $@ -c $<
+
+%.cmo: %.ml %.cmi
+       $(OCAMLC_BYTE) -c $<
+
+clean:
+       rm -f straight_line_program_interpreter
This page took 0.018909 seconds and 4 git commands to generate.