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@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@378: c: clib/urweb.o clib/driver.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@378: clib/*.o adamc@378: rm -rf .cm src/.cm adamc@378: adamc@378: clib/urweb.o: src/c/urweb.c adamc@502: gcc -O3 -I include -c src/c/urweb.c -o clib/urweb.o $(CFLAGS) adamc@378: adamc@378: clib/driver.o: src/c/driver.c adamc@502: gcc -O3 -I include -c src/c/driver.c -o clib/driver.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@378: >src/urweb.mlb 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@378: bin/urweb: 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@378: $(MLTON) -output $@ src/urweb.mlb adamc@378: adamc@378: install: adamc@430: mkdir -p $(BIN) adamc@378: cp bin/urweb $(BIN)/ adamc@378: mkdir -p $(LIB_UR) adamc@378: cp lib/*.urs $(LIB_UR)/ adamc@378: cp lib/*.ur $(LIB_UR)/ adamc@378: mkdir -p $(LIB_C) adamc@378: cp clib/*.o $(LIB_C)/ 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