Source

Opifex / Makefile

Full commit
OCAMLBUILD=ocamlbuild -use-ocamlfind -yaccflags -v
OCAML_DIRS=\
	-Is src\
	-Is src/Lib\
	-Is src/Lib/Util\
	-Is src/Lib/Algebra\
	-Is src/Lib/Command\
	-Is src/Language\
	-Is src/Language/While\
	-Is src/Language/MiniML\
	-Is src/Language/CWACM\
	-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/CWACM\
	-Is src/Transformation/CWCPS\
	-Is src/Architecture\
	-Is src/Architecture/X86\
	-Is src/Architecture/Amd64\


OCAML_LIBS=#-libs unix

TEST_DIRS=\
	${OCAML_DIRS}\
	-Is test\
	-Is test/Lib\
	-Is test/Lib/Util\
	-Is test/Lib/Algebra\
	-Is test/Lib/Command\
	-Is test/Language\
	-Is test/Language/While\
	-Is test/Language/MiniML\
	-Is test/Language/CWACM\
	-Is test/Language/CWCPS\
	-Is test/Language/Common\
	-Is test/Analysis\
	-Is test/Analysis/While\
	-Is test/Analysis/MiniML\
	-Is test/Analysis/CWCPS\
	-Is test/Transformation\
	-Is test/Transformation/While\
	-Is test/Transformation/MiniML\
	-Is test/Transformation/CWCPS\
	-Is test/Transformation/CWACM\
	-Is test/Architecture\
	-Is test/Architecture/X86\
	-Is test/Architecture/Amd64\

PROGRAM=Opifex
TEST=Test

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

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

all: ${PROGRAM}

test: ${TEST}

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

${PROGRAM}: src/Autogen.ml
	${VERBOSE}${OCAMLBUILD} ${OCAML_LIBS} ${OCAML_DIRS} src/${PROGRAM}.native

${TEST}:
	${VERBOSE}${OCAMLBUILD} ${OCAML_LIBS} ${TEST_DIRS} test/${TEST}.native

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

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

%.cma: %.ml
	${VERBOSE}${OCAMLBUILD} ${OCAML_LIBS} ${OCAML_DIRS} $@