Mercurial > urweb
annotate Makefile @ 399:2d64457eedb1
listFun uses length
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 21 Oct 2008 13:41:03 -0400 |
parents | 168667cdaa95 |
children |
rev | line source |
---|---|
adamc@378 | 1 BIN := /usr/local/bin |
adamc@378 | 2 LIB := /usr/local/lib/urweb |
adamc@378 | 3 INCLUDE := /usr/local/include/urweb |
adamc@378 | 4 SITELISP := /usr/local/share/emacs/site-lisp/urweb-mode |
adamc@378 | 5 |
adamc@378 | 6 LIB_UR := $(LIB)/ur |
adamc@378 | 7 LIB_C := $(LIB)/c |
adamc@378 | 8 |
adamc@102 | 9 all: smlnj mlton c |
adamc@0 | 10 |
adamc@378 | 11 .PHONY: all smlnj mlton c clean install |
adamc@0 | 12 |
adamc@244 | 13 smlnj: src/urweb.cm |
adamc@244 | 14 mlton: bin/urweb |
adamc@244 | 15 c: clib/urweb.o clib/driver.o |
adamc@0 | 16 |
adamc@0 | 17 clean: |
adamc@0 | 18 rm -f src/*.mlton.grm.* src/*.mlton.lex.* \ |
adamc@244 | 19 src/urweb.cm src/urweb.mlb \ |
adamc@102 | 20 clib/*.o |
adamc@0 | 21 rm -rf .cm src/.cm |
adamc@0 | 22 |
adamc@244 | 23 clib/urweb.o: src/c/urweb.c |
adamc@244 | 24 gcc -O3 -I include -c src/c/urweb.c -o clib/urweb.o |
adamc@102 | 25 |
adamc@102 | 26 clib/driver.o: src/c/driver.c |
adamc@117 | 27 gcc -O3 -I include -c src/c/driver.c -o clib/driver.o |
adamc@102 | 28 |
adamc@244 | 29 src/urweb.cm: src/prefix.cm src/sources |
adamc@0 | 30 cat src/prefix.cm src/sources \ |
adamc@244 | 31 >src/urweb.cm |
adamc@0 | 32 |
adamc@244 | 33 src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb |
adamc@0 | 34 cat src/prefix.mlb src/sources src/suffix.mlb \ |
adamc@0 | 35 | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig\n\1.mlton.grm.sml/' \ |
adamc@0 | 36 | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \ |
adamc@244 | 37 >src/urweb.mlb |
adamc@0 | 38 |
adamc@0 | 39 %.mlton.lex: %.lex |
adamc@0 | 40 cp $< $@ |
adamc@0 | 41 %.mlton.grm: %.grm |
adamc@0 | 42 cp $< $@ |
adamc@0 | 43 |
adamc@0 | 44 %.mlton.lex.sml: %.mlton.lex |
adamc@0 | 45 mllex $< |
adamc@0 | 46 |
adamc@0 | 47 %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm |
adamc@0 | 48 mlyacc $< |
adamc@0 | 49 |
adamc@0 | 50 MLTON := mlton |
adamc@0 | 51 |
adamc@0 | 52 ifdef DEBUG |
adamc@0 | 53 MLTON += -const 'Exn.keepHistory true' |
adamc@0 | 54 endif |
adamc@0 | 55 |
adamc@244 | 56 bin/urweb: src/urweb.mlb src/*.sig src/*.sml \ |
adamc@244 | 57 src/urweb.mlton.lex.sml \ |
adamc@244 | 58 src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml |
adamc@244 | 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)/ |