annotate Makefile.in @ 427:0eb7bb4872d0

Add 'package' make target; add LICENSE
author Adam Chlipala <adamc@hcoop.net>
date Fri, 24 Oct 2008 17:39:47 -0400
parents 168667cdaa95
children 0af37c883358
rev   line source
adamc@378 1 BIN := @BIN@
adamc@378 2 LIB := @LIB@
adamc@378 3 INCLUDE := @INCLUDE@
adamc@378 4 SITELISP := @SITELISP@
adamc@378 5
adamc@378 6 LIB_UR := $(LIB)/ur
adamc@378 7 LIB_C := $(LIB)/c
adamc@378 8
adamc@378 9 all: smlnj mlton c
adamc@378 10
adamc@427 11 .PHONY: all smlnj mlton c clean install package
adamc@378 12
adamc@378 13 smlnj: src/urweb.cm
adamc@378 14 mlton: bin/urweb
adamc@378 15 c: clib/urweb.o clib/driver.o
adamc@378 16
adamc@378 17 clean:
adamc@378 18 rm -f src/*.mlton.grm.* src/*.mlton.lex.* \
adamc@378 19 src/urweb.cm src/urweb.mlb \
adamc@378 20 clib/*.o
adamc@378 21 rm -rf .cm src/.cm
adamc@378 22
adamc@378 23 clib/urweb.o: src/c/urweb.c
adamc@378 24 gcc -O3 -I include -c src/c/urweb.c -o clib/urweb.o
adamc@378 25
adamc@378 26 clib/driver.o: src/c/driver.c
adamc@378 27 gcc -O3 -I include -c src/c/driver.c -o clib/driver.o
adamc@378 28
adamc@378 29 src/urweb.cm: src/prefix.cm src/sources
adamc@378 30 cat src/prefix.cm src/sources \
adamc@378 31 >src/urweb.cm
adamc@378 32
adamc@378 33 src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb
adamc@378 34 cat src/prefix.mlb src/sources src/suffix.mlb \
adamc@378 35 | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig\n\1.mlton.grm.sml/' \
adamc@378 36 | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \
adamc@378 37 >src/urweb.mlb
adamc@378 38
adamc@378 39 %.mlton.lex: %.lex
adamc@378 40 cp $< $@
adamc@378 41 %.mlton.grm: %.grm
adamc@378 42 cp $< $@
adamc@378 43
adamc@378 44 %.mlton.lex.sml: %.mlton.lex
adamc@378 45 mllex $<
adamc@378 46
adamc@378 47 %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm
adamc@378 48 mlyacc $<
adamc@378 49
adamc@378 50 MLTON := mlton
adamc@378 51
adamc@378 52 ifdef DEBUG
adamc@378 53 MLTON += -const 'Exn.keepHistory true'
adamc@378 54 endif
adamc@378 55
adamc@378 56 bin/urweb: src/urweb.mlb src/*.sig src/*.sml \
adamc@378 57 src/urweb.mlton.lex.sml \
adamc@378 58 src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml
adamc@378 59 $(MLTON) -output $@ src/urweb.mlb
adamc@378 60
adamc@378 61 install:
adamc@378 62 cp bin/urweb $(BIN)/
adamc@378 63 mkdir -p $(LIB_UR)
adamc@378 64 cp lib/*.urs $(LIB_UR)/
adamc@378 65 cp lib/*.ur $(LIB_UR)/
adamc@378 66 mkdir -p $(LIB_C)
adamc@378 67 cp clib/*.o $(LIB_C)/
adamc@378 68 mkdir -p $(INCLUDE)
adamc@378 69 cp include/*.h $(INCLUDE)/
adamc@378 70 mkdir -p $(SITELISP)
adamc@378 71 cp src/elisp/*.el $(SITELISP)/
adamc@427 72
adamc@427 73 package:
adamc@427 74 hg archive -t tgz -X tests /tmp/urweb.tgz