comparison lab2/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 # lab2/Makefile
2
3 ## Add your own test cases to this list
4 TEST = gcd array pascal binary
5
6 all: ppc
7
8 ppc: keiko.cmo lexer.cmo dict.cmo tree.cmo parser.cmo check.cmo \
9 peepopt.cmo kgen.cmo main.cmo
10 ocamlc ../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 ppx ppxj *.cma *.cmo *.cmi *.o
35 rm -f parser.mli parser.ml lexer.ml
36 rm -f a.k a.out a.x a.test
37
38 ML = check.ml check.mli dict.ml dict.mli keiko.ml keiko.mli kgen.ml \
39 kgen.mli lexer.ml lexer.mli main.ml parser.ml \
40 parser.mli tree.ml tree.mli peepopt.mli peepopt.ml
41
42 depend : $(ML) force
43 (sed '/^###/q' Makefile; echo; ocamldep $(ML)) >new
44 mv new Makefile
45
46 %.cmi : %.mli
47 ocamlc $(MLFLAGS) -c $<
48
49 %.cmo : %.ml
50 ocamlc $(MLFLAGS) -c $<
51
52 force:
53
54 MLFLAGS = -I ../lib
55
56 ###
57
58 check.cmo : tree.cmi keiko.cmi dict.cmi check.cmi
59 check.cmx : tree.cmx keiko.cmx dict.cmx check.cmi
60 check.cmi : tree.cmi
61 dict.cmo : dict.cmi
62 dict.cmx : dict.cmi
63 dict.cmi :
64 keiko.cmo : tree.cmi keiko.cmi
65 keiko.cmx : tree.cmx keiko.cmi
66 keiko.cmi :
67 kgen.cmo : tree.cmi peepopt.cmi keiko.cmi dict.cmi kgen.cmi
68 kgen.cmx : tree.cmx peepopt.cmx keiko.cmx dict.cmx kgen.cmi
69 kgen.cmi : tree.cmi
70 lexer.cmo : tree.cmi parser.cmi keiko.cmi lexer.cmi
71 lexer.cmx : tree.cmx parser.cmx keiko.cmx lexer.cmi
72 lexer.cmi : parser.cmi
73 main.cmo : tree.cmi parser.cmi lexer.cmi kgen.cmi dict.cmi check.cmi
74 main.cmx : tree.cmx parser.cmx lexer.cmx kgen.cmx dict.cmx check.cmx
75 parser.cmo : tree.cmi lexer.cmi keiko.cmi dict.cmi parser.cmi
76 parser.cmx : tree.cmx lexer.cmx keiko.cmx dict.cmx parser.cmi
77 parser.cmi : tree.cmi keiko.cmi dict.cmi
78 peepopt.cmo : keiko.cmi peepopt.cmi
79 peepopt.cmx : keiko.cmx peepopt.cmi
80 peepopt.cmi : keiko.cmi
81 tree.cmo : keiko.cmi dict.cmi tree.cmi
82 tree.cmx : keiko.cmx dict.cmx tree.cmi
83 tree.cmi : keiko.cmi dict.cmi