aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.extr
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-02-26 11:00:08 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-02-26 11:00:08 +0100
commitde9b0fa50e9c69ef2f896a280ede45bfc9457718 (patch)
tree4933af4a139e88ec08da3729f383243d23e808e7 /Makefile.extr
parent075b7680ac42ff6ebb2de35bb3b3d6718cb09cd2 (diff)
parent6d53a8b7ffd06d9726103803eb69d94a333ae0a5 (diff)
downloadcompcert-de9b0fa50e9c69ef2f896a280ede45bfc9457718.tar.gz
compcert-de9b0fa50e9c69ef2f896a280ede45bfc9457718.zip
Merge branch 'master' into backend_printer
Conflicts: ia32/PrintAsm.ml
Diffstat (limited to 'Makefile.extr')
-rw-r--r--Makefile.extr28
1 files changed, 17 insertions, 11 deletions
diff --git a/Makefile.extr b/Makefile.extr
index 2afd6e31..372f5e32 100644
--- a/Makefile.extr
+++ b/Makefile.extr
@@ -61,23 +61,23 @@ endif
OCAMLC=ocamlc$(DOTOPT) $(COMPFLAGS)
OCAMLOPT=ocamlopt$(DOTOPT) $(COMPFLAGS)
-OCAMLDEP=ocamldep$(DOTOPT) $(INCLUDES)
# Compilers used for Camlp4-preprocessed code. Note that we cannot
# use the .opt compilers (because ocamlfind doesn't support them).
OCAMLC_P4=ocamlfind ocamlc $(COMPFLAGS) $(BITSTRING)
OCAMLOPT_P4=ocamlfind ocamlopt $(COMPFLAGS) $(BITSTRING)
-OCAMLDEP_P4=ocamlfind ocamldep $(INCLUDES) $(BITSTRING)
MENHIR=menhir --explain
OCAMLLEX=ocamllex -q
MODORDER=tools/modorder .depend.extr
PARSERS=backend/CMparser.mly cparser/pre_parser.mly
-LEXERS=backend/CMlexer.mll cparser/Lexer.mll lib/Tokenize.mll
+LEXERS=backend/CMlexer.mll cparser/Lexer.mll \
+ lib/Tokenize.mll lib/Readconfig.mll
-LIBS=str.cmxa
+LIBS=str.cmxa unix.cmxa
+CHECKLINK_LIBS=str.cmxa
EXECUTABLES=ccomp ccomp.byte cchecklink cchecklink.byte clightgen clightgen.byte
GENERATED=$(PARSERS:.mly=.mli) $(PARSERS:.mly=.ml) $(LEXERS:.mll=.ml)
@@ -90,11 +90,11 @@ CCOMP_OBJS:=$(shell $(MODORDER) driver/Driver.cmx)
ccomp: $(CCOMP_OBJS)
@echo "Linking $@"
- @$(OCAMLOPT) -o $@ $(LIBS) $+ $(LINKERSPEC)
+ @$(OCAMLOPT) -o $@ $(LIBS) $+
ccomp.byte: $(CCOMP_OBJS:.cmx=.cmo)
@echo "Linking $@"
- @$(OCAMLC) -o $@ $(LIBS:.cmxa=.cma) $+ $(LINKERSPEC)
+ @$(OCAMLC) -o $@ $(LIBS:.cmxa=.cma) $+
ifeq ($(CCHECKLINK),true)
@@ -102,11 +102,11 @@ CCHECKLINK_OBJS:=$(shell $(MODORDER) checklink/Validator.cmx)
cchecklink: $(CCHECKLINK_OBJS)
@echo "Linking $@"
- @$(OCAMLOPT_P4) -linkpkg -o $@ $(LIBS) $+
+ @$(OCAMLOPT_P4) -linkpkg -o $@ $(CHECKLINK_LIBS) $+
cchecklink.byte: $(CCHECKLINK_OBJS:.cmx=.cmo)
@echo "Linking $@"
- @$(OCAMLC_P4) -linkpkg -o $@ $(LIBS:.cmxa=.cma) $+
+ @$(OCAMLC_P4) -linkpkg -o $@ $(CHECKLINK_LIBS:.cmxa=.cma) $+
endif
@@ -154,6 +154,7 @@ checklink/%.cmx: checklink/%.ml
clean:
rm -f $(EXECUTABLES)
rm -f $(GENERATED)
+ rm -f tools/recdepend
for d in $(ALLDIRS); do rm -f $$d/*.cm[iox] $$d/*.o; done
cleansource:
@@ -162,11 +163,16 @@ cleansource:
# Generation of .depend.extr
-depend: $(GENERATED)
+tools/recdepend: tools/recdepend.ml
+ ocamlopt -o tools/recdepend unix.cmxa tools/recdepend.ml
+
+RECDEPEND=tools/recdepend
+
+depend: $(GENERATED) tools/recdepend
@echo "Analyzing OCaml dependencies"
- @for d in $(DIRS); do $(OCAMLDEP) $$d/*.mli $$d/*.ml; done > .depend.extr
+ @$(RECDEPEND) $(DIRS) -o .depend.extr
ifneq ($(strip $(DIRS_P4)),)
- @for d in $(DIRS_P4); do $(OCAMLDEP_P4) $$d/*.mli $$d/*.ml; done >> .depend.extr
+ @$(RECDEPEND) -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr
endif