annotate Makefile @ 270:b9b02613c0c2

Parsing jobs
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Sep 2008 10:31:16 -0400
parents 71bafe66dbe1
children 168667cdaa95
rev   line source
adamc@102 1 all: smlnj mlton c
adamc@0 2
adamc@102 3 .PHONY: all smlnj mlton c clean
adamc@0 4
adamc@244 5 smlnj: src/urweb.cm
adamc@244 6 mlton: bin/urweb
adamc@244 7 c: clib/urweb.o clib/driver.o
adamc@0 8
adamc@0 9 clean:
adamc@0 10 rm -f src/*.mlton.grm.* src/*.mlton.lex.* \
adamc@244 11 src/urweb.cm src/urweb.mlb \
adamc@102 12 clib/*.o
adamc@0 13 rm -rf .cm src/.cm
adamc@0 14
adamc@244 15 clib/urweb.o: src/c/urweb.c
adamc@244 16 gcc -O3 -I include -c src/c/urweb.c -o clib/urweb.o
adamc@102 17
adamc@102 18 clib/driver.o: src/c/driver.c
adamc@117 19 gcc -O3 -I include -c src/c/driver.c -o clib/driver.o
adamc@102 20
adamc@244 21 src/urweb.cm: src/prefix.cm src/sources
adamc@0 22 cat src/prefix.cm src/sources \
adamc@244 23 >src/urweb.cm
adamc@0 24
adamc@244 25 src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb
adamc@0 26 cat src/prefix.mlb src/sources src/suffix.mlb \
adamc@0 27 | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig\n\1.mlton.grm.sml/' \
adamc@0 28 | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \
adamc@244 29 >src/urweb.mlb
adamc@0 30
adamc@0 31 %.mlton.lex: %.lex
adamc@0 32 cp $< $@
adamc@0 33 %.mlton.grm: %.grm
adamc@0 34 cp $< $@
adamc@0 35
adamc@0 36 %.mlton.lex.sml: %.mlton.lex
adamc@0 37 mllex $<
adamc@0 38
adamc@0 39 %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm
adamc@0 40 mlyacc $<
adamc@0 41
adamc@0 42 MLTON := mlton
adamc@0 43
adamc@0 44 ifdef DEBUG
adamc@0 45 MLTON += -const 'Exn.keepHistory true'
adamc@0 46 endif
adamc@0 47
adamc@244 48 bin/urweb: src/urweb.mlb src/*.sig src/*.sml \
adamc@244 49 src/urweb.mlton.lex.sml \
adamc@244 50 src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml
adamc@244 51 $(MLTON) -output $@ src/urweb.mlb