adamc@378: BIN := @BIN@ adamc@378: LIB := @LIB@ adamc@378: INCLUDE := @INCLUDE@ adamc@378: SITELISP := @SITELISP@ adamc@378: adamc@378: LIB_UR := $(LIB)/ur adamc@378: LIB_C := $(LIB)/c adamc@569: LIB_JS := $(LIB)/js adamc@378: adamc@378: all: smlnj mlton c adamc@378: adamc@427: .PHONY: all smlnj mlton c clean install package adamc@378: adamc@378: smlnj: src/urweb.cm adamc@378: mlton: bin/urweb adamc@855: adamc@859: OBJS := urweb request queue http cgi fastcgi adamc@855: c: $(OBJS:%=lib/c/%.o) adamc@378: adamc@378: clean: adamc@378: rm -f src/*.mlton.grm.* src/*.mlton.lex.* \ adamc@378: src/urweb.cm src/urweb.mlb \ adamc@602: lib/c/*.o adamc@378: rm -rf .cm src/.cm adamc@378: adamc@853: lib/c/%.o: src/c/%.c include/*.h adamc@853: gcc -O3 -I include -c $< -o $@ $(CFLAGS) adamc@378: adamc@378: src/urweb.cm: src/prefix.cm src/sources adamc@378: cat src/prefix.cm src/sources \ adamc@378: >src/urweb.cm adamc@378: adamc@378: src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb adamc@378: cat src/prefix.mlb src/sources src/suffix.mlb \ adamc@431: | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig:\1.mlton.grm.sml/; y/:/\n/' \ adamc@378: | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \ adamc@791: >$@ adamc@378: adamc@378: %.mlton.lex: %.lex adamc@378: cp $< $@ adamc@378: %.mlton.grm: %.grm adamc@378: cp $< $@ adamc@378: adamc@378: %.mlton.lex.sml: %.mlton.lex adamc@378: mllex $< adamc@378: adamc@378: %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm adamc@378: mlyacc $< adamc@378: adamc@378: MLTON := mlton adamc@378: adamc@378: ifdef DEBUG adamc@378: MLTON += -const 'Exn.keepHistory true' adamc@378: endif adamc@378: adamc@507: ifdef PROFILE adamc@507: MLTON += -profile $(PROFILE) adamc@507: endif adamc@507: adamc@791: bin/urweb: src/compiler.mlb src/urweb.mlb src/*.sig src/*.sml \ adamc@378: src/urweb.mlton.lex.sml \ adamc@378: src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml adamc@791: $(MLTON) -output $@ src/compiler.mlb adamc@378: adamc@378: install: adamc@430: mkdir -p $(BIN) adamc@378: cp bin/urweb $(BIN)/ adamc@378: mkdir -p $(LIB_UR) adamc@602: cp lib/ur/*.urs $(LIB_UR)/ adamc@602: cp lib/ur/*.ur $(LIB_UR)/ adamc@378: mkdir -p $(LIB_C) adamc@602: cp lib/c/*.o $(LIB_C)/ adamc@569: mkdir -p $(LIB_JS) adamc@602: cp lib/js/*.js $(LIB_JS)/ adamc@378: mkdir -p $(INCLUDE) adamc@378: cp include/*.h $(INCLUDE)/ adamc@378: mkdir -p $(SITELISP) adamc@378: cp src/elisp/*.el $(SITELISP)/ adamc@427: adamc@427: package: adamc@427: hg archive -t tgz -X tests /tmp/urweb.tgz