annotate ppc/Makefile @ 0:bfdcc3820b32

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