comparison lab1/Makefile @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 # lab1/Makefile
2
3 ## Add your own test cases to this list
4 TEST = gcd repeat loop case
5
6 all: ppc
7
8 ppc: keiko.cmo lexer.cmo tree.cmo parser.cmo peepopt.cmo kgen.cmo main.cmo
9 ocamlc ../lib/common.cma $^ -o $@
10
11 parser.mli parser.ml: parser.mly
12 ocamlyacc -v parser.mly
13
14 lexer.ml: lexer.mll
15 ocamllex lexer.mll
16
17 tree.cmo: MLFLAGS += -w u
18
19 KEIKO = ../keiko
20
21 test : force
22 $(MAKE) $(TEST:%=test-%)
23
24 test-%: force
25 @echo "*** Test $*.p"
26 ./ppc $*.p >a.k
27 $(KEIKO)/pplink -nostdlib $(KEIKO)/lib.k a.k -o a.x >/dev/null
28 $(KEIKO)/ppx ./a.x >a.test
29 sed -n -e '1,/^(\*<</d' -e '/^>>\*)/q' -e p $*.p | diff - a.test
30 @echo "*** Passed"; echo
31
32 realclean: clean
33
34 clean: force
35 rm -f ppc *.cma *.cmo *.cmi
36 rm -f parser.mli parser.ml lexer.ml parser.output
37 rm -f a.k a.out a.x a.test
38
39 ML = keiko.ml keiko.mli kgen.ml kgen.mli lexer.mli \
40 lexer.ml main.ml parser.mli parser.ml tree.ml tree.mli \
41 peepopt.mli peepopt.ml
42
43 depend : $(ML) force
44 (sed '/^###/q' Makefile; echo; ocamldep $(ML)) >new
45 mv new Makefile
46
47 %.cmi : %.mli
48 ocamlc $(MLFLAGS) -c $<
49
50 %.cmo : %.ml
51 ocamlc $(MLFLAGS) -c $<
52
53 force:
54
55 MLFLAGS = -I ../lib
56
57 ###
58
59 keiko.cmo : tree.cmi keiko.cmi
60 keiko.cmx : tree.cmx keiko.cmi
61 keiko.cmi :
62 kgen.cmo : tree.cmi peepopt.cmi keiko.cmi kgen.cmi
63 kgen.cmx : tree.cmx peepopt.cmx keiko.cmx kgen.cmi
64 kgen.cmi : tree.cmi
65 lexer.cmo : tree.cmi parser.cmi keiko.cmi lexer.cmi
66 lexer.cmx : tree.cmx parser.cmx keiko.cmx lexer.cmi
67 lexer.cmi : tree.cmi parser.cmi
68 main.cmo : tree.cmi parser.cmi lexer.cmi kgen.cmi
69 main.cmx : tree.cmx parser.cmx lexer.cmx kgen.cmx
70 parser.cmo : tree.cmi lexer.cmi keiko.cmi parser.cmi
71 parser.cmx : tree.cmx lexer.cmx keiko.cmx parser.cmi
72 parser.cmi : tree.cmi keiko.cmi
73 peepopt.cmo : keiko.cmi peepopt.cmi
74 peepopt.cmx : keiko.cmx peepopt.cmi
75 peepopt.cmi : keiko.cmi
76 tree.cmo : keiko.cmi tree.cmi
77 tree.cmx : keiko.cmx tree.cmi
78 tree.cmi : keiko.cmi