242 lines
8.8 KiB
Makefile
Executable File
242 lines
8.8 KiB
Makefile
Executable File
#**************************************************************************
|
|
#* *
|
|
#* OCaml *
|
|
#* *
|
|
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
|
|
#* *
|
|
#* Copyright 1999 Institut National de Recherche en Informatique et *
|
|
#* en Automatique. *
|
|
#* *
|
|
#* All rights reserved. This file is distributed under the terms of *
|
|
#* the GNU Lesser General Public License version 2.1, with the *
|
|
#* special exception on linking described in the file LICENSE. *
|
|
#* *
|
|
#**************************************************************************
|
|
|
|
# The main Makefile, fragments shared between Makefile and Makefile.nt
|
|
|
|
include config/Makefile
|
|
CAMLRUN ?= boot/ocamlrun
|
|
CAMLYACC ?= boot/ocamlyacc
|
|
include stdlib/StdlibModules
|
|
|
|
CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot
|
|
CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink
|
|
COMPFLAGS=-strict-sequence -principal -w +33..39+48+50 -warn-error A \
|
|
-bin-annot -safe-string -strict-formats $(INCLUDES)
|
|
LINKFLAGS=
|
|
|
|
YACCFLAGS=-v
|
|
CAMLLEX=$(CAMLRUN) boot/ocamllex
|
|
CAMLDEP=$(CAMLRUN) tools/ocamldep
|
|
DEPFLAGS=$(INCLUDES)
|
|
|
|
OCAMLBUILDBYTE=$(WITH_OCAMLBUILD:=.byte)
|
|
OCAMLBUILDNATIVE=$(WITH_OCAMLBUILD:=.native)
|
|
|
|
OCAMLDOC_OPT=$(WITH_OCAMLDOC:=.opt)
|
|
|
|
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I middle_end \
|
|
-I middle_end/base_types -I asmcomp -I driver -I toplevel
|
|
|
|
UTILS=utils/config.cmo utils/misc.cmo \
|
|
utils/identifiable.cmo utils/numbers.cmo utils/arg_helper.cmo \
|
|
utils/clflags.cmo utils/tbl.cmo utils/timings.cmo \
|
|
utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \
|
|
utils/consistbl.cmo \
|
|
utils/strongly_connected_components.cmo
|
|
|
|
PARSING=parsing/location.cmo parsing/longident.cmo \
|
|
parsing/docstrings.cmo parsing/ast_helper.cmo \
|
|
parsing/syntaxerr.cmo parsing/parser.cmo \
|
|
parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo \
|
|
parsing/pprintast.cmo \
|
|
parsing/ast_mapper.cmo parsing/ast_iterator.cmo parsing/attr_helper.cmo \
|
|
parsing/builtin_attributes.cmo parsing/ast_invariants.cmo
|
|
|
|
TYPING=typing/ident.cmo typing/path.cmo \
|
|
typing/primitive.cmo typing/types.cmo \
|
|
typing/btype.cmo typing/oprint.cmo \
|
|
typing/subst.cmo typing/predef.cmo \
|
|
typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
|
|
typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo \
|
|
typing/printtyp.cmo typing/includeclass.cmo \
|
|
typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo \
|
|
typing/typedtreeIter.cmo typing/typedtreeMap.cmo \
|
|
typing/tast_mapper.cmo \
|
|
typing/cmt_format.cmo typing/untypeast.cmo \
|
|
typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
|
|
typing/stypes.cmo typing/typecore.cmo \
|
|
typing/typedecl.cmo typing/typeclass.cmo \
|
|
typing/typemod.cmo
|
|
|
|
COMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \
|
|
bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo \
|
|
bytecomp/translobj.cmo bytecomp/translattribute.cmo \
|
|
bytecomp/translcore.cmo \
|
|
bytecomp/translclass.cmo bytecomp/translmod.cmo \
|
|
bytecomp/simplif.cmo bytecomp/runtimedef.cmo \
|
|
bytecomp/debuginfo.cmo \
|
|
driver/pparse.cmo driver/main_args.cmo \
|
|
driver/compenv.cmo driver/compmisc.cmo
|
|
|
|
COMMON=$(UTILS) $(PARSING) $(TYPING) $(COMP)
|
|
|
|
BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \
|
|
bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
|
|
bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \
|
|
bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo \
|
|
driver/errors.cmo driver/compile.cmo
|
|
|
|
INTEL_ASM=\
|
|
asmcomp/x86_proc.cmo \
|
|
asmcomp/x86_dsl.cmo \
|
|
asmcomp/x86_gas.cmo \
|
|
asmcomp/x86_masm.cmo
|
|
|
|
ARCH_SPECIFIC_ASMCOMP=
|
|
ifeq ($(ARCH),i386)
|
|
ARCH_SPECIFIC_ASMCOMP=$(INTEL_ASM)
|
|
endif
|
|
ifeq ($(ARCH),amd64)
|
|
ARCH_SPECIFIC_ASMCOMP=$(INTEL_ASM)
|
|
endif
|
|
|
|
ASMCOMP=\
|
|
$(ARCH_SPECIFIC_ASMCOMP) \
|
|
asmcomp/arch.cmo \
|
|
asmcomp/cmm.cmo asmcomp/printcmm.cmo \
|
|
asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
|
|
asmcomp/clambda.cmo asmcomp/printclambda.cmo \
|
|
asmcomp/export_info.cmo \
|
|
asmcomp/export_info_for_pack.cmo \
|
|
asmcomp/compilenv.cmo \
|
|
asmcomp/closure.cmo \
|
|
asmcomp/build_export_info.cmo \
|
|
asmcomp/closure_offsets.cmo \
|
|
asmcomp/flambda_to_clambda.cmo \
|
|
asmcomp/import_approx.cmo \
|
|
asmcomp/un_anf.cmo \
|
|
asmcomp/strmatch.cmo asmcomp/cmmgen.cmo \
|
|
asmcomp/printmach.cmo asmcomp/selectgen.cmo asmcomp/selection.cmo \
|
|
asmcomp/comballoc.cmo \
|
|
asmcomp/CSEgen.cmo asmcomp/CSE.cmo \
|
|
asmcomp/liveness.cmo \
|
|
asmcomp/spill.cmo asmcomp/split.cmo \
|
|
asmcomp/interf.cmo asmcomp/coloring.cmo \
|
|
asmcomp/reloadgen.cmo asmcomp/reload.cmo \
|
|
asmcomp/deadcode.cmo \
|
|
asmcomp/printlinear.cmo asmcomp/linearize.cmo \
|
|
asmcomp/schedgen.cmo asmcomp/scheduling.cmo \
|
|
asmcomp/branch_relaxation_intf.cmo \
|
|
asmcomp/branch_relaxation.cmo \
|
|
asmcomp/emitaux.cmo asmcomp/emit.cmo asmcomp/asmgen.cmo \
|
|
asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo \
|
|
driver/opterrors.cmo driver/optcompile.cmo
|
|
|
|
MIDDLE_END=\
|
|
middle_end/base_types/tag.cmo \
|
|
middle_end/base_types/linkage_name.cmo \
|
|
middle_end/base_types/compilation_unit.cmo \
|
|
middle_end/base_types/variable.cmo \
|
|
middle_end/base_types/mutable_variable.cmo \
|
|
middle_end/base_types/id_types.cmo \
|
|
middle_end/base_types/set_of_closures_id.cmo \
|
|
middle_end/base_types/set_of_closures_origin.cmo \
|
|
middle_end/base_types/closure_element.cmo \
|
|
middle_end/base_types/closure_id.cmo \
|
|
middle_end/base_types/var_within_closure.cmo \
|
|
middle_end/base_types/static_exception.cmo \
|
|
middle_end/base_types/export_id.cmo \
|
|
middle_end/base_types/symbol.cmo \
|
|
middle_end/pass_wrapper.cmo \
|
|
middle_end/semantics_of_primitives.cmo \
|
|
middle_end/allocated_const.cmo \
|
|
middle_end/projection.cmo \
|
|
middle_end/flambda.cmo \
|
|
middle_end/flambda_iterators.cmo \
|
|
middle_end/flambda_utils.cmo \
|
|
middle_end/inlining_cost.cmo \
|
|
middle_end/effect_analysis.cmo \
|
|
middle_end/freshening.cmo \
|
|
middle_end/simple_value_approx.cmo \
|
|
middle_end/lift_code.cmo \
|
|
middle_end/closure_conversion_aux.cmo \
|
|
middle_end/closure_conversion.cmo \
|
|
middle_end/initialize_symbol_to_let_symbol.cmo \
|
|
middle_end/lift_let_to_initialize_symbol.cmo \
|
|
middle_end/find_recursive_functions.cmo \
|
|
middle_end/invariant_params.cmo \
|
|
middle_end/inconstant_idents.cmo \
|
|
middle_end/alias_analysis.cmo \
|
|
middle_end/lift_constants.cmo \
|
|
middle_end/share_constants.cmo \
|
|
middle_end/simplify_common.cmo \
|
|
middle_end/remove_unused_arguments.cmo \
|
|
middle_end/remove_unused_closure_vars.cmo \
|
|
middle_end/remove_unused_program_constructs.cmo \
|
|
middle_end/simplify_boxed_integer_ops.cmo \
|
|
middle_end/simplify_primitives.cmo \
|
|
middle_end/inlining_stats_types.cmo \
|
|
middle_end/inlining_stats.cmo \
|
|
middle_end/inline_and_simplify_aux.cmo \
|
|
middle_end/remove_free_vars_equal_to_args.cmo \
|
|
middle_end/extract_projections.cmo \
|
|
middle_end/augment_specialised_args.cmo \
|
|
middle_end/unbox_free_vars_of_closures.cmo \
|
|
middle_end/unbox_specialised_args.cmo \
|
|
middle_end/unbox_closures.cmo \
|
|
middle_end/inlining_transforms.cmo \
|
|
middle_end/inlining_decision.cmo \
|
|
middle_end/inline_and_simplify.cmo \
|
|
middle_end/ref_to_variables.cmo \
|
|
middle_end/flambda_invariants.cmo \
|
|
middle_end/middle_end.cmo
|
|
|
|
TOPLEVEL=toplevel/genprintval.cmo toplevel/toploop.cmo \
|
|
toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
|
|
|
|
OPTTOPLEVEL=toplevel/genprintval.cmo toplevel/opttoploop.cmo \
|
|
toplevel/opttopdirs.cmo toplevel/opttopmain.cmo
|
|
BYTESTART=driver/main.cmo
|
|
|
|
OPTSTART=driver/optmain.cmo
|
|
|
|
TOPLEVELSTART=toplevel/topstart.cmo
|
|
|
|
OPTTOPLEVELSTART=toplevel/opttopstart.cmo
|
|
|
|
PERVASIVES=$(STDLIB_MODULES) outcometree topdirs toploop
|
|
|
|
|
|
# The middle end (whose .cma library is currently only used for linking
|
|
# the "objinfo" program, since we cannot depend on the whole native code
|
|
# compiler for "make world" and the list of dependencies for
|
|
# asmcomp/export_info.cmo is long).
|
|
|
|
compilerlibs/ocamlmiddleend.cma: $(MIDDLE_END)
|
|
$(CAMLC) -a -o $@ $(MIDDLE_END)
|
|
partialclean::
|
|
rm -f compilerlibs/ocamlmiddleend.cma
|
|
|
|
|
|
# Tools
|
|
|
|
ocamltools: ocamlc ocamlyacc ocamllex asmcomp/cmx_format.cmi \
|
|
asmcomp/printclambda.cmo compilerlibs/ocamlmiddleend.cma \
|
|
asmcomp/export_info.cmo
|
|
cd tools ; $(MAKEREC) all
|
|
|
|
ocamltoolsopt: ocamlopt
|
|
cd tools; $(MAKEREC) opt
|
|
|
|
ocamltoolsopt.opt: ocamlc.opt ocamlyacc ocamllex asmcomp/cmx_format.cmi \
|
|
asmcomp/printclambda.cmx
|
|
cd tools; $(MAKEREC) opt.opt
|
|
|
|
partialclean::
|
|
cd tools; $(MAKEREC) clean
|
|
|
|
alldepend::
|
|
cd tools; $(MAKEREC) depend
|