comparison lab3/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 # lab3/Makefile
2
3 ## Add your own test cases to this list
4 TEST = gcd fac0 fac gcdfun sumpow sumpow2 bug digits
5
6 all: ppc
7
8 ppc: keiko.cmo lexer.cmo dict.cmo tree.cmo \
9 parser.cmo check.cmo peepopt.cmo kgen.cmo main.cmo
10 ocamlc -g ../lib/common.cma $^ -o $@
11
12 parser.mli parser.ml: parser.mly
13 ocamlyacc parser.mly
14
15 lexer.ml: lexer.mll
16 ocamllex lexer.mll
17
18 KEIKO = ../keiko
19
20 test: force
21 $(MAKE) $(TEST:%=test-%)
22
23 test-%: force
24 @echo "*** Test $*.p"
25 ./ppc $*.p >a.k
26 $(KEIKO)/pplink -nostdlib $(KEIKO)/lib.k a.k -o a.x >/dev/null
27 -$(KEIKO)/ppx ./a.x >a.test 2>&1
28 sed -n -e '1,/^(\*<</d' -e '/^>>\*)/q' -e p $*.p | diff - a.test
29 @echo "*** Passed"; echo
30
31 realclean: clean
32
33 clean: force
34 rm -f ppc a.k a.x a.out a.test
35 rm -f parser.mli parser.ml lexer.ml *.cma *.cmo *.cmi
36
37 ML = check.ml check.mli dict.ml dict.mli keiko.ml keiko.mli kgen.ml \
38 kgen.mli lexer.ml lexer.mli main.ml parser.ml \
39 parser.mli tree.ml tree.mli peepopt.mli peepopt.ml
40
41 depend : $(ML) force
42 (sed '/^###/q' Makefile; echo; ocamldep $(ML)) >new
43 mv new Makefile
44
45 %.cmi : %.mli
46 ocamlc $(MLFLAGS) -c $<
47
48 %.cmo : %.ml
49 ocamlc $(MLFLAGS) -c $<
50
51 MLFLAGS = -I ../lib -g
52
53 force:
54
55 ###
56
57 check.cmo : tree.cmi dict.cmi check.cmi
58 check.cmx : tree.cmx dict.cmx check.cmi
59 check.cmi : tree.cmi
60 dict.cmo : dict.cmi
61 dict.cmx : dict.cmi
62 dict.cmi :
63 keiko.cmo : tree.cmi keiko.cmi
64 keiko.cmx : tree.cmx keiko.cmi
65 keiko.cmi :
66 kgen.cmo : tree.cmi peepopt.cmi keiko.cmi dict.cmi kgen.cmi
67 kgen.cmx : tree.cmx peepopt.cmx keiko.cmx dict.cmx kgen.cmi
68 kgen.cmi : tree.cmi
69 lexer.cmo : tree.cmi parser.cmi keiko.cmi lexer.cmi
70 lexer.cmx : tree.cmx parser.cmx keiko.cmx lexer.cmi
71 lexer.cmi : parser.cmi
72 main.cmo : tree.cmi parser.cmi lexer.cmi kgen.cmi check.cmi
73 main.cmx : tree.cmx parser.cmx lexer.cmx kgen.cmx check.cmx
74 parser.cmo : tree.cmi lexer.cmi keiko.cmi parser.cmi
75 parser.cmx : tree.cmx lexer.cmx keiko.cmx parser.cmi
76 parser.cmi : tree.cmi keiko.cmi
77 peepopt.cmo : keiko.cmi peepopt.cmi
78 peepopt.cmx : keiko.cmx peepopt.cmi
79 peepopt.cmi : keiko.cmi
80 tree.cmo : keiko.cmi dict.cmi tree.cmi
81 tree.cmx : keiko.cmx dict.cmx tree.cmi
82 tree.cmi : keiko.cmi dict.cmi