annotate Makefile.in @ 853:19fdeef40ada

Factor out common request functionality, in preparation for supporting different protocols
author Adam Chlipala <adamc@hcoop.net>
date Tue, 23 Jun 2009 14:05:12 -0400
parents 5368deb3764b
children 28e42b22424d
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@569 8 LIB_JS := $(LIB)/js
adamc@378 9
adamc@378 10 all: smlnj mlton c
adamc@378 11
adamc@427 12 .PHONY: all smlnj mlton c clean install package
adamc@378 13
adamc@378 14 smlnj: src/urweb.cm
adamc@378 15 mlton: bin/urweb
adamc@853 16 c: lib/c/urweb.o lib/c/request.o lib/c/driver.o
adamc@378 17
adamc@378 18 clean:
adamc@378 19 rm -f src/*.mlton.grm.* src/*.mlton.lex.* \
adamc@378 20 src/urweb.cm src/urweb.mlb \
adamc@602 21 lib/c/*.o
adamc@378 22 rm -rf .cm src/.cm
adamc@378 23
adamc@853 24 lib/c/%.o: src/c/%.c include/*.h
adamc@853 25 gcc -O3 -I include -c $< -o $@ $(CFLAGS)
adamc@378 26
adamc@378 27 src/urweb.cm: src/prefix.cm src/sources
adamc@378 28 cat src/prefix.cm src/sources \
adamc@378 29 >src/urweb.cm
adamc@378 30
adamc@378 31 src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb
adamc@378 32 cat src/prefix.mlb src/sources src/suffix.mlb \
adamc@431 33 | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig:\1.mlton.grm.sml/; y/:/\n/' \
adamc@378 34 | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \
adamc@791 35 >$@
adamc@378 36
adamc@378 37 %.mlton.lex: %.lex
adamc@378 38 cp $< $@
adamc@378 39 %.mlton.grm: %.grm
adamc@378 40 cp $< $@
adamc@378 41
adamc@378 42 %.mlton.lex.sml: %.mlton.lex
adamc@378 43 mllex $<
adamc@378 44
adamc@378 45 %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm
adamc@378 46 mlyacc $<
adamc@378 47
adamc@378 48 MLTON := mlton
adamc@378 49
adamc@378 50 ifdef DEBUG
adamc@378 51 MLTON += -const 'Exn.keepHistory true'
adamc@378 52 endif
adamc@378 53
adamc@507 54 ifdef PROFILE
adamc@507 55 MLTON += -profile $(PROFILE)
adamc@507 56 endif
adamc@507 57
adamc@791 58 bin/urweb: src/compiler.mlb src/urweb.mlb src/*.sig src/*.sml \
adamc@378 59 src/urweb.mlton.lex.sml \
adamc@378 60 src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml
adamc@791 61 $(MLTON) -output $@ src/compiler.mlb
adamc@378 62
adamc@378 63 install:
adamc@430 64 mkdir -p $(BIN)
adamc@378 65 cp bin/urweb $(BIN)/
adamc@378 66 mkdir -p $(LIB_UR)
adamc@602 67 cp lib/ur/*.urs $(LIB_UR)/
adamc@602 68 cp lib/ur/*.ur $(LIB_UR)/
adamc@378 69 mkdir -p $(LIB_C)
adamc@602 70 cp lib/c/*.o $(LIB_C)/
adamc@569 71 mkdir -p $(LIB_JS)
adamc@602 72 cp lib/js/*.js $(LIB_JS)/
adamc@378 73 mkdir -p $(INCLUDE)
adamc@378 74 cp include/*.h $(INCLUDE)/
adamc@378 75 mkdir -p $(SITELISP)
adamc@378 76 cp src/elisp/*.el $(SITELISP)/
adamc@427 77
adamc@427 78 package:
adamc@427 79 hg archive -t tgz -X tests /tmp/urweb.tgz