Source

odeci / ocaml / Makefile

Full commit
PROG = odec_port
PROG_BYTE = $(PROG).byte
PROG_NATIVE = $(PROG).native
PROG_DEST = $(PROG_NATIVE)
SRC_DIRS = src e
USED_LIBS = nums unix bigarray
SRC = $(patsubst %, -I %, $(SRC_DIRS))
LIBS = $(patsubst %, -lib %, $(USED_LIBS))
DEF_VARS = EPT_DUMP_DEBUG EPT_XY_DEBUG EPT_LAB_DEBUG EPT_TRACE_DEBUG
DEFS = $(patsubst %, -D %, $(DEF_VARS))
CFLAGS_PURE = -g -annot
CFLAGS = $(patsubst %, -cflag %, $(CFLAGS_PURE))
LFLAGS_PURE = -g
LFLAGS = $(patsubst %, -cflag %, $(LFLAGS_PURE))

all:
	ocamlbuild $(LFLAGS) $(CFLAGS) $(SRC) $(LIBS) -pp "camlp4o Camlp4MacroParser.cmo $(DEFS)" $(PROG_DEST)
#	ocamlbuild -lflag -g -cflag -g -cflag -annot -I src -I e -lib nums -lib unix -lib bigarray -pp "camlp4o Camlp4MacroParser.cmo -D EPT_DUMP_DEBUG -D EPT_XY_DEBUG -D EPT_LAB_DEBUG -D EPT_TRACE_DEBUG" $(PROG_BYTE)

prof:
	# for profiling:
	ocamlbuild -lflag -p -cflag -p -I e -lib nums -lib unix -lib bigarray -pp "camlp4o Camlp4MacroParser.cmo -D EPT_DUMP_DEBUG -D EPT_XY_DEBUG -D EPT_LAB_DEBUG -D EPT_TRACE_DEBUG" src/$(PROG_NATIVE)

clean:
	rm -rf _build $(PROG_BYTE) $(PROG_NATIVE) $(PROG)

distclean: clean