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