annotate lab2/Makefile @ 1:b5139af1a420 tip basis

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