1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
include ../Makefile.config
OCAMLC := ${OCAMLFIND} ocamlc
OCAMLOPT := ${OCAMLFIND} ocamlopt
OCAMLDEP := ${OCAMLFIND} ocamldep
PP := -package camlp4 -ppopt ../syntax/pa_deriving.cma -syntax camlp4o
OCAMLFLAGS := -w ae
SOURCES = deriving_Show.ml \
deriving_interned.ml \
deriving_Eq.ml \
deriving_Bounded.ml \
deriving_Enum.ml \
deriving_monad.ml \
deriving_Dump.ml \
deriving_Typeable.ml \
deriving_dynmap.ml \
deriving_Pickle.ml \
deriving_Functor.ml \
##
all: byte opt
byte: deriving.cma deriving_num.cma
opt:: deriving.cmxa deriving_num.cmxa
ifeq "${NATDYNLINK}" "YES"
opt:: deriving.cmxs deriving_num.cmxs
endif
##
deriving.cma: ${SOURCES:.ml=.cmo}
${OCAMLC} -a -o $@ $^
deriving.cmxa: ${SOURCES:.ml=.cmx}
${OCAMLOPT} -a -o $@ $^
deriving_num.cma: deriving_num.cmo
${OCAMLC} -a -o $@ $^
deriving_num.cmxa: deriving_num.cmx
${OCAMLOPT} -a -o $@ $^
# Common rules
%.cmi: %.mli
${OCAMLC} ${OCAMLFLAGS} ${PP} -c $<
%.cmo: %.ml
${OCAMLC} ${OCAMLFLAGS} ${PP} -c $<
%.cmx: %.ml
${OCAMLOPT} ${OCAMLFLAGS} ${PP} -c $<
%.cmxs: %.cmxa
$(OCAMLOPT) -shared -linkall -o $@ $<
# Clean up
clean:
-rm -f *.cm[ioax] *.cmxa *.cmxs *${OBJEXT} *${LIBEXT} *.annot
distclean: clean
-rm -f .*.deps
-rm -f *~ \#* .\#*
# Dependencies
DEPS := $(patsubst %.ml,.%.ml.deps,$(wildcard *.ml)) \
$(patsubst %.mli,.%.mli.deps,$(wildcard *.mli))
.depend: ${DEPS}
cat .*.deps > .depend
.SECONDARY: ${DEPS}
.%.ml.deps: %.ml
${OCAMLDEP} ${PP} $^ > $@
.%.mli.deps: %.mli
${OCAMLDEP} ${PP} $^ > $@
ifneq (${DEPEND},no)
include .depend
endif
|