From c130f4936bad11fd6dab3a5d142b870d2a5f650c Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Mon, 29 Dec 2014 11:15:29 +0100 Subject: Use Unix.create_process instead of Sys.command (continued). --- Makefile.extr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 35ae5f7b..5c9cc8dd 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -75,9 +75,10 @@ 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 EXECUTABLES=ccomp ccomp.byte cchecklink cchecklink.byte clightgen clightgen.byte GENERATED=$(PARSERS:.mly=.mli) $(PARSERS:.mly=.ml) $(LEXERS:.mll=.ml) -- cgit From b0c09b32f3e559ca22afc4dc40fdd60964cb3292 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 20 Jan 2015 16:50:07 +0100 Subject: Removed the linker flag again. --- Makefile.extr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 2afd6e31..5f02bf38 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -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) -- cgit From a452aa6d282ceb3408cc5557c7b07798a3887b06 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 20 Feb 2015 10:52:58 +0100 Subject: Removed the Unix from the libraries for cchecklink. --- Makefile.extr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 543f4637..83ef3e2b 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -79,6 +79,7 @@ LEXERS=backend/CMlexer.mll cparser/Lexer.mll \ lib/Tokenize.mll lib/Readconfig.mll 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) @@ -103,11 +104,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 -- cgit From bd0591f676f585a38c32049f31f1f187d748d6a2 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 24 Feb 2015 19:15:00 +0100 Subject: Added a small ocamlfile that calls ocamlfind recursivly over a given directory. --- Makefile.extr | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 83ef3e2b..3299cea9 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -61,14 +61,12 @@ 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 @@ -156,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: @@ -164,11 +163,14 @@ cleansource: # Generation of .depend.extr -depend: $(GENERATED) +tools/recdepend: tools/recdepend.ml + ocamlopt -o tools/recdepend unix.cmxa tools/recdepend.ml + +depend: $(GENERATED) tools/recdepend @echo "Analyzing OCaml dependencies" - @for d in $(DIRS); do $(OCAMLDEP) $$d/*.mli $$d/*.ml; done > .depend.extr + @tools/recdepend $(DIRS) -o .depend.extr ifneq ($(strip $(DIRS_P4)),) - @for d in $(DIRS_P4); do $(OCAMLDEP_P4) $$d/*.mli $$d/*.ml; done >> .depend.extr + @tools/recdepend -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr endif -- cgit From 6d53a8b7ffd06d9726103803eb69d94a333ae0a5 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 25 Feb 2015 10:38:30 +0100 Subject: Updated the recdepend tool to avoid printing of ./ at the begining and printing duplicated -I flags. --- Makefile.extr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 3299cea9..372f5e32 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -166,11 +166,13 @@ cleansource: 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" - @tools/recdepend $(DIRS) -o .depend.extr + @$(RECDEPEND) $(DIRS) -o .depend.extr ifneq ($(strip $(DIRS_P4)),) - @tools/recdepend -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr + @$(RECDEPEND) -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr endif -- cgit From bfad5d6af72693654162b41eb3a0dcd2cf0368c3 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 27 Feb 2015 16:48:24 +0100 Subject: Removed the recdepend again and replaced it by a builtin Make function. --- Makefile.extr | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 372f5e32..67b2a604 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -61,12 +61,14 @@ endif OCAMLC=ocamlc$(DOTOPT) $(COMPFLAGS) OCAMLOPT=ocamlopt$(DOTOPT) $(COMPFLAGS) +OCAMLDEP=ocamldep$(DOTOPT) -slash $(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 @@ -154,7 +156,6 @@ 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: @@ -163,16 +164,13 @@ cleansource: # Generation of .depend.extr -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" - @$(RECDEPEND) $(DIRS) -o .depend.extr -ifneq ($(strip $(DIRS_P4)),) + $(OCAMLDEP) $(foreach d,$(DIRS),$(wildcard $(d)/*.mli $(d)/*.ml)) >.depend.extr + $(OCAMLDEP) $(GENERATED) >> .depend.extr + ifneq ($(strip $(DIRS_P4)),) @$(RECDEPEND) -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr + $(OCAMLDEP_P4) $(foreach d,$(DIRS_P4),$(wildcard $(d)/*.mli $(d)/*.ml)) >>.depend.extr endif -- cgit From 01062b44842657fce0a8bb6542aafb0c1bf0fba4 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 28 Feb 2015 09:37:43 +0100 Subject: Removed leftover references to recdepend. --- Makefile.extr | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index 67b2a604..eb578fa9 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -164,13 +164,12 @@ cleansource: # Generation of .depend.extr -depend: $(GENERATED) tools/recdepend +depend: $(GENERATED) @echo "Analyzing OCaml dependencies" - $(OCAMLDEP) $(foreach d,$(DIRS),$(wildcard $(d)/*.mli $(d)/*.ml)) >.depend.extr - $(OCAMLDEP) $(GENERATED) >> .depend.extr - ifneq ($(strip $(DIRS_P4)),) - @$(RECDEPEND) -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr - $(OCAMLDEP_P4) $(foreach d,$(DIRS_P4),$(wildcard $(d)/*.mli $(d)/*.ml)) >>.depend.extr + @$(OCAMLDEP) $(foreach d,$(DIRS),$(wildcard $(d)/*.mli $(d)/*.ml)) >.depend.extr + @$(OCAMLDEP) $(GENERATED) >> .depend.extr +ifneq ($(strip $(DIRS_P4)),) + @$(OCAMLDEP_P4) $(foreach d,$(DIRS_P4),$(wildcard $(d)/*.mli $(d)/*.ml)) >>.depend.extr endif -- cgit From 70b3b1cb30c9af476d23ceb61d0acd8342d56bfa Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 5 Mar 2015 09:37:28 +0100 Subject: Removed unused target cleansource. --- Makefile.extr | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Makefile.extr') diff --git a/Makefile.extr b/Makefile.extr index eb578fa9..fed2d78f 100644 --- a/Makefile.extr +++ b/Makefile.extr @@ -158,10 +158,6 @@ clean: rm -f $(GENERATED) for d in $(ALLDIRS); do rm -f $$d/*.cm[iox] $$d/*.o; done -cleansource: - rm -f $(EXECUTABLES) - for d in $(ALLDIRS); do rm -f $$d/*.cm[iox] $$d/*.o; done - # Generation of .depend.extr depend: $(GENERATED) -- cgit