Source

Opifex / Makefile

Full commit
OCAMLBUILD=ocamlbuild -use-ocamlfind -yaccflags -v
OCAMLDIRS=\
	-Is src\
	-Is src/Lib\
	-Is src/Lib/Util\
	-Is src/Lib/Algebra\
	-Is src/Language\
	-Is src/Language/While\
	-Is src/Language/MiniML\
	-Is src/Language/CWCPS\
	-Is src/Language/Common\
	-Is src/Analysis/While\
	-Is src/Analysis/MiniML\
	-Is src/Analysis/CWCPS\
	-Is src/Transformation/While\
	-Is src/Transformation/MiniML\
	-Is src/Transformation/CWCPS\
	-Is src/Architecture\
	-Is src/Architecture/X86\
	-Is src/Architecture/Amd64\


OCAMLLIBS=#-libs unix

PROGRAM=Opifex

SRCS_ALL=${SRCS1} ${PARSERS} ${LEXERS} ${SRCS2}
VERBOSE?=@

.PHONY: clean ${PROGRAM} doc src/Autogen.ml
.SUFFIXES: .cma

all: ${PROGRAM}

doc:
	./tools/enumerate_modules > doc/Reference.odocl
	${VERBOSE}${OCAMLBUILD} ${OCAMLLIBS} ${OCAMLDIRS} doc/Reference.docdir/index.html

${PROGRAM}: src/Autogen.ml
	${VERBOSE}${OCAMLBUILD} ${OCAMLLIBS} ${OCAMLDIRS} src/${PROGRAM}.native

src/Autogen.ml: Makefile 
	@echo "	AUTOGEN		Autogen.ml"
	${VERBOSE}(DATE=`date`; echo "let current_date = \"$${DATE}\"" > src/Autogen.ml)

clean:
	${VERBOSE}${OCAMLBUILD} ${OCAMLDIRS} src/${PROGRAM}.native -clean

%.cma: %.ml
	${VERBOSE}${OCAMLBUILD} ${OCAMLLIBS} ${OCAMLDIRS} $@