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

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