adamc@378: BIN := /usr/local/bin adamc@378: LIB := /usr/local/lib/urweb adamc@378: INCLUDE := /usr/local/include/urweb adamc@378: SITELISP := /usr/local/share/emacs/site-lisp/urweb-mode adamc@378: adamc@378: LIB_UR := $(LIB)/ur adamc@378: LIB_C := $(LIB)/c adamc@378: adamc@102: all: smlnj mlton c adamc@0: adamc@378: .PHONY: all smlnj mlton c clean install adamc@0: adamc@244: smlnj: src/urweb.cm adamc@244: mlton: bin/urweb adamc@244: c: clib/urweb.o clib/driver.o adamc@0: adamc@0: clean: adamc@0: rm -f src/*.mlton.grm.* src/*.mlton.lex.* \ adamc@244: src/urweb.cm src/urweb.mlb \ adamc@102: clib/*.o adamc@0: rm -rf .cm src/.cm adamc@0: adamc@244: clib/urweb.o: src/c/urweb.c adamc@244: gcc -O3 -I include -c src/c/urweb.c -o clib/urweb.o adamc@102: adamc@102: clib/driver.o: src/c/driver.c adamc@117: gcc -O3 -I include -c src/c/driver.c -o clib/driver.o adamc@102: adamc@244: src/urweb.cm: src/prefix.cm src/sources adamc@0: cat src/prefix.cm src/sources \ adamc@244: >src/urweb.cm adamc@0: adamc@244: src/urweb.mlb: src/prefix.mlb src/sources src/suffix.mlb adamc@0: cat src/prefix.mlb src/sources src/suffix.mlb \ adamc@0: | sed 's/^\(.*\).grm$$/\1.mlton.grm.sig\n\1.mlton.grm.sml/' \ adamc@0: | sed 's/^\(.*\).lex$$/\1.mlton.lex.sml/' \ adamc@244: >src/urweb.mlb adamc@0: adamc@0: %.mlton.lex: %.lex adamc@0: cp $< $@ adamc@0: %.mlton.grm: %.grm adamc@0: cp $< $@ adamc@0: adamc@0: %.mlton.lex.sml: %.mlton.lex adamc@0: mllex $< adamc@0: adamc@0: %.mlton.grm.sig %.mlton.grm.sml: %.mlton.grm adamc@0: mlyacc $< adamc@0: adamc@0: MLTON := mlton adamc@0: adamc@0: ifdef DEBUG adamc@0: MLTON += -const 'Exn.keepHistory true' adamc@0: endif adamc@0: adamc@244: bin/urweb: src/urweb.mlb src/*.sig src/*.sml \ adamc@244: src/urweb.mlton.lex.sml \ adamc@244: src/urweb.mlton.grm.sig src/urweb.mlton.grm.sml adamc@244: $(MLTON) -output $@ src/urweb.mlb adamc@378: adamc@378: install: 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)/