Commit cbb31f75 authored by Kim Nguyễn's avatar Kim Nguyễn Committed by Pietro Abate

(Re)-enable parallel build of the project (make -j works as exptected)

Conflicts:
	Makefile.distrib
	depend
	ocamliface/4.01/Makefile
parent 285fbb37
......@@ -3,7 +3,11 @@ default: cduce
include Makefile.conf
include VERSION
OCAMLIFACE=ocamliface/$(ML_INTERFACE_VERSION)
ifneq ($(ML_INTERFACE), false)
OCAMLIFACE=ocamliface/$(ML_INTERFACE_VERSION)
else
OCAMLIFACE=
endif
ALL_TARGET=cduce cduce_lib.cma
INSTALL_BINARIES=cduce$(EXE)
......@@ -15,7 +19,7 @@ endif
OUNIT_TESTS=eval cdnum cdsdl misc
ifeq ($(NATIVE),true)
all: cduce_lib.cmxa
ALL_TARGET += cduce_lib.cmxa
endif
PACKAGES = dynlink camlp4 ulex pcre num netstring
......@@ -141,8 +145,10 @@ help:
# Source directories
DIRS_DEPEND = misc parser schema typing types compile runtime driver query win32
CLEAN_DIRS := $(DIRS_DEPEND) tools tests
DIRS := $(DIRS_DEPEND) $(OCAMLIFACE)
CLEAN_DIRS = $(DIRS) tools tests
# Objects to build
......@@ -189,6 +195,7 @@ ifneq ($(CURL), false)
OBJECTS += parser/cduce_curl.cmo
PACKAGES += curl
endif
ifneq ($(NETCLIENT), false)
OBJECTS += parser/cduce_netclient.cmo
PACKAGES += netclient
......@@ -230,6 +237,7 @@ ML_INTERFACE_BASE_SRC = $(ML_INTERFACE_BASE_OBJS:.cmo=.ml) $(ML_INTERFACE_BASE_O
ML_INTERFACE_OBJS = \
$(ML_INTERFACE_BASE_OBJS:%=$(OCAMLIFACE)/%)
OBJECTS_NO_MLIFACE := $(OBJECTS)
ifneq ($(ML_INTERFACE), false)
......@@ -287,16 +295,19 @@ compute_depend: $(DEPEND_OCAMLDEP)
ocamlfind ocamldep -package "$(PACKAGES)" \
$(INCLUDES_DEPEND) $(SYNTAX_PARSER) -ppopt pa_extend.cmo -ppopt q_MLast.cmo $(DEPEND) > depend
for i in $(ALL_ML_IFACE); do \
touch ocamliface/$$i/caml_cduce.ml; \
ocamlfind ocamldep -package "$(PACKAGES)" \
$(INCLUDES_DEPEND) -I ocamliface/$$i $(SYNTAX_PARSER) -ppopt pa_extend.cmo -ppopt q_MLast.cmo \
$(ML_INTERFACE_BASE_SRC:%=ocamliface/$$i/%) >> depend;\
rm -f ocamliface/$$i/caml_cduce.ml; \
done
clean:
for i in $(CLEAN_DIRS); do \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *~); \
done
(cd $(OCAMLIFACE); $(MAKE) clean)
rm -f misc/q_symbol.cmo.stamp
test -n "$(OCAMLIFACE)" && (cd $(OCAMLIFACE); $(MAKE) clean) || true
rm -f `find . -name "*~"`
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~ META
rm -f cduce$(EXE) ocamlprof.dump
......@@ -316,39 +327,40 @@ clean:
distclean: clean
rm -f Makefile.conf
.SUFFIXES: .ml .mli .cmo .cmi .cmx
$(OCAMLIFACE)/mltypes.$(EXTENSION): $(OCAMLIFACE)/caml_cduce.$(EXTENSION)
$(ALL_INTERFACES): misc/q_symbol.cmo
$(ALL_OBJECTS:.cmo=.cmi): misc/q_symbol.cmo
$(ALL_OBJECTS:.cmo=.cmx) caml_cduce.cmx: misc/q_symbol.cmo
$(ALL_OBJECTS) caml_cduce.cmo: misc/q_symbol.cmo
$(ALL_INTERFACES): misc/q_symbol.cmo.stamp
$(ALL_OBJECTS:.cmo=.cmi): misc/q_symbol.cmo.stamp
$(ALL_OBJECTS:.cmo=.cmx) caml_cduce.cmx: misc/q_symbol.cmo.stamp
$(ALL_OBJECTS) caml_cduce.cmo: misc/q_symbol.cmo.stamp
$(OCAMLIFACE)/mlstub.$(EXTENSION): SYNTAX += q_MLast.cmo
.SUFFIXES: .ml .mli .cmo .cmi .cmx
misc/q_symbol.cmo: misc/q_symbol.ml
misc/q_symbol.cmo.stamp: misc/q_symbol.ml
@echo "Build $@"
$(HIDE)$(CAMLC) -c -pp camlp4orf $<
$(HIDE) $(CAMLC) -c -pp camlp4orf $<
$(HIDE) sync
$(HIDE) touch misc/q_symbol.cmo.stamp
parser/parser.cmo: PACKAGES += camlp4.extend
parser/parser.cmx: PACKAGES += camlp4.extend
types/boolVar.cmo: SYNTAX_PARSER=
types/boolVar.cmi: SYNTAX_PARSER=
types/boolVar.cmx: SYNTAX_PARSER=
parser/parser.$(EXTENSION): PACKAGES += camlp4.extend
.ml.cmo:
@echo "Build $@"
$(HIDE)$(CAMLC) -c $(INCLUDES) $(SYNTAX_PARSER) $<
$(HIDE)$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
.ml.cmx:
@echo "Build $@"
$(HIDE)$(CAMLOPT) $(FORPACKOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
$(HIDE) $(CAMLOPT) $(FORPACKOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
.mli.cmi:
@echo "Build $@"
$(HIDE)$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
$(HIDE) $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
include depend
......@@ -380,12 +392,12 @@ install_doc: doc
$(OCAMLIFACE)/caml_cduce.cmo:
@echo "Build $@"
@cd $(OCAMLIFACE); \
$(MAKE) CAMLC="$(CAMLC_P)" CAMLOPT="$(CAMLOPT_P)" caml_cduce.cmo
$(MAKE) -s MODE=byte CAMLC="$(OCAMLFIND) $(CAMLC_P)" caml_cduce.cmo
$(OCAMLIFACE)/caml_cduce.cmx:
@echo "Build $@"
@cd $(OCAMLIFACE); \
$(MAKE) CAMLC="$(CAMLC_P)" CAMLOPT="$(CAMLOPT_P)" caml_cduce.cmx
$(MAKE) -s MODE=opt CAMLOPT="$(OCAMLFIND) $(CAMLOPT_P)" caml_cduce.cmx
$(OCAMLIFACE)/mlstub.cmo: SYNTAX += q_MLast.cmo
$(OCAMLIFACE)/mlstub.cmx: SYNTAX += q_MLast.cmo
......@@ -435,10 +435,12 @@ runtime/cduce_expat.cmi :
runtime/cduce_pxp.cmi :
schema/schema_types.cmi : runtime/value.cmi misc/ns.cmi misc/encodings.cmi \
types/atoms.cmi
ocamliface/3.x/mltypes.cmo : types/ident.cmo ocamliface/3.x/config.cmo \
parser/cduce_loc.cmi ocamliface/3.x/mltypes.cmi
ocamliface/3.x/mltypes.cmx : types/ident.cmx ocamliface/3.x/config.cmx \
parser/cduce_loc.cmx ocamliface/3.x/mltypes.cmi
ocamliface/3.x/caml_cduce.cmo :
ocamliface/3.x/caml_cduce.cmx :
ocamliface/3.x/mltypes.cmo : types/ident.cmo parser/cduce_loc.cmi \
ocamliface/3.x/caml_cduce.cmo ocamliface/3.x/mltypes.cmi
ocamliface/3.x/mltypes.cmx : types/ident.cmx parser/cduce_loc.cmx \
ocamliface/3.x/caml_cduce.cmx ocamliface/3.x/mltypes.cmi
ocamliface/3.x/mlstub.cmo : types/types.cmi typing/typer.cmi \
types/sequence.cmi misc/ns.cmi ocamliface/3.x/mltypes.cmi \
driver/librarian.cmi types/ident.cmo types/externals.cmi \
......@@ -451,41 +453,47 @@ ocamliface/3.x/mlstub.cmx : types/types.cmx typing/typer.cmx \
compile/compile.cmx parser/cduce_loc.cmx driver/cduce_config.cmx \
types/builtin_defs.cmx types/atoms.cmx parser/ast.cmx \
ocamliface/3.x/mlstub.cmi
ocamliface/3.x/mltypes.cmi : types/types.cmi
ocamliface/3.x/mltypes.cmi : types/types.cmi ocamliface/3.x/caml_cduce.cmo
ocamliface/3.x/mlstub.cmi : parser/ast.cmo
ocamliface/4.01/mltypes.cmo : types/ident.cmo ocamliface/4.01/config.cmo \
parser/cduce_loc.cmi ocamliface/4.01/mltypes.cmi
ocamliface/4.01/mltypes.cmx : types/ident.cmx ocamliface/4.01/config.cmx \
parser/cduce_loc.cmx ocamliface/4.01/mltypes.cmi
ocamliface/4.01/caml_cduce.cmo :
ocamliface/4.01/caml_cduce.cmx :
ocamliface/4.01/mltypes.cmo : types/ident.cmo parser/cduce_loc.cmi \
ocamliface/4.01/caml_cduce.cmo ocamliface/4.01/mltypes.cmi
ocamliface/4.01/mltypes.cmx : types/ident.cmx parser/cduce_loc.cmx \
ocamliface/4.01/caml_cduce.cmx ocamliface/4.01/mltypes.cmi
ocamliface/4.01/mlstub.cmo : types/types.cmi typing/typer.cmi \
types/sequence.cmi misc/ns.cmi ocamliface/4.01/mltypes.cmi \
driver/librarian.cmi types/ident.cmo types/externals.cmi \
compile/compile.cmi parser/cduce_loc.cmi driver/cduce_config.cmi \
types/builtin_defs.cmi types/atoms.cmi parser/ast.cmo \
ocamliface/4.01/mlstub.cmi
ocamliface/4.01/caml_cduce.cmo types/builtin_defs.cmi types/atoms.cmi \
parser/ast.cmo ocamliface/4.01/mlstub.cmi
ocamliface/4.01/mlstub.cmx : types/types.cmx typing/typer.cmx \
types/sequence.cmx misc/ns.cmx ocamliface/4.01/mltypes.cmx \
driver/librarian.cmx types/ident.cmx types/externals.cmx \
compile/compile.cmx parser/cduce_loc.cmx driver/cduce_config.cmx \
types/builtin_defs.cmx types/atoms.cmx parser/ast.cmx \
ocamliface/4.01/mlstub.cmi
ocamliface/4.01/mltypes.cmi : types/types.cmi types/ident.cmo
ocamliface/4.01/caml_cduce.cmx types/builtin_defs.cmx types/atoms.cmx \
parser/ast.cmx ocamliface/4.01/mlstub.cmi
ocamliface/4.01/mltypes.cmi : types/types.cmi types/ident.cmo \
ocamliface/4.01/caml_cduce.cmo
ocamliface/4.01/mlstub.cmi : parser/ast.cmo
ocamliface/4.02/mltypes.cmo : types/ident.cmo ocamliface/4.02/config.cmo \
parser/cduce_loc.cmi ocamliface/4.02/mltypes.cmi
ocamliface/4.02/mltypes.cmx : types/ident.cmx ocamliface/4.02/config.cmx \
parser/cduce_loc.cmx ocamliface/4.02/mltypes.cmi
ocamliface/4.02/caml_cduce.cmo :
ocamliface/4.02/caml_cduce.cmx :
ocamliface/4.02/mltypes.cmo : types/ident.cmo parser/cduce_loc.cmi \
ocamliface/4.02/caml_cduce.cmo ocamliface/4.02/mltypes.cmi
ocamliface/4.02/mltypes.cmx : types/ident.cmx parser/cduce_loc.cmx \
ocamliface/4.02/caml_cduce.cmx ocamliface/4.02/mltypes.cmi
ocamliface/4.02/mlstub.cmo : types/types.cmi typing/typer.cmi \
types/sequence.cmi misc/ns.cmi ocamliface/4.02/mltypes.cmi \
driver/librarian.cmi types/ident.cmo types/externals.cmi \
compile/compile.cmi parser/cduce_loc.cmi driver/cduce_config.cmi \
types/builtin_defs.cmi types/atoms.cmi parser/ast.cmo \
ocamliface/4.02/mlstub.cmi
ocamliface/4.02/caml_cduce.cmo types/builtin_defs.cmi types/atoms.cmi \
parser/ast.cmo ocamliface/4.02/mlstub.cmi
ocamliface/4.02/mlstub.cmx : types/types.cmx typing/typer.cmx \
types/sequence.cmx misc/ns.cmx ocamliface/4.02/mltypes.cmx \
driver/librarian.cmx types/ident.cmx types/externals.cmx \
compile/compile.cmx parser/cduce_loc.cmx driver/cduce_config.cmx \
types/builtin_defs.cmx types/atoms.cmx parser/ast.cmx \
ocamliface/4.02/mlstub.cmi
ocamliface/4.02/mltypes.cmi : types/types.cmi types/ident.cmo
ocamliface/4.02/caml_cduce.cmx types/builtin_defs.cmx types/atoms.cmx \
parser/ast.cmx ocamliface/4.02/mlstub.cmi
ocamliface/4.02/mltypes.cmi : types/types.cmi types/ident.cmo \
ocamliface/4.02/caml_cduce.cmo
ocamliface/4.02/mlstub.cmi : parser/ast.cmo
......@@ -3,6 +3,8 @@
# of an OCaml source tree.
include ../../Makefile.conf
OCAMLFILES=ocaml_files.$(MODE)
all: caml_cduce.cmo caml_cduce.cmx
STDLIB=$(shell ocamlc -where)
......@@ -16,29 +18,31 @@ else
FORPACKOPT2=
endif
ocaml_files:
mkdir ocaml_files
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) ocaml_files/
cp location.ml ocaml_files/location.ml
cp ocaml_files/asttypes.mli ocaml_files/asttypes.ml
sed s=STDLIB=$(STDLIB)= config.ml > ocaml_files/config.ml
grep cmi_magic $(OCAML_SRC)/utils/config.mlp >> ocaml_files/config.ml
caml_cduce.cmo: ocaml_files
$(OCAMLFILES):
test -d $(OCAMLFILES) || mkdir $(OCAMLFILES)
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) $(OCAMLFILES)/
cp location.ml $(OCAMLFILES)/location.ml
cp $(OCAMLFILES)/asttypes.mli $(OCAMLFILES)/asttypes.ml
sed s=STDLIB=$(STDLIB)= config.mlp > $(OCAMLFILES)/config.ml
grep cmi_magic $(OCAML_SRC)/utils/config.mlp >> $(OCAMLFILES)/config.ml
caml_cduce.cmo: ocaml_files.byte
@echo "Build $@"
(cd ocaml_files; \
ocamlc $(FORPACKOPT1) -c $(COMPILE_FILES);\
ocamlc $(FORPACKOPT2) -pack -o $@ $(OBJECTS); \
cp caml_cduce.cmo caml_cduce.cmi ..)
(cd ocaml_files.byte; \
ocamlc $(FORPACKOPT1) -c $(COMPILE_FILES); \
ocamlc $(FORPACKOPT2) -pack -o $@ $(OBJECTS); \
cp caml_cduce.cmo caml_cduce.cmi ..)
caml_cduce.cmx: ocaml_files
caml_cduce.cmx: ocaml_files.opt
@echo "Build $@"
(cd ocaml_files; ocamlopt $(FORPACKOPT1) -c $(COMPILE_FILES);\
ocamlopt $(FORPACKOPT2) -pack -o $@ $(XOBJECTS); \
cp caml_cduce.cmx caml_cduce.o caml_cduce.cmi ..)
(cd ocaml_files.opt; \
ocamlopt $(FORPACKOPT1) -c $(COMPILE_FILES); \
ocamlopt $(FORPACKOPT2) -pack -o $@ $(XOBJECTS); \
cp caml_cduce.cmx caml_cduce.o caml_cduce.cmi ..)
clean:
rm -Rf ocaml_files *~ *.cm*
rm -Rf ocaml_files.* *~ *.cm* *.o
COPY_FILES=\
typing/annot.mli \
......
......@@ -3,11 +3,7 @@
# of an OCaml source tree.
include ../../Makefile.conf
ifneq ($(VERBOSE), true)
HIDE=@
else
HIDE=
endif
OCAMLFILES=ocaml_files.$(MODE)
all: caml_cduce.cmo caml_cduce.cmx
......@@ -22,29 +18,30 @@ else
FORPACKOPT2=
endif
ocaml_files:
$(HIDE)test -e ocaml_files || mkdir ocaml_files
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) ocaml_files/
$(HIDE)cp location.ml ocaml_files/location.ml
$(HIDE)cp ocaml_files/asttypes.mli ocaml_files/asttypes.ml
$(HIDE)sed s=STDLIB=$(STDLIB)= config.ml > ocaml_files/config.ml
$(HIDE)grep cmi_magic $(OCAML_SRC)/utils/config.mlp | head -1 >> ocaml_files/config.ml
$(OCAMLFILES):
test -d $(OCAMLFILES) || mkdir $(OCAMLFILES)
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) $(OCAMLFILES)/
cp location.ml $(OCAMLFILES)/location.ml
cp $(OCAMLFILES)/asttypes.mli $(OCAMLFILES)/asttypes.ml
sed s=STDLIB=$(STDLIB)= config.mlp > $(OCAMLFILES)/config.ml
grep cmi_magic $(OCAML_SRC)/utils/config.mlp | head -1 >> $(OCAMLFILES)/config.ml
caml_cduce.cmo: ocaml_files
caml_cduce.cmo: ocaml_files.byte
@echo "Build $@"
$(HIDE)(cd ocaml_files; \
ocamlc $(FORPACKOPT1) -c $(COMPILE_FILES);\
ocamlc $(FORPACKOPT2) -pack -o $@ $(OBJECTS); \
cp caml_cduce.cmo caml_cduce.cmi ..)
(cd ocaml_files.byte; \
ocamlc $(FORPACKOPT1) -c $(COMPILE_FILES); \
ocamlc $(FORPACKOPT2) -pack -o $@ $(OBJECTS); \
cp caml_cduce.cmo caml_cduce.cmi ..)
caml_cduce.cmx: ocaml_files
caml_cduce.cmx: ocaml_files.opt
@echo "Build $@"
$(HIDE)(cd ocaml_files; ocamlopt $(FORPACKOPT1) -c $(COMPILE_FILES);\
ocamlopt $(FORPACKOPT2) -pack -o $@ $(XOBJECTS); \
cp caml_cduce.cmx caml_cduce.o caml_cduce.cmi ..)
(cd ocaml_files.opt; \
ocamlopt $(FORPACKOPT1) -c $(COMPILE_FILES); \
ocamlopt $(FORPACKOPT2) -pack -o $@ $(XOBJECTS); \
cp caml_cduce.cmx caml_cduce.o caml_cduce.cmi ..)
clean:
rm -Rf ocaml_files *~ *.cm*
rm -Rf ocaml_files.* *~ *.cm* *.o
COPY_FILES=\
typing/annot.mli \
......
......@@ -3,6 +3,8 @@
# of an OCaml source tree.
include ../../Makefile.conf
OCAMLFILES=ocaml_files.$(MODE)
all: caml_cduce.cmo caml_cduce.cmx
STDLIB=$(shell ocamlc -where)
......@@ -16,32 +18,34 @@ else
FORPACKOPT2=
endif
ocaml_files:
mkdir ocaml_files
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) ocaml_files/
cp location.ml ocaml_files/location.ml
cp parsetree.ml ocaml_files/parsetree.ml
cp ast_mapper.ml ocaml_files/ast_mapper.ml
cp ocaml_files/asttypes.mli ocaml_files/asttypes.ml
sed s=STDLIB=$(STDLIB)= config.ml > ocaml_files/config.ml
grep cmi_magic $(OCAML_SRC)/utils/config.mlp | head -1 >> ocaml_files/config.ml
caml_cduce.cmo: ocaml_files
$(OCAMLFILES):
test -d $(OCAMLFILES) || mkdir $(OCAMLFILES)
$(HIDE)cp $(patsubst %,$(OCAML_SRC)/%, $(COPY_FILES)) $(OCAMLFILES)/
cp location.ml $(OCAMLFILES)/location.ml
cp parsetree.ml $(OCAMLFILES)/parsetree.ml
cp ast_mapper.ml $(OCAMLFILES)/ast_mapper.ml
cp $(OCAMLFILES)/asttypes.mli $(OCAMLFILES)/asttypes.ml
sed s=STDLIB=$(STDLIB)= config.mlp > $(OCAMLFILES)/config.ml
grep cmi_magic $(OCAML_SRC)/utils/config.mlp | head -1 >> $(OCAMLFILES)/config.ml
caml_cduce.cmo: ocaml_files.byte
@echo "Build $@"
(cd ocaml_files; \
(cd ocaml_files.byte; \
$(CAMLC) $(FORPACKOPT1) -c $(COMPILE_FILES);\
$(CAMLC) $(FORPACKOPT2) -pack -o $@ $(OBJECTS); \
cp caml_cduce.cmo caml_cduce.cmi ..)
caml_cduce.cmx: ocaml_files
caml_cduce.cmx: ocaml_files.opt
@echo "Build $@"
(cd ocaml_files; \
(cd ocaml_files.opt; \
$(CAMLOPT) $(FORPACKOPT1) -c $(COMPILE_FILES);\
$(CAMLOPT) $(FORPACKOPT2) -pack -o $@ $(XOBJECTS); \
cp caml_cduce.cmx caml_cduce.o caml_cduce.cmi ..)
clean:
rm -Rf ocaml_files *~ *.cm*
rm -Rf ocaml_files.* *~ *.cm* *.o
COPY_FILES=\
typing/annot.mli \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment