comparison ppc/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 # ppc/Makefile
2
3 all: ppc
4
5 PPC = util.cmo mach.cmo keiko.cmo dict.cmo tree.cmo \
6 lexer.cmo parser.cmo check.cmo peepopt.cmo kgen.cmo main.cmo
7
8 ppc: $(PPC)
9 ocamlc -g ../lib/common.cma $^ -o $@
10
11 parser.ml parser.mli: parser.mly
12 ocamlyacc -v parser.mly
13
14 lexer.ml: lexer.mll
15 ocamllex lexer.mll
16
17 %.cmi: %.mli
18 ocamlc -c -g -I ../lib $<
19
20 %.cmo: %.ml
21 ocamlc -c -g -I ../lib $<
22
23 KEIKO = ../keiko
24 TESTSRC := $(wildcard test/*.p)
25
26 test : $(TESTSRC:test/%.p=test-%)
27
28 test-%: force
29 @echo "*** Test $*.p"
30 ./ppc -O test/$*.p >a.k
31 -sed -n -e '1,/^(\*\[\[/d' -e '/^]]\*)/q' -e p test/$*.p | diff -b - a.k
32 $(KEIKO)/pplink -nostdlib $(KEIKO)/lib.k a.k -o a.x >/dev/null
33 -$(KEIKO)/ppx ./a.x >a.test 2>&1
34 sed -n -e '1,/^(\*<</d' -e '/^>>\*)/q' -e p test/$*.p | diff - a.test
35 @echo "*** Passed"; echo
36
37 promote: $(TESTSRC:test/%.p=promote-%)
38
39 promote-%: force
40 ./ppc -O test/$*.p >a.k
41 $(KEIKO)/pplink -nostdlib $(KEIKO)/lib.k a.k -o a.x >/dev/null
42 -$(KEIKO)/ppx ./a.x >a.test 2>&1
43 sed -f promote.sed test/$*.p >test/$*.new
44 mv test/$*.new test/$*.p
45
46 force:
47
48 MLGEN = parser.mli parser.ml lexer.ml
49
50 ML = $(MLGEN) check.ml check.mli dict.ml dict.mli \
51 lexer.mli mach.ml mach.mli main.ml keiko.mli keiko.ml \
52 kgen.mli kgen.ml tree.ml tree.mli util.ml peepopt.mli peepopt.ml
53
54 realclean: clean
55
56 clean: force
57 rm -f *.cmi *.cmo *.output
58 rm -f $(MLGEN)
59 rm -f ppc ppx a.out a.k a.x a.test
60
61 depend: $(ML) force
62 (sed '/^###/q' Makefile; echo; ocamldep $(ML)) >new
63 mv new Makefile
64
65 ###
66
67 parser.cmi : tree.cmi keiko.cmi dict.cmi
68 parser.cmo : tree.cmi lexer.cmi keiko.cmi dict.cmi parser.cmi
69 parser.cmx : tree.cmx lexer.cmx keiko.cmx dict.cmx parser.cmi
70 lexer.cmo : util.cmo parser.cmi keiko.cmi dict.cmi lexer.cmi
71 lexer.cmx : util.cmx parser.cmx keiko.cmx dict.cmx lexer.cmi
72 check.cmo : tree.cmi mach.cmi lexer.cmi keiko.cmi dict.cmi check.cmi
73 check.cmx : tree.cmx mach.cmx lexer.cmx keiko.cmx dict.cmx check.cmi
74 check.cmi : tree.cmi
75 dict.cmo : mach.cmi keiko.cmi dict.cmi
76 dict.cmx : mach.cmx keiko.cmx dict.cmi
77 dict.cmi : mach.cmi keiko.cmi
78 lexer.cmi : parser.cmi keiko.cmi dict.cmi
79 mach.cmo : mach.cmi
80 mach.cmx : mach.cmi
81 mach.cmi :
82 main.cmo : tree.cmi peepopt.cmi parser.cmi mach.cmi lexer.cmi kgen.cmi \
83 check.cmi
84 main.cmx : tree.cmx peepopt.cmx parser.cmx mach.cmx lexer.cmx kgen.cmx \
85 check.cmx
86 keiko.cmi :
87 keiko.cmo : keiko.cmi
88 keiko.cmx : keiko.cmi
89 kgen.cmi : tree.cmi
90 kgen.cmo : util.cmo tree.cmi peepopt.cmi mach.cmi lexer.cmi keiko.cmi \
91 dict.cmi kgen.cmi
92 kgen.cmx : util.cmx tree.cmx peepopt.cmx mach.cmx lexer.cmx keiko.cmx \
93 dict.cmx kgen.cmi
94 tree.cmo : keiko.cmi dict.cmi tree.cmi
95 tree.cmx : keiko.cmx dict.cmx tree.cmi
96 tree.cmi : keiko.cmi dict.cmi
97 util.cmo :
98 util.cmx :
99 peepopt.cmi : keiko.cmi
100 peepopt.cmo : util.cmo keiko.cmi peepopt.cmi
101 peepopt.cmx : util.cmx keiko.cmx peepopt.cmi