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