ocaml/tools/Makefile

51 lines
1.0 KiB
Makefile

CAMLC=../boot/camlrun ../boot/camlc -I ../boot
INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp
COMPFLAGS=$(INCLUDES)
LINKFLAGS=$(INCLUDES)
all: dumpobj
DUMPOBJ=opnames.cmo dumpobj.cmo
dumpobj: $(DUMPOBJ)
$(CAMLC) $(LINKFLAGS) -o dumpobj misc.cmo tbl.cmo config.cmo ident.cmo opcodes.cmo runtimedef.cmo $(DUMPOBJ)
clean::
rm -f dumpobj
opnames.ml: ../byterun/instruct.h
sed -e '/\/\*/d' \
-e 's/enum \(.*\) {/let names_of_\1 = [|/' \
-e 's/};$$/ |]/' \
-e 's/\([A-Z][A-Z_0-9a-z]*\)/"\1"/g' \
-e 's/,/;/g' \
../byterun/instruct.h > opnames.ml
clean::
rm -f opnames.ml
beforedepend:: opnames.ml
dumpapprox: dumpapprox.cmo
$(CAMLC) $(LINKFLAGS) -o dumpapprox config.cmo dumpapprox.cmo
clean::
rm -f dumpapprox
.SUFFIXES:
.SUFFIXES: .ml .cmo .mli .cmi
.ml.cmo:
$(CAMLC) -c $(COMPFLAGS) $<
.mli.cmi:
$(CAMLC) -c $(COMPFLAGS) $<
clean::
rm -f *.cmo *.cmi
depend: beforedepend
camldep $(INCLUDES) *.mli *.ml > .depend
include .depend