| 1 |
#************************************************************************** |
| 2 |
#* * |
| 3 |
#* OCaml * |
| 4 |
#* * |
| 5 |
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt * |
| 6 |
#* * |
| 7 |
#* Copyright 1999 Institut National de Recherche en Informatique et * |
| 8 |
#* en Automatique. * |
| 9 |
#* * |
| 10 |
#* All rights reserved. This file is distributed under the terms of * |
| 11 |
#* the GNU Lesser General Public License version 2.1, with the * |
| 12 |
#* special exception on linking described in the file LICENSE. * |
| 13 |
#* * |
| 14 |
#************************************************************************** |
| 15 |
|
| 16 |
# The main Makefile |
| 17 |
|
| 18 |
ROOTDIR = . |
| 19 |
# NOTE: it is important that the OCAMLDEP and OCAMLLEX variables |
| 20 |
# are defined *before* Makefile.common gets included, so that |
| 21 |
# their local definitions here take precedence over their |
| 22 |
# general shared definitions in Makefile.common. |
| 23 |
OCAMLLEX ?= $(BOOT_OCAMLLEX) |
| 24 |
include Makefile.common |
| 25 |
include Makefile.best_binaries |
| 26 |
|
| 27 |
.PHONY: defaultentry |
| 28 |
defaultentry: $(DEFAULT_BUILD_TARGET) |
| 29 |
|
| 30 |
include stdlib/StdlibModules |
| 31 |
|
| 32 |
CAMLC = $(BOOT_OCAMLC) $(BOOT_STDLIBFLAGS) -use-prims runtime/primitives |
| 33 |
CAMLOPT=$(OCAMLRUN) ./ocamlopt$(EXE) $(STDLIBFLAGS) -I otherlibs/dynlink |
| 34 |
ARCHES=amd64 arm64 power s390x riscv |
| 35 |
VPATH = utils parsing typing bytecomp file_formats lambda middle_end \ |
| 36 |
middle_end/closure middle_end/flambda middle_end/flambda/base_types \ |
| 37 |
asmcomp driver toplevel tools runtime \ |
| 38 |
$(addprefix otherlibs/, $(ALL_OTHERLIBS)) |
| 39 |
INCLUDES = $(addprefix -I ,$(VPATH)) |
| 40 |
|
| 41 |
ifeq "$(strip $(NATDYNLINKOPTS))" "" |
| 42 |
OCAML_NATDYNLINKOPTS= |
| 43 |
else |
| 44 |
OCAML_NATDYNLINKOPTS = -ccopt "$(NATDYNLINKOPTS)" |
| 45 |
endif |
| 46 |
|
| 47 |
OC_OCAMLDEPDIRS = $(VPATH) |
| 48 |
|
| 49 |
# This list is passed to expunge, which accepts both uncapitalized and |
| 50 |
# capitalized module names. |
| 51 |
PERVASIVES=$(STDLIB_MODULES) outcometree topprinters topdirs toploop |
| 52 |
|
| 53 |
LIBFILES=stdlib.cma std_exit.cmo *.cmi $(HEADER_NAME) |
| 54 |
|
| 55 |
COMPLIBDIR=$(LIBDIR)/compiler-libs |
| 56 |
|
| 57 |
TOPINCLUDES=$(addprefix -I otherlibs/,$(filter-out %threads,$(OTHERLIBRARIES))) |
| 58 |
|
| 59 |
expunge := expunge$(EXE) |
| 60 |
|
| 61 |
# Targets and dependencies for the compilerlibs/*.{cma,cmxa} archives |
| 62 |
|
| 63 |
utils_SOURCES = $(addprefix utils/, \ |
| 64 |
config.mli config.ml \ |
| 65 |
build_path_prefix_map.mli build_path_prefix_map.ml \ |
| 66 |
format_doc.mli format_doc.ml \ |
| 67 |
misc.mli misc.ml \ |
| 68 |
identifiable.mli identifiable.ml \ |
| 69 |
numbers.mli numbers.ml \ |
| 70 |
arg_helper.mli arg_helper.ml \ |
| 71 |
local_store.mli local_store.ml \ |
| 72 |
load_path.mli load_path.ml \ |
| 73 |
clflags.mli clflags.ml \ |
| 74 |
profile.mli profile.ml \ |
| 75 |
terminfo.mli terminfo.ml \ |
| 76 |
ccomp.mli ccomp.ml \ |
| 77 |
warnings.mli warnings.ml \ |
| 78 |
consistbl.mli consistbl.ml \ |
| 79 |
linkdeps.mli linkdeps.ml \ |
| 80 |
strongly_connected_components.mli strongly_connected_components.ml \ |
| 81 |
targetint.mli targetint.ml \ |
| 82 |
int_replace_polymorphic_compare.mli int_replace_polymorphic_compare.ml \ |
| 83 |
domainstate.mli domainstate.ml \ |
| 84 |
binutils.mli binutils.ml \ |
| 85 |
lazy_backtrack.mli lazy_backtrack.ml \ |
| 86 |
diffing.mli diffing.ml \ |
| 87 |
diffing_with_keys.mli diffing_with_keys.ml \ |
| 88 |
compression.mli compression.ml) |
| 89 |
|
| 90 |
parsing_SOURCES = $(addprefix parsing/, \ |
| 91 |
location.mli location.ml \ |
| 92 |
unit_info.mli unit_info.ml \ |
| 93 |
asttypes.mli asttypes.ml \ |
| 94 |
longident.mli longident.ml \ |
| 95 |
parsetree.mli \ |
| 96 |
docstrings.mli docstrings.ml \ |
| 97 |
syntaxerr.mli syntaxerr.ml \ |
| 98 |
ast_helper.mli ast_helper.ml \ |
| 99 |
ast_iterator.mli ast_iterator.ml \ |
| 100 |
builtin_attributes.mli builtin_attributes.ml \ |
| 101 |
camlinternalMenhirLib.mli camlinternalMenhirLib.ml \ |
| 102 |
parser.mly \ |
| 103 |
lexer.mll \ |
| 104 |
pprintast.mli pprintast.ml \ |
| 105 |
parse.mli parse.ml \ |
| 106 |
printast.mli printast.ml \ |
| 107 |
ast_mapper.mli ast_mapper.ml \ |
| 108 |
attr_helper.mli attr_helper.ml \ |
| 109 |
ast_invariants.mli ast_invariants.ml \ |
| 110 |
depend.mli depend.ml) |
| 111 |
|
| 112 |
typing_SOURCES = \ |
| 113 |
typing/annot.mli \ |
| 114 |
typing/value_rec_types.mli \ |
| 115 |
typing/ident.mli typing/ident.ml \ |
| 116 |
typing/path.mli typing/path.ml \ |
| 117 |
typing/primitive.mli typing/primitive.ml \ |
| 118 |
typing/type_immediacy.mli typing/type_immediacy.ml \ |
| 119 |
typing/outcometree.mli \ |
| 120 |
typing/shape.mli typing/shape.ml \ |
| 121 |
typing/types.mli typing/types.ml \ |
| 122 |
typing/data_types.mli typing/data_types.ml \ |
| 123 |
typing/rawprinttyp.mli typing/rawprinttyp.ml \ |
| 124 |
typing/gprinttyp.mli typing/gprinttyp.ml \ |
| 125 |
typing/btype.mli typing/btype.ml \ |
| 126 |
typing/oprint.mli typing/oprint.ml \ |
| 127 |
typing/subst.mli typing/subst.ml \ |
| 128 |
typing/predef.mli typing/predef.ml \ |
| 129 |
typing/datarepr.mli typing/datarepr.ml \ |
| 130 |
file_formats/cmi_format.mli file_formats/cmi_format.ml \ |
| 131 |
typing/persistent_env.mli typing/persistent_env.ml \ |
| 132 |
typing/env.mli typing/env.ml \ |
| 133 |
typing/errortrace.mli typing/errortrace.ml \ |
| 134 |
typing/typedtree.mli typing/typedtree.ml \ |
| 135 |
typing/signature_group.mli typing/signature_group.ml \ |
| 136 |
typing/printtyped.mli typing/printtyped.ml \ |
| 137 |
typing/ctype.mli typing/ctype.ml \ |
| 138 |
typing/out_type.mli typing/out_type.ml \ |
| 139 |
typing/printtyp.mli typing/printtyp.ml \ |
| 140 |
typing/errortrace_report.mli typing/errortrace_report.ml \ |
| 141 |
typing/includeclass.mli typing/includeclass.ml \ |
| 142 |
typing/mtype.mli typing/mtype.ml \ |
| 143 |
typing/envaux.mli typing/envaux.ml \ |
| 144 |
typing/includecore.mli typing/includecore.ml \ |
| 145 |
typing/tast_iterator.mli typing/tast_iterator.ml \ |
| 146 |
typing/tast_mapper.mli typing/tast_mapper.ml \ |
| 147 |
typing/stypes.mli typing/stypes.ml \ |
| 148 |
typing/shape_reduce.mli typing/shape_reduce.ml \ |
| 149 |
file_formats/cmt_format.mli file_formats/cmt_format.ml \ |
| 150 |
typing/cmt2annot.mli typing/cmt2annot.ml \ |
| 151 |
typing/untypeast.mli typing/untypeast.ml \ |
| 152 |
typing/includemod.mli typing/includemod.ml \ |
| 153 |
typing/includemod_errorprinter.mli typing/includemod_errorprinter.ml \ |
| 154 |
typing/typetexp.mli typing/typetexp.ml \ |
| 155 |
typing/printpat.mli typing/printpat.ml \ |
| 156 |
typing/patterns.mli typing/patterns.ml \ |
| 157 |
typing/parmatch.mli typing/parmatch.ml \ |
| 158 |
typing/typedecl_properties.mli typing/typedecl_properties.ml \ |
| 159 |
typing/typedecl_variance.mli typing/typedecl_variance.ml \ |
| 160 |
typing/typedecl_unboxed.mli typing/typedecl_unboxed.ml \ |
| 161 |
typing/typedecl_immediacy.mli typing/typedecl_immediacy.ml \ |
| 162 |
typing/typedecl_separability.mli typing/typedecl_separability.ml \ |
| 163 |
typing/typeopt.mli typing/typeopt.ml \ |
| 164 |
typing/typedecl.mli typing/typedecl.ml \ |
| 165 |
typing/value_rec_check.mli typing/value_rec_check.ml \ |
| 166 |
typing/typecore.mli typing/typecore.ml \ |
| 167 |
typing/typeclass.mli typing/typeclass.ml \ |
| 168 |
typing/typemod.mli typing/typemod.ml |
| 169 |
|
| 170 |
lambda_SOURCES = $(addprefix lambda/, \ |
| 171 |
debuginfo.mli debuginfo.ml \ |
| 172 |
lambda.mli lambda.ml \ |
| 173 |
printlambda.mli printlambda.ml \ |
| 174 |
switch.mli switch.ml \ |
| 175 |
matching.mli matching.ml \ |
| 176 |
value_rec_compiler.mli value_rec_compiler.ml \ |
| 177 |
translobj.mli translobj.ml \ |
| 178 |
translattribute.mli translattribute.ml \ |
| 179 |
translprim.mli translprim.ml \ |
| 180 |
translcore.mli translcore.ml \ |
| 181 |
translclass.mli translclass.ml \ |
| 182 |
translmod.mli translmod.ml \ |
| 183 |
tmc.mli tmc.ml \ |
| 184 |
simplif.mli simplif.ml \ |
| 185 |
runtimedef.mli runtimedef.ml) |
| 186 |
|
| 187 |
comp_SOURCES = \ |
| 188 |
file_formats/cmo_format.mli \ |
| 189 |
file_formats/cmx_format.mli \ |
| 190 |
file_formats/cmxs_format.mli \ |
| 191 |
bytecomp/meta.mli bytecomp/meta.ml \ |
| 192 |
bytecomp/opcodes.mli bytecomp/opcodes.ml \ |
| 193 |
bytecomp/bytesections.mli bytecomp/bytesections.ml \ |
| 194 |
bytecomp/dll.mli bytecomp/dll.ml \ |
| 195 |
bytecomp/symtable.mli bytecomp/symtable.ml \ |
| 196 |
driver/pparse.mli driver/pparse.ml \ |
| 197 |
driver/compenv.mli driver/compenv.ml \ |
| 198 |
driver/main_args.mli driver/main_args.ml \ |
| 199 |
driver/compmisc.mli driver/compmisc.ml \ |
| 200 |
driver/makedepend.mli driver/makedepend.ml \ |
| 201 |
driver/compile_common.mli driver/compile_common.ml |
| 202 |
# All file format descriptions (including cmx{,s}) are in the |
| 203 |
# ocamlcommon library so that ocamlobjinfo can depend on them. |
| 204 |
|
| 205 |
ocamlcommon_SOURCES = \ |
| 206 |
$(utils_SOURCES) $(parsing_SOURCES) $(typing_SOURCES) \ |
| 207 |
$(lambda_SOURCES) $(comp_SOURCES) |
| 208 |
|
| 209 |
ocamlbytecomp_SOURCES = \ |
| 210 |
bytecomp/instruct.mli bytecomp/instruct.ml \ |
| 211 |
bytecomp/bytegen.mli bytecomp/bytegen.ml \ |
| 212 |
bytecomp/printinstr.mli bytecomp/printinstr.ml \ |
| 213 |
bytecomp/emitcode.mli bytecomp/emitcode.ml \ |
| 214 |
bytecomp/bytelink.mli bytecomp/bytelink.ml \ |
| 215 |
bytecomp/bytelibrarian.mli bytecomp/bytelibrarian.ml \ |
| 216 |
bytecomp/bytepackager.mli bytecomp/bytepackager.ml \ |
| 217 |
driver/errors.mli driver/errors.ml \ |
| 218 |
driver/compile.mli driver/compile.ml \ |
| 219 |
driver/maindriver.mli driver/maindriver.ml |
| 220 |
|
| 221 |
intel_SOURCES = \ |
| 222 |
x86_ast.mli \ |
| 223 |
x86_proc.mli x86_proc.ml \ |
| 224 |
x86_dsl.mli x86_dsl.ml \ |
| 225 |
x86_gas.mli x86_gas.ml \ |
| 226 |
x86_masm.mli x86_masm.ml |
| 227 |
|
| 228 |
asmcomp_SOURCES = \ |
| 229 |
$(addprefix asmcomp/, $(arch_specific_SOURCES)) \ |
| 230 |
asmcomp/arch.mli asmcomp/arch.ml \ |
| 231 |
asmcomp/cmm.mli asmcomp/cmm.ml \ |
| 232 |
asmcomp/printcmm.mli asmcomp/printcmm.ml \ |
| 233 |
asmcomp/reg.mli asmcomp/reg.ml \ |
| 234 |
asmcomp/mach.mli asmcomp/mach.ml \ |
| 235 |
asmcomp/proc.mli asmcomp/proc.ml \ |
| 236 |
asmcomp/strmatch.mli asmcomp/strmatch.ml \ |
| 237 |
asmcomp/cmmgen_state.mli asmcomp/cmmgen_state.ml \ |
| 238 |
asmcomp/cmm_helpers.mli asmcomp/cmm_helpers.ml \ |
| 239 |
asmcomp/afl_instrument.mli asmcomp/afl_instrument.ml \ |
| 240 |
asmcomp/thread_sanitizer.mli asmcomp/thread_sanitizer.ml \ |
| 241 |
asmcomp/cmmgen.mli asmcomp/cmmgen.ml \ |
| 242 |
asmcomp/cmm_invariants.mli asmcomp/cmm_invariants.ml \ |
| 243 |
asmcomp/interval.mli asmcomp/interval.ml \ |
| 244 |
asmcomp/printmach.mli asmcomp/printmach.ml \ |
| 245 |
asmcomp/dataflow.mli asmcomp/dataflow.ml \ |
| 246 |
asmcomp/polling.mli asmcomp/polling.ml \ |
| 247 |
asmcomp/selectgen.mli asmcomp/selectgen.ml \ |
| 248 |
asmcomp/selection.mli asmcomp/selection.ml \ |
| 249 |
asmcomp/comballoc.mli asmcomp/comballoc.ml \ |
| 250 |
asmcomp/CSEgen.mli asmcomp/CSEgen.ml \ |
| 251 |
asmcomp/CSE.mli asmcomp/CSE.ml \ |
| 252 |
asmcomp/liveness.mli asmcomp/liveness.ml \ |
| 253 |
asmcomp/spill.mli asmcomp/spill.ml \ |
| 254 |
asmcomp/split.mli asmcomp/split.ml \ |
| 255 |
asmcomp/interf.mli asmcomp/interf.ml \ |
| 256 |
asmcomp/coloring.mli asmcomp/coloring.ml \ |
| 257 |
asmcomp/linscan.mli asmcomp/linscan.ml \ |
| 258 |
asmcomp/reloadgen.mli asmcomp/reloadgen.ml \ |
| 259 |
asmcomp/reload.mli asmcomp/reload.ml \ |
| 260 |
asmcomp/deadcode.mli asmcomp/deadcode.ml \ |
| 261 |
asmcomp/stackframegen.mli asmcomp/stackframegen.ml \ |
| 262 |
asmcomp/stackframe.mli asmcomp/stackframe.ml \ |
| 263 |
asmcomp/linear.mli asmcomp/linear.ml \ |
| 264 |
asmcomp/printlinear.mli asmcomp/printlinear.ml \ |
| 265 |
asmcomp/linearize.mli asmcomp/linearize.ml \ |
| 266 |
file_formats/linear_format.mli file_formats/linear_format.ml \ |
| 267 |
asmcomp/schedgen.mli asmcomp/schedgen.ml \ |
| 268 |
asmcomp/scheduling.mli asmcomp/scheduling.ml \ |
| 269 |
asmcomp/branch_relaxation.mli asmcomp/branch_relaxation.ml \ |
| 270 |
asmcomp/emitaux.mli asmcomp/emitaux.ml \ |
| 271 |
asmcomp/emit.mli asmcomp/emit.ml \ |
| 272 |
asmcomp/asmgen.mli asmcomp/asmgen.ml \ |
| 273 |
asmcomp/asmlink.mli asmcomp/asmlink.ml \ |
| 274 |
asmcomp/asmlibrarian.mli asmcomp/asmlibrarian.ml \ |
| 275 |
asmcomp/asmpackager.mli asmcomp/asmpackager.ml \ |
| 276 |
driver/opterrors.mli driver/opterrors.ml \ |
| 277 |
driver/optcompile.mli driver/optcompile.ml \ |
| 278 |
driver/optmaindriver.mli driver/optmaindriver.ml |
| 279 |
|
| 280 |
# Files under middle_end/ are not to reference files under asmcomp/. |
| 281 |
# This ensures that the middle end can be linked (e.g. for objinfo) even when |
| 282 |
# the native code compiler is not present for some particular target. |
| 283 |
|
| 284 |
middle_end_closure_SOURCES = $(addprefix middle_end/closure/, \ |
| 285 |
closure.mli closure.ml \ |
| 286 |
closure_middle_end.mli closure_middle_end.ml) |
| 287 |
|
| 288 |
# Owing to dependencies through [Compilenv], which would be |
| 289 |
# difficult to remove, some of the lower parts of Flambda (anything that is |
| 290 |
# saved in a .cmx file) have to be included in the [MIDDLE_END] stanza, below. |
| 291 |
middle_end_flambda_SOURCES = \ |
| 292 |
$(addprefix middle_end/flambda/, \ |
| 293 |
import_approx.mli import_approx.ml \ |
| 294 |
lift_code.mli lift_code.ml \ |
| 295 |
closure_conversion_aux.mli closure_conversion_aux.ml \ |
| 296 |
closure_conversion.mli closure_conversion.ml \ |
| 297 |
initialize_symbol_to_let_symbol.mli initialize_symbol_to_let_symbol.ml \ |
| 298 |
lift_let_to_initialize_symbol.mli lift_let_to_initialize_symbol.ml \ |
| 299 |
find_recursive_functions.mli find_recursive_functions.ml \ |
| 300 |
invariant_params.mli invariant_params.ml \ |
| 301 |
inconstant_idents.mli inconstant_idents.ml \ |
| 302 |
alias_analysis.mli alias_analysis.ml \ |
| 303 |
lift_constants.mli lift_constants.ml \ |
| 304 |
share_constants.mli share_constants.ml \ |
| 305 |
simplify_common.mli simplify_common.ml \ |
| 306 |
remove_unused_arguments.mli remove_unused_arguments.ml \ |
| 307 |
remove_unused_closure_vars.mli remove_unused_closure_vars.ml \ |
| 308 |
remove_unused_program_constructs.mli remove_unused_program_constructs.ml \ |
| 309 |
simplify_boxed_integer_ops.mli simplify_boxed_integer_ops.ml \ |
| 310 |
simplify_primitives.mli simplify_primitives.ml \ |
| 311 |
inlining_stats_types.mli inlining_stats_types.ml \ |
| 312 |
inlining_stats.mli inlining_stats.ml \ |
| 313 |
inline_and_simplify_aux.mli inline_and_simplify_aux.ml \ |
| 314 |
inlining_decision_intf.mli \ |
| 315 |
remove_free_vars_equal_to_args.mli remove_free_vars_equal_to_args.ml \ |
| 316 |
extract_projections.mli extract_projections.ml \ |
| 317 |
augment_specialised_args.mli augment_specialised_args.ml \ |
| 318 |
unbox_free_vars_of_closures.mli unbox_free_vars_of_closures.ml \ |
| 319 |
unbox_specialised_args.mli unbox_specialised_args.ml \ |
| 320 |
unbox_closures.mli unbox_closures.ml \ |
| 321 |
inlining_transforms.mli inlining_transforms.ml \ |
| 322 |
inlining_decision.mli inlining_decision.ml \ |
| 323 |
inline_and_simplify.mli inline_and_simplify.ml \ |
| 324 |
ref_to_variables.mli ref_to_variables.ml \ |
| 325 |
flambda_invariants.mli flambda_invariants.ml \ |
| 326 |
traverse_for_exported_symbols.mli traverse_for_exported_symbols.ml \ |
| 327 |
build_export_info.mli build_export_info.ml \ |
| 328 |
closure_offsets.mli closure_offsets.ml \ |
| 329 |
un_anf.mli un_anf.ml \ |
| 330 |
flambda_to_clambda.mli flambda_to_clambda.ml \ |
| 331 |
flambda_middle_end.mli flambda_middle_end.ml \ |
| 332 |
simplify_boxed_integer_ops_intf.mli) |
| 333 |
|
| 334 |
ocamlmiddleend_SOURCES = \ |
| 335 |
$(addprefix middle_end/, \ |
| 336 |
internal_variable_names.mli internal_variable_names.ml \ |
| 337 |
linkage_name.mli linkage_name.ml \ |
| 338 |
compilation_unit.mli compilation_unit.ml \ |
| 339 |
variable.mli variable.ml \ |
| 340 |
$(addprefix flambda/base_types/, \ |
| 341 |
closure_element.mli closure_element.ml \ |
| 342 |
closure_id.mli closure_id.ml) \ |
| 343 |
symbol.mli symbol.ml \ |
| 344 |
backend_var.mli backend_var.ml \ |
| 345 |
clambda_primitives.mli clambda_primitives.ml \ |
| 346 |
printclambda_primitives.mli printclambda_primitives.ml \ |
| 347 |
clambda.mli clambda.ml \ |
| 348 |
printclambda.mli printclambda.ml \ |
| 349 |
semantics_of_primitives.mli semantics_of_primitives.ml \ |
| 350 |
convert_primitives.mli convert_primitives.ml \ |
| 351 |
$(addprefix flambda/, \ |
| 352 |
$(addprefix base_types/, \ |
| 353 |
id_types.mli id_types.ml \ |
| 354 |
export_id.mli export_id.ml \ |
| 355 |
tag.mli tag.ml \ |
| 356 |
mutable_variable.mli mutable_variable.ml \ |
| 357 |
set_of_closures_id.mli set_of_closures_id.ml \ |
| 358 |
set_of_closures_origin.mli set_of_closures_origin.ml \ |
| 359 |
closure_origin.mli closure_origin.ml \ |
| 360 |
var_within_closure.mli var_within_closure.ml \ |
| 361 |
static_exception.mli static_exception.ml) \ |
| 362 |
pass_wrapper.mli pass_wrapper.ml \ |
| 363 |
allocated_const.mli allocated_const.ml \ |
| 364 |
parameter.mli parameter.ml \ |
| 365 |
projection.mli projection.ml \ |
| 366 |
flambda.mli flambda.ml \ |
| 367 |
flambda_iterators.mli flambda_iterators.ml \ |
| 368 |
flambda_utils.mli flambda_utils.ml \ |
| 369 |
freshening.mli freshening.ml \ |
| 370 |
effect_analysis.mli effect_analysis.ml \ |
| 371 |
inlining_cost.mli inlining_cost.ml \ |
| 372 |
simple_value_approx.mli simple_value_approx.ml \ |
| 373 |
export_info.mli export_info.ml \ |
| 374 |
export_info_for_pack.mli export_info_for_pack.ml) \ |
| 375 |
compilenv.mli compilenv.ml \ |
| 376 |
backend_intf.mli) \ |
| 377 |
$(middle_end_closure_SOURCES) \ |
| 378 |
$(middle_end_flambda_SOURCES) |
| 379 |
|
| 380 |
ocamloptcomp_SOURCES = $(ocamlmiddleend_SOURCES) $(asmcomp_SOURCES) |
| 381 |
|
| 382 |
ocamltoplevel_SOURCES = $(addprefix toplevel/, \ |
| 383 |
genprintval.mli genprintval.ml \ |
| 384 |
topcommon.mli topcommon.ml \ |
| 385 |
native/tophooks.mli native/tophooks.ml \ |
| 386 |
byte/topeval.mli byte/topeval.ml \ |
| 387 |
native/topeval.mli native/topeval.ml \ |
| 388 |
byte/trace.mli byte/trace.ml \ |
| 389 |
native/trace.mli native/trace.ml \ |
| 390 |
toploop.mli toploop.ml \ |
| 391 |
topprinters.mli topprinters.ml \ |
| 392 |
topdirs.mli topdirs.ml \ |
| 393 |
byte/topmain.mli byte/topmain.ml \ |
| 394 |
native/topmain.mli native/topmain.ml) |
| 395 |
|
| 396 |
TOPLEVEL_SHARED_MLIS = topeval.mli trace.mli topmain.mli |
| 397 |
TOPLEVEL_SHARED_CMIS = $(TOPLEVEL_SHARED_MLIS:%.mli=%.cmi) |
| 398 |
TOPLEVEL_SHARED_ARTEFACTS = $(TOPLEVEL_SHARED_MLIS) $(TOPLEVEL_SHARED_CMIS) |
| 399 |
|
| 400 |
$(addprefix toplevel/byte/, $(TOPLEVEL_SHARED_CMIS)):\ |
| 401 |
toplevel/byte/%.cmi: toplevel/%.cmi |
| 402 |
cp $< toplevel/$*.mli $(@D) |
| 403 |
|
| 404 |
$(addprefix toplevel/native/, $(TOPLEVEL_SHARED_CMIS)):\ |
| 405 |
toplevel/native/%.cmi: toplevel/%.cmi |
| 406 |
cp $< toplevel/$*.mli $(@D) |
| 407 |
|
| 408 |
beforedepend:: |
| 409 |
cd toplevel ; cp $(TOPLEVEL_SHARED_MLIS) byte/ |
| 410 |
cd toplevel ; cp $(TOPLEVEL_SHARED_MLIS) native/ |
| 411 |
|
| 412 |
partialclean:: |
| 413 |
cd toplevel/byte ; rm -f $(TOPLEVEL_SHARED_ARTEFACTS) |
| 414 |
cd toplevel/native ; rm -f $(TOPLEVEL_SHARED_ARTEFACTS) |
| 415 |
|
| 416 |
ALL_CONFIG_CMO = utils/config_main.cmo utils/config_boot.cmo |
| 417 |
|
| 418 |
utils/config_%.mli: utils/config.mli |
| 419 |
cp $^ $@ |
| 420 |
|
| 421 |
beforedepend:: utils/config_main.mli utils/config_boot.mli |
| 422 |
|
| 423 |
$(addprefix compilerlibs/ocamlcommon., cma cmxa): \ |
| 424 |
OC_COMMON_LINKFLAGS += -linkall |
| 425 |
|
| 426 |
COMPRESSED_MARSHALING_FLAGS=-cclib -lcomprmarsh \ |
| 427 |
$(patsubst %, -ccopt %, $(filter-out -l%,$(ZSTD_LIBS))) \ |
| 428 |
$(patsubst %, -cclib %, $(filter -l%,$(ZSTD_LIBS))) \ |
| 429 |
|
| 430 |
compilerlibs/ocamlcommon.cmxa: \ |
| 431 |
OC_NATIVE_LINKFLAGS += $(COMPRESSED_MARSHALING_FLAGS) |
| 432 |
|
| 433 |
compilerlibs/ocamlcommon.cmxa: stdlib/libcomprmarsh.$(A) |
| 434 |
|
| 435 |
partialclean:: |
| 436 |
rm -f compilerlibs/ocamlcommon.cma |
| 437 |
|
| 438 |
partialclean:: |
| 439 |
rm -f compilerlibs/ocamlcommon.cmxa \ |
| 440 |
compilerlibs/ocamlcommon.a compilerlibs/ocamlcommon.lib |
| 441 |
|
| 442 |
|
| 443 |
partialclean:: |
| 444 |
rm -f compilerlibs/ocamlbytecomp.cma |
| 445 |
|
| 446 |
partialclean:: |
| 447 |
rm -f compilerlibs/ocamlbytecomp.cmxa \ |
| 448 |
compilerlibs/ocamlbytecomp.a compilerlibs/ocamlbytecomp.lib |
| 449 |
|
| 450 |
|
| 451 |
partialclean:: |
| 452 |
rm -f compilerlibs/ocamlmiddleend.cma \ |
| 453 |
compilerlibs/ocamlmiddleend.cmxa \ |
| 454 |
compilerlibs/ocamlmiddleend.a \ |
| 455 |
compilerlibs/ocamlmiddleend.lib |
| 456 |
|
| 457 |
|
| 458 |
partialclean:: |
| 459 |
rm -f compilerlibs/ocamloptcomp.cma |
| 460 |
|
| 461 |
partialclean:: |
| 462 |
rm -f compilerlibs/ocamloptcomp.cmxa \ |
| 463 |
compilerlibs/ocamloptcomp.a compilerlibs/ocamloptcomp.lib |
| 464 |
|
| 465 |
|
| 466 |
compilerlibs/ocamltoplevel.cma: VPATH += toplevel/byte |
| 467 |
partialclean:: |
| 468 |
rm -f compilerlibs/ocamltoplevel.cma |
| 469 |
|
| 470 |
compilerlibs/ocamltoplevel.cmxa: VPATH += toplevel/native |
| 471 |
partialclean:: |
| 472 |
rm -f compilerlibs/ocamltoplevel.cmxa \ |
| 473 |
compilerlibs/ocamltoplevel.a compilerlibs/ocamltoplevel.lib |
| 474 |
|
| 475 |
# The configuration file |
| 476 |
|
| 477 |
utils/config.ml: \ |
| 478 |
utils/config_$(if $(filter true,$(IN_COREBOOT_CYCLE)),boot,main).ml |
| 479 |
$(V_GEN)cp $< $@ |
| 480 |
utils/config_boot.ml: utils/config.fixed.ml utils/config.common.ml |
| 481 |
$(V_GEN)cat $^ > $@ |
| 482 |
|
| 483 |
utils/config_main.ml: utils/config.generated.ml utils/config.common.ml |
| 484 |
$(V_GEN)cat $^ > $@ |
| 485 |
|
| 486 |
.PHONY: reconfigure |
| 487 |
reconfigure: |
| 488 |
ac_read_git_config=true ./configure $(CONFIGURE_ARGS) |
| 489 |
|
| 490 |
utils/domainstate.ml: utils/domainstate.ml.c runtime/caml/domain_state.tbl |
| 491 |
$(V_GEN)$(CPP) -I runtime/caml $< > $@ |
| 492 |
|
| 493 |
utils/domainstate.mli: utils/domainstate.mli.c runtime/caml/domain_state.tbl |
| 494 |
$(V_GEN)$(CPP) -I runtime/caml $< > $@ |
| 495 |
|
| 496 |
configure: tools/autogen configure.ac aclocal.m4 build-aux/ocaml_version.m4 |
| 497 |
$< |
| 498 |
|
| 499 |
.PHONY: partialclean |
| 500 |
partialclean:: |
| 501 |
rm -f utils/config.ml \ |
| 502 |
utils/config_main.ml utils/config_main.mli \ |
| 503 |
utils/config_boot.ml utils/config_boot.mli \ |
| 504 |
utils/domainstate.ml utils/domainstate.mli |
| 505 |
|
| 506 |
.PHONY: beforedepend |
| 507 |
beforedepend:: \ |
| 508 |
utils/config.ml utils/config_boot.ml utils/config_main.ml \ |
| 509 |
utils/domainstate.ml utils/domainstate.mli |
| 510 |
|
| 511 |
ocamllex_PROGRAMS = $(addprefix lex/,ocamllex ocamllex.opt) |
| 512 |
|
| 513 |
ocamlyacc_PROGRAM = yacc/ocamlyacc |
| 514 |
|
| 515 |
# Tools to be compiled to native and bytecode, then installed |
| 516 |
TOOLS_TO_INSTALL_NAT = ocamldep |
| 517 |
ifeq "$(build_ocamlobjinfo)" "true" |
| 518 |
TOOLS_TO_INSTALL_NAT += ocamlobjinfo |
| 519 |
endif |
| 520 |
|
| 521 |
# Tools to be compiled to bytecode only, then installed |
| 522 |
TOOLS_TO_INSTALL_BYT = \ |
| 523 |
ocamlcmt ocamlprof ocamlcp ocamlmklib ocamlmktop |
| 524 |
|
| 525 |
ifeq "$(NATIVE_COMPILER)" "true" |
| 526 |
TOOLS_TO_INSTALL_BYT += ocamloptp |
| 527 |
endif |
| 528 |
|
| 529 |
# Clean should remove tools/ocamloptp etc. unconditionally because |
| 530 |
# the configuration is not available during clean so we don't |
| 531 |
# know whether they have been configured / built or not |
| 532 |
clean:: |
| 533 |
rm -f $(addprefix tools/ocamlopt,p p.opt p.exe p.opt.exe) \ |
| 534 |
tools/ocamlobjinfo $(addprefix tools/ocamlobjinfo,.opt .exe .opt.exe) |
| 535 |
|
| 536 |
TOOLS_NAT = $(TOOLS_TO_INSTALL_NAT) |
| 537 |
TOOLS_BYT = $(TOOLS_TO_INSTALL_BYT) dumpobj primreq stripdebug cmpbyt |
| 538 |
|
| 539 |
TOOLS_NAT_PROGRAMS = $(addprefix tools/,$(TOOLS_NAT)) |
| 540 |
TOOLS_BYT_PROGRAMS = $(addprefix tools/,$(TOOLS_BYT)) |
| 541 |
|
| 542 |
TOOLS_MODULES = tools/profiling |
| 543 |
|
| 544 |
# C programs |
| 545 |
|
| 546 |
C_PROGRAMS = $(ocamlyacc_PROGRAM) |
| 547 |
|
| 548 |
$(foreach PROGRAM, $(C_PROGRAMS),\ |
| 549 |
$(eval $(call PROGRAM_SYNONYM,$(PROGRAM)))) |
| 550 |
|
| 551 |
# OCaml programs that are compiled in both bytecode and native code |
| 552 |
|
| 553 |
OCAML_PROGRAMS = ocamlc ocamlopt lex/ocamllex $(TOOLS_NAT_PROGRAMS) \ |
| 554 |
ocamldoc/ocamldoc ocamltest/ocamltest |
| 555 |
|
| 556 |
$(foreach PROGRAM, $(OCAML_PROGRAMS),\ |
| 557 |
$(eval $(call OCAML_PROGRAM,$(PROGRAM)))) |
| 558 |
|
| 559 |
# OCaml programs that are compiled only in bytecode |
| 560 |
# Note: the bytecode toplevel, ocaml, is a bytecode program but at the |
| 561 |
# moment it's a special one, because it needs to be expunged, so we |
| 562 |
# cannot declare it as we do for other bytecode-only programs. |
| 563 |
# We have to use dedicated rules to build it |
| 564 |
|
| 565 |
OCAML_BYTECODE_PROGRAMS = expunge \ |
| 566 |
$(TOOLS_BYT_PROGRAMS) \ |
| 567 |
$(addprefix tools/, cvt_emit make_opcodes ocamltex) \ |
| 568 |
$(OPTIONAL_BYTECODE_TOOLS) |
| 569 |
|
| 570 |
$(foreach PROGRAM, $(OCAML_BYTECODE_PROGRAMS),\ |
| 571 |
$(eval $(call OCAML_BYTECODE_PROGRAM,$(PROGRAM)))) |
| 572 |
|
| 573 |
# OCaml programs that are compiled only in native code |
| 574 |
|
| 575 |
OCAML_NATIVE_PROGRAMS = \ |
| 576 |
ocamlnat tools/lintapidiff.opt tools/sync_dynlink.opt $(OPTIONAL_NATIVE_TOOLS) |
| 577 |
|
| 578 |
$(foreach PROGRAM, $(OCAML_NATIVE_PROGRAMS),\ |
| 579 |
$(eval $(call OCAML_NATIVE_PROGRAM,$(PROGRAM)))) |
| 580 |
|
| 581 |
# OCaml libraries that are compiled in both bytecode and native code |
| 582 |
|
| 583 |
# List of compilerlibs |
| 584 |
|
| 585 |
COMPILERLIBS = $(addprefix compilerlibs/, \ |
| 586 |
ocamlbytecomp \ |
| 587 |
ocamlcommon \ |
| 588 |
ocamlmiddleend \ |
| 589 |
ocamloptcomp \ |
| 590 |
ocamltoplevel) |
| 591 |
|
| 592 |
# Since the compiler libraries are necessarily compiled with boot/ocamlc, |
| 593 |
# make sure they *always are*, even when rebuilding a program compiled |
| 594 |
# with ./ocamlc (e.g. ocamltex) |
| 595 |
|
| 596 |
$(COMPILERLIBS:=.cma): \ |
| 597 |
CAMLC = $(BOOT_OCAMLC) $(BOOT_STDLIBFLAGS) -use-prims runtime/primitives |
| 598 |
|
| 599 |
# The following dependency ensures that the two versions of the |
| 600 |
# configuration module (the one for the bootstrap compiler and the |
| 601 |
# one for the compiler to be installed) are compiled. This is to make |
| 602 |
# sure these two versions remain in sync with each other |
| 603 |
|
| 604 |
compilerlibs/ocamlcommon.cma: $(ALL_CONFIG_CMO) |
| 605 |
|
| 606 |
OCAML_LIBRARIES = $(COMPILERLIBS) $(OPTIONAL_LIBRARIES) |
| 607 |
|
| 608 |
$(foreach LIBRARY, $(OCAML_LIBRARIES),\ |
| 609 |
$(eval $(call OCAML_LIBRARY,$(LIBRARY)))) |
| 610 |
|
| 611 |
# OCaml libraries that are compiled only in bytecode |
| 612 |
|
| 613 |
OCAML_BYTECODE_LIBRARIES = |
| 614 |
|
| 615 |
$(foreach LIBRARY, $(OCAML_BYTECODE_LIBRARIES),\ |
| 616 |
$(eval $(call OCAML_BYTECODE_LIBRARY,$(LIBRARY)))) |
| 617 |
|
| 618 |
# OCaml libraries that are compiled only in native code |
| 619 |
|
| 620 |
OCAML_NATIVE_LIBRARIES = |
| 621 |
|
| 622 |
$(foreach LIBRARY, $(OCAML_NATIVE_LIBRARIES),\ |
| 623 |
$(eval $(call OCAML_NATIVE_LIBRARY,$(LIBRARY)))) |
| 624 |
|
| 625 |
USE_RUNTIME_PRIMS = -use-prims ../runtime/primitives |
| 626 |
USE_STDLIB = -nostdlib -I ../stdlib |
| 627 |
|
| 628 |
FLEXDLL_OBJECTS = \ |
| 629 |
flexdll_$(FLEXDLL_CHAIN).$(O) flexdll_initer_$(FLEXDLL_CHAIN).$(O) |
| 630 |
FLEXLINK_BUILD_ENV = \ |
| 631 |
MSVCC_ROOT= \ |
| 632 |
MSVC_DETECT=0 OCAML_CONFIG_FILE=../Makefile.config \ |
| 633 |
CHAINS=$(FLEXDLL_CHAIN) ROOTDIR=.. |
| 634 |
FLEXDLL_SOURCES = \ |
| 635 |
$(addprefix $(FLEXDLL_SOURCE_DIR)/, flexdll.c flexdll_initer.c flexdll.h) \ |
| 636 |
$(wildcard $(FLEXDLL_SOURCE_DIR)/*.ml*) |
| 637 |
|
| 638 |
$(BYTE_BINDIR) $(OPT_BINDIR): |
| 639 |
$(MKDIR) $@ |
| 640 |
|
| 641 |
flexlink.byte$(EXE): $(FLEXDLL_SOURCES) |
| 642 |
rm -f $(FLEXDLL_SOURCE_DIR)/flexlink.exe |
| 643 |
$(MAKE) -C $(FLEXDLL_SOURCE_DIR) $(FLEXLINK_BUILD_ENV) \ |
| 644 |
OCAMLRUN='$$(ROOTDIR)/boot/ocamlrun$(EXE)' NATDYNLINK=false \ |
| 645 |
OCAMLOPT='$(value BOOT_OCAMLC) $(USE_RUNTIME_PRIMS) $(USE_STDLIB)' \ |
| 646 |
flexlink.exe support |
| 647 |
cp $(FLEXDLL_SOURCE_DIR)/flexlink.exe $@ |
| 648 |
cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(ROOTDIR) |
| 649 |
|
| 650 |
partialclean:: |
| 651 |
rm -f flexlink.byte flexlink.byte.exe flexdll_*.o flexdll_*.obj |
| 652 |
|
| 653 |
$(BYTE_BINDIR)/flexlink$(EXE): \ |
| 654 |
boot/ocamlrun$(EXE) flexlink.byte$(EXE) | $(BYTE_BINDIR) |
| 655 |
rm -f $@ |
| 656 |
# Start with a copy to ensure that the result is always executable |
| 657 |
cp boot/ocamlrun$(EXE) $@ |
| 658 |
cat flexlink.byte$(EXE) >> $@ |
| 659 |
|
| 660 |
partialclean:: |
| 661 |
rm -f $(BYTE_BINDIR)/flexlink $(BYTE_BINDIR)/flexlink.exe |
| 662 |
|
| 663 |
ifneq "$(FLEXDLL_SUBMODULE_PRESENT)" "" |
| 664 |
clean:: |
| 665 |
$(MAKE) -C flexdll clean |
| 666 |
endif |
| 667 |
ifneq "$(wildcard flexdll-sources/Makefile)" "" |
| 668 |
clean:: |
| 669 |
$(MAKE) -C flexdll-sources clean |
| 670 |
endif |
| 671 |
|
| 672 |
ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 673 |
# The recipe for runtime/ocamlruns$(EXE) also produces runtime/primitives |
| 674 |
boot/ocamlrun$(EXE): runtime/ocamlruns$(EXE) |
| 675 |
|
| 676 |
$(foreach runtime, ocamlrun$(EXE) ocamlrund$(EXE) ocamlruni$(EXE) \ |
| 677 |
libcamlrun_shared$(EXT_DLL) libasmrun_shared$(EXT_DLL), \ |
| 678 |
$(eval runtime/$(runtime): | $(BYTE_BINDIR)/flexlink$(EXE))) |
| 679 |
|
| 680 |
tools/checkstack$(EXE): | $(BYTE_BINDIR)/flexlink$(EXE) |
| 681 |
else |
| 682 |
boot/ocamlrun$(EXE): runtime/ocamlrun$(EXE) runtime/primitives |
| 683 |
endif |
| 684 |
|
| 685 |
# $< refers to runtime/ocamlruns when bootstrapping flexlink and |
| 686 |
# runtime/ocamlrun otherwise (see above). |
| 687 |
boot/ocamlrun$(EXE): |
| 688 |
cp $< $@ |
| 689 |
|
| 690 |
# Start up the system from the distribution compiler |
| 691 |
.PHONY: coldstart |
| 692 |
coldstart: boot/ocamlrun$(EXE) runtime/libcamlrun.$(A) |
| 693 |
$(MAKE) -C stdlib OCAMLRUN='$$(ROOTDIR)/$<' USE_BOOT_OCAMLC=true all |
| 694 |
rm -f $(addprefix boot/, libcamlrun.$(A) $(LIBFILES)) |
| 695 |
cp $(addprefix stdlib/, $(LIBFILES)) boot |
| 696 |
cd boot; $(LN) ../runtime/libcamlrun.$(A) . |
| 697 |
|
| 698 |
# Recompile the core system using the bootstrap compiler |
| 699 |
.PHONY: coreall |
| 700 |
coreall: runtime |
| 701 |
$(MAKE) ocamlc |
| 702 |
$(MAKE) ocamllex ocamltools library |
| 703 |
|
| 704 |
# Build the core system: the minimum needed to make depend and bootstrap |
| 705 |
.PHONY: core |
| 706 |
core: coldstart |
| 707 |
$(MAKE) coreall |
| 708 |
|
| 709 |
# Check if fixpoint reached |
| 710 |
|
| 711 |
# We use tools/cmpbyt because it has better error reporting, but cmp could also |
| 712 |
# be used. |
| 713 |
CMPCMD ?= $(OCAMLRUN) tools/cmpbyt$(EXE) |
| 714 |
|
| 715 |
.PHONY: compare |
| 716 |
compare: |
| 717 |
# The core system has to be rebuilt after bootstrap anyway, so strip ocamlc |
| 718 |
# and ocamllex, which means the artefacts should be identical. |
| 719 |
mv ocamlc$(EXE) ocamlc.tmp |
| 720 |
$(OCAMLRUN) tools/stripdebug$(EXE) -all ocamlc.tmp ocamlc$(EXE) |
| 721 |
mv lex/ocamllex$(EXE) ocamllex.tmp |
| 722 |
$(OCAMLRUN) tools/stripdebug$(EXE) -all ocamllex.tmp lex/ocamllex$(EXE) |
| 723 |
rm -f ocamllex.tmp ocamlc.tmp |
| 724 |
@if $(CMPCMD) boot/ocamlc ocamlc$(EXE) \ |
| 725 |
&& $(CMPCMD) boot/ocamllex lex/ocamllex$(EXE); \ |
| 726 |
then echo "Fixpoint reached, bootstrap succeeded."; \ |
| 727 |
else \ |
| 728 |
echo "Fixpoint not reached, try one more bootstrapping cycle."; \ |
| 729 |
exit 1; \ |
| 730 |
fi |
| 731 |
|
| 732 |
# Promote a compiler |
| 733 |
|
| 734 |
PROMOTE ?= cp |
| 735 |
|
| 736 |
.PHONY: promote-common |
| 737 |
promote-common: |
| 738 |
$(PROMOTE) ocamlc$(EXE) boot/ocamlc |
| 739 |
$(PROMOTE) lex/ocamllex$(EXE) boot/ocamllex |
| 740 |
cd stdlib; cp $(LIBFILES) ../boot |
| 741 |
|
| 742 |
# Promote the newly compiled system to the rank of cross compiler |
| 743 |
# (Runs on the old runtime, produces code for the new runtime) |
| 744 |
.PHONY: promote-cross |
| 745 |
promote-cross: promote-common |
| 746 |
|
| 747 |
# Promote the newly compiled system to the rank of bootstrap compiler |
| 748 |
# (Runs on the new runtime, produces code for the new runtime) |
| 749 |
.PHONY: promote |
| 750 |
promote: PROMOTE = $(OCAMLRUN) tools/stripdebug$(EXE) -all |
| 751 |
promote: promote-common |
| 752 |
rm -f boot/ocamlrun$(EXE) |
| 753 |
cp runtime/ocamlrun$(EXE) boot/ocamlrun$(EXE) |
| 754 |
|
| 755 |
# Compile the native-code compiler |
| 756 |
.PHONY: opt-core |
| 757 |
opt-core: runtimeopt |
| 758 |
$(MAKE) ocamlopt |
| 759 |
$(MAKE) libraryopt |
| 760 |
|
| 761 |
.PHONY: opt |
| 762 |
opt: checknative |
| 763 |
$(MAKE) runtimeopt |
| 764 |
$(MAKE) ocamlopt |
| 765 |
$(MAKE) libraryopt |
| 766 |
$(MAKE) otherlibrariesopt ocamltoolsopt |
| 767 |
|
| 768 |
# Native-code versions of the tools |
| 769 |
.PHONY: opt.opt |
| 770 |
opt.opt: checknative |
| 771 |
$(MAKE) checkstack |
| 772 |
$(MAKE) coreall |
| 773 |
$(MAKE) ocaml |
| 774 |
$(MAKE) opt-core |
| 775 |
ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 776 |
$(MAKE) flexlink.opt$(EXE) |
| 777 |
endif |
| 778 |
$(MAKE) ocamlc.opt |
| 779 |
# TODO: introduce OPTIONAL_LIBRARIES and OPTIONAL_TOOLS variables to be |
| 780 |
# computed at configure time to keep track of which tools and libraries |
| 781 |
# need to be built |
| 782 |
$(MAKE) otherlibraries $(WITH_DEBUGGER) $(OCAMLDOC_TARGET) \ |
| 783 |
$(OCAMLTEST_TARGET) |
| 784 |
$(MAKE) ocamlopt.opt |
| 785 |
$(MAKE) otherlibrariesopt |
| 786 |
$(MAKE) ocamllex.opt ocamltoolsopt ocamltoolsopt.opt \ |
| 787 |
$(OCAMLDOC_OPT_TARGET) \ |
| 788 |
$(OCAMLTEST_OPT_TARGET) othertools ocamlnat |
| 789 |
ifeq "$(build_libraries_manpages)" "true" |
| 790 |
$(MAKE) manpages |
| 791 |
endif |
| 792 |
|
| 793 |
# Core bootstrapping cycle |
| 794 |
.PHONY: coreboot |
| 795 |
ifeq "$(FLAT_FLOAT_ARRAY)" "true" |
| 796 |
coreboot: |
| 797 |
# Promote the new compiler but keep the old runtime |
| 798 |
# This compiler runs on boot/ocamlrun and produces bytecode for |
| 799 |
# runtime/ocamlrun |
| 800 |
$(MAKE) promote-cross |
| 801 |
# Rebuild ocamlc and ocamllex (run on runtime/ocamlrun) |
| 802 |
# utils/config.ml will have the fixed bootstrap configuration |
| 803 |
$(MAKE) partialclean |
| 804 |
$(MAKE) IN_COREBOOT_CYCLE=true ocamlc ocamllex ocamltools |
| 805 |
# Rebuild the library (using runtime/ocamlrun ./ocamlc) |
| 806 |
$(MAKE) library-cross |
| 807 |
# Promote the new compiler and the new runtime |
| 808 |
$(MAKE) OCAMLRUN=runtime/ocamlrun$(EXE) promote |
| 809 |
# Rebuild the core system |
| 810 |
# utils/config.ml must still have the fixed bootstrap configuration |
| 811 |
$(MAKE) partialclean |
| 812 |
$(MAKE) IN_COREBOOT_CYCLE=true core |
| 813 |
# Check if fixpoint reached |
| 814 |
$(MAKE) compare |
| 815 |
else |
| 816 |
coreboot: |
| 817 |
$(error Cannot bootstrap when configured with \ |
| 818 |
--disable-flat-float-array) |
| 819 |
endif |
| 820 |
|
| 821 |
# Recompile the system using the bootstrap compiler |
| 822 |
|
| 823 |
.PHONY: all |
| 824 |
all: coreall |
| 825 |
$(MAKE) ocaml |
| 826 |
$(MAKE) otherlibraries $(WITH_DEBUGGER) $(OCAMLDOC_TARGET) \ |
| 827 |
$(OCAMLTEST_TARGET) |
| 828 |
$(MAKE) othertools |
| 829 |
ifeq "$(build_libraries_manpages)" "true" |
| 830 |
$(MAKE) manpages |
| 831 |
endif |
| 832 |
|
| 833 |
# Bootstrap and rebuild the whole system. |
| 834 |
# The compilation of ocaml will fail if the runtime has changed. |
| 835 |
# Never mind, just do make bootstrap to reach fixpoint again. |
| 836 |
.PHONY: bootstrap |
| 837 |
bootstrap: coreboot |
| 838 |
# utils/config.ml must be restored to config.status's configuration |
| 839 |
# lex/ocamllex$(EXE) was stripped in order to compare it |
| 840 |
rm -f utils/config.ml lex/ocamllex$(EXE) |
| 841 |
$(MAKE) all |
| 842 |
|
| 843 |
# Compile everything the first time |
| 844 |
|
| 845 |
.PHONY: world |
| 846 |
world: coldstart |
| 847 |
$(MAKE) all |
| 848 |
|
| 849 |
# Compile also native code compiler and libraries, fast |
| 850 |
.PHONY: world.opt |
| 851 |
world.opt: checknative |
| 852 |
$(MAKE) coldstart |
| 853 |
$(MAKE) opt.opt |
| 854 |
|
| 855 |
# FlexDLL sources missing error messages |
| 856 |
# Different git mechanism displayed depending on whether this source tree came |
| 857 |
# from a git clone or a source tarball. |
| 858 |
|
| 859 |
.PHONY: flexdll flexlink flexlink.opt |
| 860 |
|
| 861 |
ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 862 |
|
| 863 |
.PHONY: flexdll |
| 864 |
flexdll: flexdll/Makefile |
| 865 |
@echo WARNING! make flexdll is no longer required |
| 866 |
@echo This target will be removed in a future release. |
| 867 |
|
| 868 |
.PHONY: flexlink |
| 869 |
flexlink: |
| 870 |
@echo Bootstrapping just flexlink.exe is no longer supported |
| 871 |
@echo Bootstrapping FlexDLL is now enabled with |
| 872 |
@echo ./configure --with-flexdll |
| 873 |
@false |
| 874 |
|
| 875 |
ifeq "$(wildcard ocamlopt.opt$(EXE))" "" |
| 876 |
FLEXLINK_OCAMLOPT=../runtime/ocamlrun$(EXE) ../ocamlopt$(EXE) |
| 877 |
else |
| 878 |
FLEXLINK_OCAMLOPT=../ocamlopt.opt$(EXE) |
| 879 |
endif |
| 880 |
|
| 881 |
flexlink.opt$(EXE): \ |
| 882 |
$(FLEXDLL_SOURCES) | $(BYTE_BINDIR)/flexlink$(EXE) $(OPT_BINDIR) |
| 883 |
rm -f $(FLEXDLL_SOURCE_DIR)/flexlink.exe |
| 884 |
$(MAKE) -C $(FLEXDLL_SOURCE_DIR) $(FLEXLINK_BUILD_ENV) \ |
| 885 |
OCAMLOPT='$(FLEXLINK_OCAMLOPT) -nostdlib -I ../stdlib' flexlink.exe |
| 886 |
cp $(FLEXDLL_SOURCE_DIR)/flexlink.exe $@ |
| 887 |
rm -f $(OPT_BINDIR)/flexlink$(EXE) |
| 888 |
cd $(OPT_BINDIR); $(LN) $(call ROOT_FROM, $(OPT_BINDIR))/$@ flexlink$(EXE) |
| 889 |
|
| 890 |
else |
| 891 |
|
| 892 |
flexdll flexlink flexlink.opt: |
| 893 |
@echo It is no longer necessary to bootstrap FlexDLL with a separate |
| 894 |
@echo make invocation. Simply place the sources for FlexDLL in a |
| 895 |
@echo sub-directory. |
| 896 |
@echo This can either be done by downloading a source tarball from |
| 897 |
@echo \ https://github.com/ocaml/flexdll/releases |
| 898 |
@if [ -d .git ]; then \ |
| 899 |
echo or by checking out the flexdll submodule with; \ |
| 900 |
echo \ git submodule update --init; \ |
| 901 |
else \ |
| 902 |
echo or by cloning the git repository; \ |
| 903 |
echo \ git clone https://github.com/ocaml/flexdll.git; \ |
| 904 |
fi |
| 905 |
@echo "Then pass --with-flexdll=<dir> to configure and build as normal." |
| 906 |
@false |
| 907 |
|
| 908 |
endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 909 |
|
| 910 |
partialclean:: |
| 911 |
rm -f flexlink.opt flexlink.opt.exe \ |
| 912 |
$(OPT_BINDIR)/flexlink $(OPT_BINDIR)/flexlink.exe |
| 913 |
|
| 914 |
INSTALL_COMPLIBDIR = $(DESTDIR)$(COMPLIBDIR) |
| 915 |
INSTALL_FLEXDLLDIR = $(INSTALL_LIBDIR)/flexdll |
| 916 |
FLEXDLL_MANIFEST = default$(filter-out _i386,_$(ARCH)).manifest |
| 917 |
|
| 918 |
DOC_FILES=\ |
| 919 |
Changes \ |
| 920 |
README.adoc \ |
| 921 |
README.win32.adoc \ |
| 922 |
LICENSE |
| 923 |
|
| 924 |
# Run all tests |
| 925 |
|
| 926 |
.PHONY: tests |
| 927 |
tests: |
| 928 |
$(MAKE) -C testsuite all |
| 929 |
|
| 930 |
# Make clean in the test suite |
| 931 |
|
| 932 |
.PHONY: clean |
| 933 |
clean:: |
| 934 |
$(MAKE) -C testsuite clean |
| 935 |
|
| 936 |
# Build the manual latex files from the etex source files |
| 937 |
# (see manual/README.md) |
| 938 |
.PHONY: manual-pregen |
| 939 |
manual-pregen: opt.opt |
| 940 |
cd manual; $(MAKE) clean && $(MAKE) pregen-etex |
| 941 |
|
| 942 |
clean:: |
| 943 |
$(MAKE) -C manual clean |
| 944 |
|
| 945 |
# The clean target |
| 946 |
clean:: partialclean |
| 947 |
rm -f configure~ |
| 948 |
rm -f $(C_PROGRAMS) $(C_PROGRAMS:=.exe) |
| 949 |
rm -f $(OCAML_PROGRAMS) $(OCAML_PROGRAMS:=.exe) |
| 950 |
rm -f $(OCAML_PROGRAMS:=.opt) $(OCAML_PROGRAMS:=.opt.exe) |
| 951 |
rm -f $(OCAML_BYTECODE_PROGRAMS) $(OCAML_BYTECODE_PROGRAMS:=.exe) |
| 952 |
rm -f $(OCAML_NATIVE_PROGRAMS) $(OCAML_NATIVE_PROGRAMS:=.exe) |
| 953 |
|
| 954 |
# The bytecode compiler |
| 955 |
|
| 956 |
ocamlc_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 957 |
|
| 958 |
ocamlc_SOURCES = driver/main.mli driver/main.ml |
| 959 |
|
| 960 |
ocamlc$(EXE): OC_BYTECODE_LINKFLAGS += -compat-32 -g |
| 961 |
|
| 962 |
partialclean:: |
| 963 |
rm -f ocamlc ocamlc.exe ocamlc.opt ocamlc.opt.exe |
| 964 |
|
| 965 |
# The native-code compiler |
| 966 |
|
| 967 |
ocamlopt_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamloptcomp) |
| 968 |
|
| 969 |
ocamlopt_SOURCES = driver/optmain.mli driver/optmain.ml |
| 970 |
|
| 971 |
ocamlopt$(EXE): OC_BYTECODE_LINKFLAGS += -g |
| 972 |
|
| 973 |
partialclean:: |
| 974 |
rm -f ocamlopt ocamlopt.exe ocamlopt.opt ocamlopt.opt.exe |
| 975 |
|
| 976 |
# The toplevel |
| 977 |
|
| 978 |
# At the moment, the toplevel can't be built with the general build macros |
| 979 |
# because its build involves calling expunge. We thus give its build |
| 980 |
# rules explicitly until the day expunge can hopefully be removed. |
| 981 |
|
| 982 |
ocaml_LIBRARIES = \ |
| 983 |
$(addprefix compilerlibs/,ocamlcommon ocamlbytecomp ocamltoplevel) |
| 984 |
|
| 985 |
ocaml_CMA_FILES = $(ocaml_LIBRARIES:=.cma) |
| 986 |
|
| 987 |
ocaml_SOURCES = toplevel/topstart.mli toplevel/topstart.ml |
| 988 |
|
| 989 |
ocaml_CMO_FILES = toplevel/topstart.cmo |
| 990 |
|
| 991 |
.INTERMEDIATE: ocaml.tmp |
| 992 |
ocaml.tmp: OC_BYTECODE_LINKFLAGS += -I toplevel/byte -linkall -g |
| 993 |
ocaml.tmp: $(ocaml_CMA_FILES) $(ocaml_CMO_FILES) |
| 994 |
$(V_LINKC)$(LINK_BYTECODE_PROGRAM) -o $@ $^ |
| 995 |
|
| 996 |
$(eval $(call PROGRAM_SYNONYM,ocaml)) |
| 997 |
ocaml$(EXE): $(expunge) ocaml.tmp |
| 998 |
- $(V_GEN)$(OCAMLRUN) $^ $@ $(PERVASIVES) |
| 999 |
|
| 1000 |
partialclean:: |
| 1001 |
rm -f ocaml ocaml.exe |
| 1002 |
|
| 1003 |
# Use TOPFLAGS to pass additional flags to the bytecode or native toplevel |
| 1004 |
# when running make runtop or make natruntop |
| 1005 |
TOPFLAGS ?= |
| 1006 |
OC_TOPFLAGS = $(STDLIBFLAGS) -I toplevel -noinit $(TOPINCLUDES) $(TOPFLAGS) |
| 1007 |
|
| 1008 |
RUN_OCAML = $(RLWRAP) $(OCAMLRUN) ./ocaml$(EXE) $(OC_TOPFLAGS) |
| 1009 |
RUN_OCAMLNAT = $(RLWRAP) ./ocamlnat$(EXE) $(OC_TOPFLAGS) |
| 1010 |
|
| 1011 |
# Note: Beware that, since these rules begin with a coldstart, both |
| 1012 |
# boot/ocamlrun and runtime/ocamlrun will be the same when the toplevel |
| 1013 |
# is run. |
| 1014 |
.PHONY: runtop |
| 1015 |
runtop: coldstart |
| 1016 |
$(MAKE) ocamlc |
| 1017 |
$(MAKE) ocaml |
| 1018 |
@$(RUN_OCAML) |
| 1019 |
|
| 1020 |
.PHONY: runtop-with-otherlibs |
| 1021 |
runtop-with-otherlibs: coldstart |
| 1022 |
$(MAKE) ocamlc |
| 1023 |
$(MAKE) otherlibraries |
| 1024 |
$(MAKE) ocaml |
| 1025 |
@$(RUN_OCAML) |
| 1026 |
|
| 1027 |
.PHONY: natruntop |
| 1028 |
natruntop: |
| 1029 |
$(MAKE) core |
| 1030 |
$(MAKE) opt |
| 1031 |
$(MAKE) ocamlnat |
| 1032 |
@$(RUN_OCAMLNAT) |
| 1033 |
|
| 1034 |
# The dynlink library |
| 1035 |
|
| 1036 |
dynlink_SOURCES = $(addprefix otherlibs/dynlink/,\ |
| 1037 |
dynlink_config.mli dynlink_config.ml \ |
| 1038 |
dynlink_types.mli dynlink_types.ml \ |
| 1039 |
dynlink_platform_intf.mli dynlink_platform_intf.ml \ |
| 1040 |
dynlink_common.mli dynlink_common.ml \ |
| 1041 |
byte/dynlink_symtable.mli byte/dynlink_symtable.ml \ |
| 1042 |
byte/dynlink.mli byte/dynlink.ml \ |
| 1043 |
native/dynlink.mli native/dynlink.ml) |
| 1044 |
|
| 1045 |
dynlink_LIBRARIES = |
| 1046 |
|
| 1047 |
otherlibs/dynlink/%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS) |
| 1048 |
otherlibs/dynlink/%: CAMLOPT = $(BEST_OCAMLOPT) $(STDLIBFLAGS) |
| 1049 |
|
| 1050 |
|
| 1051 |
otherlibs/dynlink/%/dynlink.cmi: \ |
| 1052 |
otherlibs/dynlink/dynlink.cmi otherlibs/dynlink/dynlink.mli |
| 1053 |
cp $^ otherlibs/dynlink/$*/ |
| 1054 |
|
| 1055 |
.PHONY: dynlink-all |
| 1056 |
dynlink-all: otherlibs/dynlink/dynlink.cma |
| 1057 |
|
| 1058 |
.PHONY: dynlink-allopt |
| 1059 |
dynlink-allopt: otherlibs/dynlink/dynlink.cmxa |
| 1060 |
|
| 1061 |
otherlibs/dynlink/dynlink.cma: VPATH += otherlibs/dynlink/byte |
| 1062 |
otherlibs/dynlink/dynlink.cmxa: VPATH += otherlibs/dynlink/native |
| 1063 |
|
| 1064 |
ifeq "$(FLAMBDA)" "true" |
| 1065 |
otherlibs/dynlink/%: OC_NATIVE_COMPFLAGS += -O3 |
| 1066 |
endif |
| 1067 |
|
| 1068 |
# dynlink.cmx needs to be available in the search path (since |
| 1069 |
# it is not compiled with -opaque), and we prefer to make the file |
| 1070 |
# available in a directory that is already searched rather than have |
| 1071 |
# to add otherlibs/dynlink/native to the search path as well |
| 1072 |
|
| 1073 |
otherlibs/dynlink/dynlink.cmx : otherlibs/dynlink/native/dynlink.cmx |
| 1074 |
cd otherlibs/dynlink; $(LN) native/dynlink.cmx . |
| 1075 |
|
| 1076 |
DYNLINK_DEPEND_DUMMY_FILES = \ |
| 1077 |
otherlibs/dynlink/dynlink.ml \ |
| 1078 |
otherlibs/dynlink/byte/dynlink.mli \ |
| 1079 |
otherlibs/dynlink/native/dynlink.mli |
| 1080 |
|
| 1081 |
beforedepend:: |
| 1082 |
@touch $(DYNLINK_DEPEND_DUMMY_FILES) |
| 1083 |
|
| 1084 |
otherlibs/dynlink.depend: beforedepend |
| 1085 |
@$(OCAMLDEP) $(OC_OCAMLDEPFLAGS) -I otherlibs/dynlink $(INCLUDES) \ |
| 1086 |
$(OCAMLDEPFLAGS) \ |
| 1087 |
-I otherlibs/dynlink/byte \ |
| 1088 |
-bytecode otherlibs/dynlink/*.mli otherlibs/dynlink/dynlink_*.ml \ |
| 1089 |
otherlibs/dynlink/byte/*.mli otherlibs/dynlink/byte/*.ml \ |
| 1090 |
> $@ |
| 1091 |
@$(OCAMLDEP) $(OC_OCAMLDEPFLAGS) -I otherlibs/dynlink $(INCLUDES) \ |
| 1092 |
$(OCAMLDEPFLAGS) \ |
| 1093 |
-I otherlibs/dynlink/native \ |
| 1094 |
-native otherlibs/dynlink/dynlink_*.ml \ |
| 1095 |
otherlibs/dynlink/native/dynlink.ml \ |
| 1096 |
>> $@ |
| 1097 |
|
| 1098 |
# Cleanup the lexer |
| 1099 |
|
| 1100 |
partialclean:: |
| 1101 |
rm -f parsing/lexer.ml |
| 1102 |
|
| 1103 |
beforedepend:: parsing/lexer.ml |
| 1104 |
|
| 1105 |
# The predefined exceptions and primitives |
| 1106 |
|
| 1107 |
lambda/runtimedef.ml: lambda/generate_runtimedef.sh runtime/caml/fail.h \ |
| 1108 |
runtime/primitives |
| 1109 |
$(V_GEN)$^ > $@ |
| 1110 |
|
| 1111 |
partialclean:: |
| 1112 |
rm -f lambda/runtimedef.ml |
| 1113 |
|
| 1114 |
beforedepend:: lambda/runtimedef.ml |
| 1115 |
|
| 1116 |
# Choose the right machine-dependent files |
| 1117 |
|
| 1118 |
asmcomp/arch.mli: asmcomp/$(ARCH)/arch.mli |
| 1119 |
@cd asmcomp; $(LN) $(ARCH)/arch.mli . |
| 1120 |
|
| 1121 |
asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml |
| 1122 |
@cd asmcomp; $(LN) $(ARCH)/arch.ml . |
| 1123 |
|
| 1124 |
asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml |
| 1125 |
@cd asmcomp; $(LN) $(ARCH)/proc.ml . |
| 1126 |
|
| 1127 |
asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml |
| 1128 |
@cd asmcomp; $(LN) $(ARCH)/selection.ml . |
| 1129 |
|
| 1130 |
asmcomp/CSE.ml: asmcomp/$(ARCH)/CSE.ml |
| 1131 |
@cd asmcomp; $(LN) $(ARCH)/CSE.ml . |
| 1132 |
|
| 1133 |
asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml |
| 1134 |
@cd asmcomp; $(LN) $(ARCH)/reload.ml . |
| 1135 |
|
| 1136 |
asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml |
| 1137 |
@cd asmcomp; $(LN) $(ARCH)/scheduling.ml . |
| 1138 |
|
| 1139 |
asmcomp/stackframe.ml: asmcomp/$(ARCH)/stackframe.ml |
| 1140 |
@cd asmcomp; $(LN) $(ARCH)/stackframe.ml . |
| 1141 |
|
| 1142 |
# Preprocess the code emitters |
| 1143 |
cvt_emit = tools/cvt_emit$(EXE) |
| 1144 |
|
| 1145 |
beforedepend:: tools/cvt_emit.ml |
| 1146 |
|
| 1147 |
asmcomp/emit.ml: asmcomp/$(ARCH)/emit.mlp $(cvt_emit) |
| 1148 |
$(V_GEN)echo \# 1 \"asmcomp/$(ARCH)/emit.mlp\" > $@ && \ |
| 1149 |
$(OCAMLRUN) $(cvt_emit) < $< >> $@ \ |
| 1150 |
|| { rm -f $@; exit 2; } |
| 1151 |
|
| 1152 |
partialclean:: |
| 1153 |
rm -f asmcomp/emit.ml tools/cvt_emit.ml |
| 1154 |
|
| 1155 |
beforedepend:: asmcomp/emit.ml |
| 1156 |
|
| 1157 |
cvt_emit_LIBRARIES = |
| 1158 |
cvt_emit_SOURCES = tools/cvt_emit.mli tools/cvt_emit.mll |
| 1159 |
|
| 1160 |
# The "expunge" utility |
| 1161 |
|
| 1162 |
expunge_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 1163 |
|
| 1164 |
expunge_SOURCES = toplevel/expunge.mli toplevel/expunge.ml |
| 1165 |
|
| 1166 |
partialclean:: |
| 1167 |
rm -f expunge expunge.exe |
| 1168 |
|
| 1169 |
# The runtime system |
| 1170 |
|
| 1171 |
## Lists of source files |
| 1172 |
|
| 1173 |
ifneq "$(WINPTHREADS_SOURCE_DIR)" "" |
| 1174 |
winpthreads_SOURCES = cond.c misc.c mutex.c rwlock.c sched.c spinlock.c thread.c |
| 1175 |
|
| 1176 |
winpthreads_OBJECTS = \ |
| 1177 |
$(addprefix runtime/winpthreads/, $(winpthreads_SOURCES:.c=.$(O))) |
| 1178 |
else |
| 1179 |
winpthreads_OBJECTS = |
| 1180 |
endif |
| 1181 |
|
| 1182 |
runtime_COMMON_C_SOURCES = \ |
| 1183 |
addrmap \ |
| 1184 |
afl \ |
| 1185 |
alloc \ |
| 1186 |
array \ |
| 1187 |
backtrace \ |
| 1188 |
bigarray \ |
| 1189 |
blake2 \ |
| 1190 |
callback \ |
| 1191 |
codefrag \ |
| 1192 |
compare \ |
| 1193 |
custom \ |
| 1194 |
debugger \ |
| 1195 |
domain \ |
| 1196 |
dynlink \ |
| 1197 |
extern \ |
| 1198 |
fail \ |
| 1199 |
fiber \ |
| 1200 |
finalise \ |
| 1201 |
floats \ |
| 1202 |
gc_ctrl \ |
| 1203 |
gc_stats \ |
| 1204 |
globroots \ |
| 1205 |
hash \ |
| 1206 |
intern \ |
| 1207 |
ints \ |
| 1208 |
io \ |
| 1209 |
lexing \ |
| 1210 |
lf_skiplist \ |
| 1211 |
main \ |
| 1212 |
major_gc \ |
| 1213 |
md5 \ |
| 1214 |
memory \ |
| 1215 |
memprof \ |
| 1216 |
meta \ |
| 1217 |
minor_gc \ |
| 1218 |
misc \ |
| 1219 |
obj \ |
| 1220 |
parsing \ |
| 1221 |
platform \ |
| 1222 |
printexc \ |
| 1223 |
prng \ |
| 1224 |
roots \ |
| 1225 |
runtime_events \ |
| 1226 |
shared_heap \ |
| 1227 |
signals \ |
| 1228 |
skiplist \ |
| 1229 |
startup_aux \ |
| 1230 |
str \ |
| 1231 |
sync \ |
| 1232 |
sys \ |
| 1233 |
$(UNIX_OR_WIN32) \ |
| 1234 |
weak |
| 1235 |
|
| 1236 |
runtime_BYTECODE_ONLY_C_SOURCES = \ |
| 1237 |
backtrace_byt \ |
| 1238 |
fail_byt \ |
| 1239 |
fix_code \ |
| 1240 |
interp \ |
| 1241 |
startup_byt \ |
| 1242 |
zstd |
| 1243 |
runtime_BYTECODE_C_SOURCES = \ |
| 1244 |
$(runtime_COMMON_C_SOURCES:%=runtime/%.c) \ |
| 1245 |
$(runtime_BYTECODE_ONLY_C_SOURCES:%=runtime/%.c) |
| 1246 |
|
| 1247 |
runtime_NATIVE_ONLY_C_SOURCES = \ |
| 1248 |
$(TSAN_NATIVE_RUNTIME_C_SOURCES) \ |
| 1249 |
backtrace_nat \ |
| 1250 |
clambda_checks \ |
| 1251 |
dynlink_nat \ |
| 1252 |
fail_nat \ |
| 1253 |
frame_descriptors \ |
| 1254 |
startup_nat \ |
| 1255 |
signals_nat |
| 1256 |
runtime_NATIVE_C_SOURCES = \ |
| 1257 |
$(runtime_COMMON_C_SOURCES:%=runtime/%.c) \ |
| 1258 |
$(runtime_NATIVE_ONLY_C_SOURCES:%=runtime/%.c) |
| 1259 |
|
| 1260 |
## Header files generated by configure |
| 1261 |
runtime_CONFIGURED_HEADERS = \ |
| 1262 |
$(addprefix runtime/caml/, exec.h m.h s.h version.h) |
| 1263 |
|
| 1264 |
## Header files generated by make |
| 1265 |
runtime_BUILT_HEADERS = $(addprefix runtime/, \ |
| 1266 |
caml/opnames.h caml/jumptbl.h build_config.h) |
| 1267 |
|
| 1268 |
## Targets to build and install |
| 1269 |
|
| 1270 |
runtime_PROGRAMS = runtime/ocamlrun$(EXE) |
| 1271 |
runtime_BYTECODE_STATIC_LIBRARIES = $(addprefix runtime/, \ |
| 1272 |
ld.conf libcamlrun.$(A)) |
| 1273 |
runtime_BYTECODE_SHARED_LIBRARIES = |
| 1274 |
runtime_NATIVE_STATIC_LIBRARIES = \ |
| 1275 |
runtime/libasmrun.$(A) runtime/libcomprmarsh.$(A) |
| 1276 |
runtime_NATIVE_SHARED_LIBRARIES = |
| 1277 |
|
| 1278 |
ifeq "$(RUNTIMED)" "true" |
| 1279 |
runtime_PROGRAMS += runtime/ocamlrund$(EXE) |
| 1280 |
runtime_BYTECODE_STATIC_LIBRARIES += runtime/libcamlrund.$(A) |
| 1281 |
runtime_NATIVE_STATIC_LIBRARIES += runtime/libasmrund.$(A) |
| 1282 |
endif |
| 1283 |
|
| 1284 |
ifeq "$(INSTRUMENTED_RUNTIME)" "true" |
| 1285 |
runtime_PROGRAMS += runtime/ocamlruni$(EXE) |
| 1286 |
runtime_BYTECODE_STATIC_LIBRARIES += runtime/libcamlruni.$(A) |
| 1287 |
runtime_NATIVE_STATIC_LIBRARIES += runtime/libasmruni.$(A) |
| 1288 |
endif |
| 1289 |
|
| 1290 |
ifeq "$(UNIX_OR_WIN32)" "unix" |
| 1291 |
ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" |
| 1292 |
runtime_BYTECODE_STATIC_LIBRARIES += runtime/libcamlrun_pic.$(A) |
| 1293 |
runtime_BYTECODE_SHARED_LIBRARIES += runtime/libcamlrun_shared.$(SO) |
| 1294 |
runtime_NATIVE_STATIC_LIBRARIES += runtime/libasmrun_pic.$(A) |
| 1295 |
runtime_NATIVE_SHARED_LIBRARIES += runtime/libasmrun_shared.$(SO) |
| 1296 |
endif |
| 1297 |
endif |
| 1298 |
|
| 1299 |
## List of object files for each target |
| 1300 |
|
| 1301 |
|
| 1302 |
libcamlrun_OBJECTS = \ |
| 1303 |
$(runtime_BYTECODE_C_SOURCES:.c=.b.$(O)) $(winpthreads_OBJECTS) |
| 1304 |
|
| 1305 |
libcamlrun_non_shared_OBJECTS = \ |
| 1306 |
$(subst $(UNIX_OR_WIN32).b.$(O),$(UNIX_OR_WIN32)_non_shared.b.$(O), \ |
| 1307 |
$(libcamlrun_OBJECTS)) |
| 1308 |
|
| 1309 |
libcamlrund_OBJECTS = $(runtime_BYTECODE_C_SOURCES:.c=.bd.$(O)) \ |
| 1310 |
$(winpthreads_OBJECTS) runtime/instrtrace.bd.$(O) |
| 1311 |
|
| 1312 |
libcamlruni_OBJECTS = \ |
| 1313 |
$(runtime_BYTECODE_C_SOURCES:.c=.bi.$(O)) $(winpthreads_OBJECTS) |
| 1314 |
|
| 1315 |
libcamlrunpic_OBJECTS = \ |
| 1316 |
$(runtime_BYTECODE_C_SOURCES:.c=.bpic.$(O)) $(winpthreads_OBJECTS) |
| 1317 |
|
| 1318 |
libasmrun_OBJECTS = \ |
| 1319 |
$(runtime_NATIVE_C_SOURCES:.c=.n.$(O)) $(runtime_ASM_OBJECTS) \ |
| 1320 |
$(winpthreads_OBJECTS) |
| 1321 |
|
| 1322 |
libasmrund_OBJECTS = \ |
| 1323 |
$(runtime_NATIVE_C_SOURCES:.c=.nd.$(O)) $(runtime_ASM_OBJECTS:.$(O)=.d.$(O)) \ |
| 1324 |
$(winpthreads_OBJECTS) |
| 1325 |
|
| 1326 |
libasmruni_OBJECTS = \ |
| 1327 |
$(runtime_NATIVE_C_SOURCES:.c=.ni.$(O)) $(runtime_ASM_OBJECTS:.$(O)=.i.$(O)) \ |
| 1328 |
$(winpthreads_OBJECTS) |
| 1329 |
|
| 1330 |
libasmrunpic_OBJECTS = $(runtime_NATIVE_C_SOURCES:.c=.npic.$(O)) \ |
| 1331 |
$(runtime_ASM_OBJECTS:.$(O)=_libasmrunpic.$(O)) $(winpthreads_OBJECTS) |
| 1332 |
|
| 1333 |
libcomprmarsh_OBJECTS = runtime/zstd.npic.$(O) |
| 1334 |
|
| 1335 |
## General (non target-specific) assembler and compiler flags |
| 1336 |
|
| 1337 |
runtime_CPPFLAGS = -DCAMLDLLIMPORT= -DIN_CAML_RUNTIME |
| 1338 |
ocamlrun_CPPFLAGS = $(runtime_CPPFLAGS) |
| 1339 |
ocamlrund_CPPFLAGS = $(runtime_CPPFLAGS) -DDEBUG |
| 1340 |
ocamlruni_CPPFLAGS = $(runtime_CPPFLAGS) -DCAML_INSTR |
| 1341 |
|
| 1342 |
## Runtime targets |
| 1343 |
|
| 1344 |
.PHONY: runtime-all |
| 1345 |
runtime-all: \ |
| 1346 |
$(runtime_BYTECODE_STATIC_LIBRARIES) $(runtime_BYTECODE_SHARED_LIBRARIES) \ |
| 1347 |
$(runtime_PROGRAMS) $(SAK) |
| 1348 |
|
| 1349 |
.PHONY: runtime-allopt |
| 1350 |
ifeq "$(NATIVE_COMPILER)" "true" |
| 1351 |
runtime-allopt: \ |
| 1352 |
$(runtime_NATIVE_STATIC_LIBRARIES) $(runtime_NATIVE_SHARED_LIBRARIES) |
| 1353 |
else |
| 1354 |
runtime-allopt: |
| 1355 |
$(error The build has been configured with --disable-native-compiler) |
| 1356 |
endif |
| 1357 |
|
| 1358 |
## Generated non-object files |
| 1359 |
|
| 1360 |
runtime/ld.conf: $(ROOTDIR)/Makefile.config |
| 1361 |
$(V_GEN)echo "$(STUBLIBDIR)" > $@ && \ |
| 1362 |
echo "$(LIBDIR)" >> $@ |
| 1363 |
|
| 1364 |
runtime/primitives: runtime/gen_primitives.sh $(runtime_BYTECODE_C_SOURCES) |
| 1365 |
$(V_GEN)runtime/gen_primitives.sh $@ $(runtime_BYTECODE_C_SOURCES) |
| 1366 |
|
| 1367 |
runtime/prims.c: runtime/gen_primsc.sh runtime/primitives |
| 1368 |
$(V_GEN)runtime/gen_primsc.sh \ |
| 1369 |
runtime/primitives $(runtime_BYTECODE_C_SOURCES) \ |
| 1370 |
> $@ |
| 1371 |
|
| 1372 |
runtime/caml/opnames.h : runtime/caml/instruct.h |
| 1373 |
$(V_GEN)tr -d '\r' < $< | \ |
| 1374 |
sed -e '/\/\*/d' \ |
| 1375 |
-e '/^#/d' \ |
| 1376 |
-e 's/enum /static char const * const names_of_/' \ |
| 1377 |
-e 's/{$$/[] = {/' \ |
| 1378 |
-e 's/\([[:upper:]][[:upper:]_0-9]*\)/"\1"/g' > $@ |
| 1379 |
|
| 1380 |
# runtime/caml/jumptbl.h is required only if the C compiler supports |
| 1381 |
# the labels as values extension. |
| 1382 |
runtime/caml/jumptbl.h : runtime/caml/instruct.h |
| 1383 |
$(V_GEN)tr -d '\r' < $< | \ |
| 1384 |
sed -n -e '/^ /s/ \([A-Z]\)/ \&\&lbl_\1/gp' \ |
| 1385 |
-e '/^}/q' > $@ |
| 1386 |
|
| 1387 |
$(SAK): runtime/sak.c runtime/caml/misc.h runtime/caml/config.h |
| 1388 |
$(V_MKEXE)$(call SAK_BUILD,$@,$<) |
| 1389 |
|
| 1390 |
C_LITERAL = $(shell $(SAK) $(ENCODE_C_LITERAL) '$(1)') |
| 1391 |
|
| 1392 |
runtime/build_config.h: $(ROOTDIR)/Makefile.config $(SAK) |
| 1393 |
$(V_GEN){ \ |
| 1394 |
echo '/* This file is generated from $(ROOTDIR)/Makefile.config */'; \ |
| 1395 |
printf '#define OCAML_STDLIB_DIR %s\n' \ |
| 1396 |
'$(call C_LITERAL,$(TARGET_LIBDIR))'; \ |
| 1397 |
echo '#define HOST "$(HOST)"'; \ |
| 1398 |
} > $@ |
| 1399 |
|
| 1400 |
## Runtime libraries and programs |
| 1401 |
|
| 1402 |
runtime/ocamlrun$(EXE): runtime/prims.$(O) runtime/libcamlrun.$(A) |
| 1403 |
$(V_MKEXE)$(MKEXE) -o $@ $^ $(BYTECCLIBS) |
| 1404 |
|
| 1405 |
runtime/ocamlruns$(EXE): runtime/prims.$(O) runtime/libcamlrun_non_shared.$(A) |
| 1406 |
$(V_MKEXE)$(call MKEXE_VIA_CC,$@,$^ $(BYTECCLIBS)) |
| 1407 |
|
| 1408 |
runtime/libcamlrun.$(A): $(libcamlrun_OBJECTS) |
| 1409 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1410 |
|
| 1411 |
runtime/libcamlrun_non_shared.$(A): $(libcamlrun_non_shared_OBJECTS) |
| 1412 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1413 |
|
| 1414 |
runtime/ocamlrund$(EXE): runtime/prims.$(O) runtime/libcamlrund.$(A) |
| 1415 |
$(V_MKEXE)$(MKEXE) $(MKEXEDEBUGFLAG) -o $@ $^ $(BYTECCLIBS) |
| 1416 |
|
| 1417 |
runtime/libcamlrund.$(A): $(libcamlrund_OBJECTS) |
| 1418 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1419 |
|
| 1420 |
runtime/ocamlruni$(EXE): runtime/prims.$(O) runtime/libcamlruni.$(A) |
| 1421 |
$(V_MKEXE)$(MKEXE) -o $@ $^ $(INSTRUMENTED_RUNTIME_LIBS) $(BYTECCLIBS) |
| 1422 |
|
| 1423 |
runtime/libcamlruni.$(A): $(libcamlruni_OBJECTS) |
| 1424 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1425 |
|
| 1426 |
runtime/libcamlrun_pic.$(A): $(libcamlrunpic_OBJECTS) |
| 1427 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1428 |
|
| 1429 |
runtime/libcamlrun_shared.$(SO): $(libcamlrunpic_OBJECTS) |
| 1430 |
$(V_MKDLL)$(MKDLL) -o $@ $^ $(BYTECCLIBS) |
| 1431 |
|
| 1432 |
runtime/libasmrun.$(A): $(libasmrun_OBJECTS) |
| 1433 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1434 |
|
| 1435 |
runtime/libasmrund.$(A): $(libasmrund_OBJECTS) |
| 1436 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1437 |
|
| 1438 |
runtime/libasmruni.$(A): $(libasmruni_OBJECTS) |
| 1439 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1440 |
|
| 1441 |
runtime/libasmrun_pic.$(A): $(libasmrunpic_OBJECTS) |
| 1442 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1443 |
|
| 1444 |
runtime/libasmrun_shared.$(SO): $(libasmrunpic_OBJECTS) |
| 1445 |
$(V_MKDLL)$(MKDLL) -o $@ $^ $(NATIVECCLIBS) |
| 1446 |
|
| 1447 |
runtime/libcomprmarsh.$(A): $(libcomprmarsh_OBJECTS) |
| 1448 |
$(V_MKLIB)$(call MKLIB,$@, $^) |
| 1449 |
|
| 1450 |
## Runtime target-specific preprocessor and compiler flags |
| 1451 |
|
| 1452 |
runtime/%.b.$(O): OC_CFLAGS = $(OC_BYTECODE_CFLAGS) |
| 1453 |
runtime/%.b.$(O): OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1454 |
$(DEPDIR)/runtime/%.b.$(D): \ |
| 1455 |
OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1456 |
|
| 1457 |
runtime/%.bd.$(O): OC_CFLAGS = $(OC_BYTECODE_CFLAGS) |
| 1458 |
runtime/%.bd.$(O): OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlrund_CPPFLAGS) |
| 1459 |
$(DEPDIR)/runtime/%.bd.$(D): \ |
| 1460 |
OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlrund_CPPFLAGS) |
| 1461 |
|
| 1462 |
runtime/%.bi.$(O): OC_CFLAGS = $(OC_BYTECODE_CFLAGS) |
| 1463 |
runtime/%.bi.$(O): OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlruni_CPPFLAGS) |
| 1464 |
$(DEPDIR)/runtime/%.bi.$(D): \ |
| 1465 |
OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlruni_CPPFLAGS) |
| 1466 |
|
| 1467 |
runtime/%.bpic.$(O): OC_CFLAGS = $(OC_BYTECODE_CFLAGS) $(SHAREDLIB_CFLAGS) |
| 1468 |
runtime/%.bpic.$(O): OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1469 |
$(DEPDIR)/runtime/%.bpic.$(D): \ |
| 1470 |
OC_CPPFLAGS = $(OC_BYTECODE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1471 |
|
| 1472 |
runtime/%.n.$(O): OC_CFLAGS = $(OC_NATIVE_CFLAGS) |
| 1473 |
runtime/%.n.$(O): OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1474 |
$(DEPDIR)/runtime/%.n.$(D): \ |
| 1475 |
OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1476 |
|
| 1477 |
runtime/%.nd.$(O): OC_CFLAGS = $(OC_NATIVE_CFLAGS) |
| 1478 |
runtime/%.nd.$(O): OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrund_CPPFLAGS) |
| 1479 |
$(DEPDIR)/runtime/%.nd.$(D): \ |
| 1480 |
OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrund_CPPFLAGS) |
| 1481 |
|
| 1482 |
runtime/%.ni.$(O): OC_CFLAGS = $(OC_NATIVE_CFLAGS) |
| 1483 |
runtime/%.ni.$(O): OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlruni_CPPFLAGS) |
| 1484 |
$(DEPDIR)/runtime/%.ni.$(D): \ |
| 1485 |
OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlruni_CPPFLAGS) |
| 1486 |
|
| 1487 |
runtime/%.npic.$(O): OC_CFLAGS = $(OC_NATIVE_CFLAGS) $(SHAREDLIB_CFLAGS) |
| 1488 |
runtime/%.npic.$(O): OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1489 |
$(DEPDIR)/runtime/%.npic.$(D): \ |
| 1490 |
OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrun_CPPFLAGS) |
| 1491 |
|
| 1492 |
## Compilation of runtime C files |
| 1493 |
|
| 1494 |
# The COMPILE_C_FILE macro below receives as argument the pattern |
| 1495 |
# that corresponds to the name of the generated object file |
| 1496 |
# (without the extension, which is added by the macro) |
| 1497 |
define COMPILE_C_FILE |
| 1498 |
ifeq "$(COMPUTE_DEPS)" "true" |
| 1499 |
ifneq "$(1)" "%" |
| 1500 |
# -MG would ensure that the dependencies are generated even if the files listed |
| 1501 |
# in $$(runtime_BUILT_HEADERS) haven't been assembled yet. However, |
| 1502 |
# this goes subtly wrong if the user has the headers installed, |
| 1503 |
# as gcc will pick up a dependency on those instead and the local |
| 1504 |
# ones will not be generated. For this reason, we don't use -MG and |
| 1505 |
# instead include $(runtime_BUILT_HEADERS) in the order only dependencies |
| 1506 |
# to ensure that they exist before dependencies are computed. |
| 1507 |
$(DEPDIR)/$(1).$(D): runtime/%.c | $(DEPDIR)/runtime $(runtime_BUILT_HEADERS) |
| 1508 |
$$(V_CCDEPS)$$(DEP_CC) $$(OC_CPPFLAGS) $$(CPPFLAGS) $$< -MT \ |
| 1509 |
'runtime/$$*$(subst runtime/%,,$(1)).$(O)' -MF $$@ |
| 1510 |
endif # ifneq "$(1)" "%" |
| 1511 |
$(1).$(O): $(2).c |
| 1512 |
else |
| 1513 |
$(1).$(O): $(2).c \ |
| 1514 |
$(runtime_CONFIGURED_HEADERS) $(runtime_BUILT_HEADERS) \ |
| 1515 |
$(RUNTIME_HEADERS) |
| 1516 |
endif # ifeq "$(COMPUTE_DEPS)" "true" |
| 1517 |
$$(V_CC)$$(CC) $$(OC_CFLAGS) $$(CFLAGS) $$(OC_CPPFLAGS) $$(CPPFLAGS) \ |
| 1518 |
$$(OUTPUTOBJ)$$@ -c $$< |
| 1519 |
endef |
| 1520 |
|
| 1521 |
runtime/winpthreads/%.$(O): $(WINPTHREADS_SOURCE_DIR)/src/%.c \ |
| 1522 |
$(wildcard $(WINPTHREADS_SOURCE_DIR)/include/*.h) \ |
| 1523 |
| runtime/winpthreads |
| 1524 |
$(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) \ |
| 1525 |
$(OUTPUTOBJ)$@ -c $< |
| 1526 |
|
| 1527 |
runtime/winpthreads: |
| 1528 |
$(MKDIR) $@ |
| 1529 |
|
| 1530 |
$(DEPDIR)/runtime: |
| 1531 |
$(MKDIR) $@ |
| 1532 |
|
| 1533 |
runtime_OBJECT_TYPES = % %.b %.bd %.bi %.bpic |
| 1534 |
ifeq "$(NATIVE_COMPILER)" "true" |
| 1535 |
runtime_OBJECT_TYPES += %.n %.nd %.ni %.np %.npic |
| 1536 |
endif |
| 1537 |
|
| 1538 |
$(foreach runtime_OBJECT_TYPE, $(runtime_OBJECT_TYPES), \ |
| 1539 |
$(eval $(call COMPILE_C_FILE,runtime/$(runtime_OBJECT_TYPE),runtime/%))) |
| 1540 |
|
| 1541 |
runtime/$(UNIX_OR_WIN32)_non_shared.%.$(O): \ |
| 1542 |
OC_CPPFLAGS += -DBUILDING_LIBCAMLRUNS |
| 1543 |
|
| 1544 |
$(eval $(call COMPILE_C_FILE,runtime/$(UNIX_OR_WIN32)_non_shared.%, \ |
| 1545 |
runtime/$(UNIX_OR_WIN32))) |
| 1546 |
|
| 1547 |
$(foreach runtime_OBJECT_TYPE,$(subst %,,$(runtime_OBJECT_TYPES)), \ |
| 1548 |
$(eval \ |
| 1549 |
runtime/dynlink$(runtime_OBJECT_TYPE).$(O): $(ROOTDIR)/Makefile.config)) |
| 1550 |
|
| 1551 |
## Compilation of runtime assembly files |
| 1552 |
|
| 1553 |
ASPP_ERROR = \ |
| 1554 |
{ echo "If your assembler produced syntax errors, it is probably";\ |
| 1555 |
echo "unhappy with the preprocessor. Check your assembler, or";\ |
| 1556 |
echo "try producing $*.o by hand.";\ |
| 1557 |
exit 2; } |
| 1558 |
runtime/%.o: runtime/%.S |
| 1559 |
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR) |
| 1560 |
|
| 1561 |
runtime/%.d.o: runtime/%.S |
| 1562 |
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) $(ocamlrund_CPPFLAGS) -o $@ $< || $(ASPP_ERROR) |
| 1563 |
|
| 1564 |
runtime/%.i.o: runtime/%.S |
| 1565 |
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) $(ocamlruni_CPPFLAGS) -o $@ $< || $(ASPP_ERROR) |
| 1566 |
|
| 1567 |
runtime/%_libasmrunpic.o: runtime/%.S |
| 1568 |
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) $(SHAREDLIB_CFLAGS) -o $@ $< |
| 1569 |
|
| 1570 |
runtime/domain_state.inc: runtime/caml/domain_state.tbl |
| 1571 |
$(V_GEN)$(CPP) $< > $@ |
| 1572 |
|
| 1573 |
runtime/amd64nt.obj: runtime/amd64nt.asm runtime/domain_state.inc |
| 1574 |
$(V_ASM)$(ASM)$@ $< |
| 1575 |
|
| 1576 |
runtime/amd64nt.d.obj: runtime/amd64nt.asm runtime/domain_state.inc |
| 1577 |
$(V_ASM)$(ASM)$@ $(ocamlrund_CPPFLAGS) $< |
| 1578 |
|
| 1579 |
runtime/amd64nt.i.obj: runtime/amd64nt.asm runtime/domain_state.inc |
| 1580 |
$(V_ASM)$(ASM)$@ $(ocamlruni_CPPFLAGS) $< |
| 1581 |
|
| 1582 |
runtime/%_libasmrunpic.obj: runtime/%.asm |
| 1583 |
$(V_ASM)$(ASM)$@ $< |
| 1584 |
|
| 1585 |
## Runtime dependencies |
| 1586 |
|
| 1587 |
runtime_DEP_FILES := $(addsuffix .b, \ |
| 1588 |
$(basename $(runtime_BYTECODE_C_SOURCES) runtime/instrtrace)) |
| 1589 |
ifeq "$(NATIVE_COMPILER)" "true" |
| 1590 |
runtime_DEP_FILES += $(addsuffix .n, $(basename $(runtime_NATIVE_C_SOURCES))) |
| 1591 |
endif |
| 1592 |
runtime_DEP_FILES += $(addsuffix d, $(runtime_DEP_FILES)) \ |
| 1593 |
$(addsuffix i, $(runtime_DEP_FILES)) \ |
| 1594 |
$(addsuffix pic, $(runtime_DEP_FILES)) |
| 1595 |
runtime_DEP_FILES := $(addsuffix .$(D), $(runtime_DEP_FILES)) |
| 1596 |
|
| 1597 |
ifeq "$(COMPUTE_DEPS)" "true" |
| 1598 |
include $(addprefix $(DEPDIR)/, $(runtime_DEP_FILES)) |
| 1599 |
endif |
| 1600 |
|
| 1601 |
.PHONY: runtime |
| 1602 |
runtime: stdlib/libcamlrun.$(A) |
| 1603 |
|
| 1604 |
.PHONY: makeruntime |
| 1605 |
makeruntime: runtime-all |
| 1606 |
stdlib/libcamlrun.$(A): runtime-all |
| 1607 |
cd stdlib; $(LN) ../runtime/libcamlrun.$(A) . |
| 1608 |
clean:: |
| 1609 |
rm -f $(addprefix runtime/, *.o *.obj *.a *.lib *.so *.dll ld.conf) |
| 1610 |
rm -f $(addprefix runtime/, ocamlrun ocamlrund ocamlruni ocamlruns sak) |
| 1611 |
rm -f $(addprefix runtime/, \ |
| 1612 |
ocamlrun.exe ocamlrund.exe ocamlruni.exe ocamlruns.exe sak.exe) |
| 1613 |
rm -f runtime/primitives runtime/primitives*.new runtime/prims.c \ |
| 1614 |
$(runtime_BUILT_HEADERS) |
| 1615 |
rm -f runtime/domain_state.inc |
| 1616 |
rm -rf $(DEPDIR) runtime/winpthreads |
| 1617 |
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib |
| 1618 |
|
| 1619 |
.PHONY: runtimeopt |
| 1620 |
runtimeopt: stdlib/libasmrun.$(A) |
| 1621 |
|
| 1622 |
.PHONY: makeruntimeopt |
| 1623 |
makeruntimeopt: runtime-allopt |
| 1624 |
stdlib/libasmrun.$(A): runtime-allopt |
| 1625 |
cd stdlib; $(LN) ../runtime/libasmrun.$(A) . |
| 1626 |
stdlib/libcomprmarsh.$(A): runtime/libcomprmarsh.$(A) |
| 1627 |
cd stdlib; $(LN) ../runtime/libcomprmarsh.$(A) . |
| 1628 |
|
| 1629 |
clean:: |
| 1630 |
rm -f stdlib/libasmrun.a stdlib/libasmrun.lib |
| 1631 |
rm -f stdlib/libcomprmarsh.a stdlib/libcomprmarsh.lib |
| 1632 |
|
| 1633 |
# Dependencies |
| 1634 |
|
| 1635 |
# The following definition duplicates the otherlibs/ prefix but this |
| 1636 |
# will go away with the merge of the sub makefiles |
| 1637 |
subdirs = stdlib \ |
| 1638 |
otherlibs/str \ |
| 1639 |
otherlibs/systhreads \ |
| 1640 |
otherlibs/unix \ |
| 1641 |
otherlibs/runtime_events |
| 1642 |
|
| 1643 |
.PHONY: alldepend |
| 1644 |
alldepend: depend |
| 1645 |
for dir in $(subdirs); do \ |
| 1646 |
$(MAKE) -C $$dir depend || exit; \ |
| 1647 |
done |
| 1648 |
|
| 1649 |
# The standard library |
| 1650 |
|
| 1651 |
.PHONY: library |
| 1652 |
library: ocamlc |
| 1653 |
$(MAKE) -C stdlib all |
| 1654 |
|
| 1655 |
.PHONY: library-cross |
| 1656 |
library-cross: |
| 1657 |
$(MAKE) -C stdlib OCAMLRUN=../runtime/ocamlrun$(EXE) all |
| 1658 |
|
| 1659 |
.PHONY: libraryopt |
| 1660 |
libraryopt: |
| 1661 |
$(MAKE) -C stdlib allopt |
| 1662 |
|
| 1663 |
partialclean:: |
| 1664 |
$(MAKE) -C stdlib clean |
| 1665 |
|
| 1666 |
# The lexer generator |
| 1667 |
|
| 1668 |
ocamllex_LIBRARIES = |
| 1669 |
|
| 1670 |
ocamllex_SOURCES = $(addprefix lex/,\ |
| 1671 |
cset.mli cset.ml \ |
| 1672 |
syntax.mli syntax.ml \ |
| 1673 |
parser.mly \ |
| 1674 |
lexer.mli lexer.mll \ |
| 1675 |
table.mli table.ml \ |
| 1676 |
lexgen.mli lexgen.ml \ |
| 1677 |
compact.mli compact.ml \ |
| 1678 |
common.mli common.ml \ |
| 1679 |
output.mli output.ml \ |
| 1680 |
outputbis.mli outputbis.ml \ |
| 1681 |
main.mli main.ml) |
| 1682 |
|
| 1683 |
.PHONY: lex-all |
| 1684 |
lex-all: lex/ocamllex |
| 1685 |
|
| 1686 |
.PHONY: lex-allopt |
| 1687 |
lex-allopt: lex/ocamllex.opt |
| 1688 |
|
| 1689 |
.PHONY: ocamllex |
| 1690 |
ocamllex: ocamlyacc |
| 1691 |
$(MAKE) lex-all |
| 1692 |
|
| 1693 |
.PHONY: ocamllex.opt |
| 1694 |
ocamllex.opt: ocamlopt |
| 1695 |
$(MAKE) lex-allopt |
| 1696 |
|
| 1697 |
lex/ocamllex$(EXE): OC_BYTECODE_LINKFLAGS += -compat-32 |
| 1698 |
|
| 1699 |
partialclean:: |
| 1700 |
rm -f lex/*.cm* lex/*.o lex/*.obj \ |
| 1701 |
$(ocamllex_PROGRAMS) $(ocamllex_PROGRAMS:=.exe) \ |
| 1702 |
lex/parser.ml lex/parser.mli lex/parser.output \ |
| 1703 |
lex/lexer.ml |
| 1704 |
|
| 1705 |
beforedepend:: lex/parser.ml lex/parser.mli lex/lexer.ml |
| 1706 |
|
| 1707 |
# The ocamlyacc parser generator |
| 1708 |
|
| 1709 |
ocamlyacc_OTHER_MODULES = $(addprefix yacc/,\ |
| 1710 |
closure error lalr lr0 main mkpar output reader skeleton symtab \ |
| 1711 |
verbose warshall) |
| 1712 |
|
| 1713 |
ocamlyacc_MODULES = $(ocamlyacc_WSTR_MODULE) $(ocamlyacc_OTHER_MODULES) |
| 1714 |
|
| 1715 |
ocamlyacc_OBJECTS = $(ocamlyacc_MODULES:=.$(O)) |
| 1716 |
|
| 1717 |
# Do not compile assertions in ocamlyacc |
| 1718 |
ocamlyacc_CPPFLAGS = -DNDEBUG |
| 1719 |
|
| 1720 |
.PHONY: ocamlyacc |
| 1721 |
ocamlyacc: $(ocamlyacc_PROGRAM)$(EXE) |
| 1722 |
|
| 1723 |
$(ocamlyacc_PROGRAM)$(EXE): $(ocamlyacc_OBJECTS) |
| 1724 |
$(V_MKEXE)$(MKEXE) -o $@ $^ |
| 1725 |
|
| 1726 |
clean:: |
| 1727 |
rm -f $(ocamlyacc_MODULES:=.o) $(ocamlyacc_MODULES:=.obj) \ |
| 1728 |
yacc/wstr.o yacc/wstr.obj |
| 1729 |
|
| 1730 |
$(ocamlyacc_OTHER_MODULES:=.$(O)): yacc/defs.h |
| 1731 |
|
| 1732 |
$(ocamlyacc_OTHER_MODULES:=.$(O)): OC_CPPFLAGS += $(ocamlyacc_CPPFLAGS) |
| 1733 |
|
| 1734 |
# The Menhir-generated parser |
| 1735 |
|
| 1736 |
# In order to avoid a build-time dependency on Menhir, |
| 1737 |
# we store the result of the parser generator (which |
| 1738 |
# are OCaml source files) and Menhir's runtime libraries |
| 1739 |
# (that the parser files rely on) in boot/. |
| 1740 |
|
| 1741 |
# The rules below do not depend on Menhir being available, |
| 1742 |
# they just build the parser from boot/. |
| 1743 |
|
| 1744 |
# See Makefile.menhir for the rules to rebuild the parser and update |
| 1745 |
# boot/, which require Menhir. The targets in Makefile.menhir |
| 1746 |
# (also included here for convenience) must be used after any |
| 1747 |
# modification of parser.mly. |
| 1748 |
include Makefile.menhir |
| 1749 |
|
| 1750 |
# To avoid module-name conflicts with compiler-lib users that link |
| 1751 |
# with their code with their own MenhirLib module (possibly with |
| 1752 |
# a different Menhir version), we rename MenhirLib into |
| 1753 |
# CamlinternalMenhirlib -- and replace the module occurrences in the |
| 1754 |
# generated parser.ml. |
| 1755 |
|
| 1756 |
parsing/camlinternalMenhirLib.ml: boot/menhir/menhirLib.ml |
| 1757 |
$(V_GEN)cp $< $@ |
| 1758 |
parsing/camlinternalMenhirLib.mli: boot/menhir/menhirLib.mli |
| 1759 |
$(V_GEN)echo '[@@@ocaml.warning "-67"]' > $@ && \ |
| 1760 |
cat $< >> $@ |
| 1761 |
|
| 1762 |
# Copy parsing/parser.ml from boot/ |
| 1763 |
|
| 1764 |
PARSER_DEPS = boot/menhir/parser.ml parsing/parser.mly |
| 1765 |
|
| 1766 |
ifeq "$(OCAML_DEVELOPMENT_VERSION)" "true" |
| 1767 |
PARSER_DEPS += tools/check-parser-uptodate-or-warn.sh |
| 1768 |
endif |
| 1769 |
|
| 1770 |
parsing/parser.ml: $(PARSER_DEPS) |
| 1771 |
ifeq "$(OCAML_DEVELOPMENT_VERSION)" "true" |
| 1772 |
@-tools/check-parser-uptodate-or-warn.sh |
| 1773 |
endif |
| 1774 |
$(V_GEN)sed "s/MenhirLib/CamlinternalMenhirLib/g" $< > $@ |
| 1775 |
parsing/parser.mli: boot/menhir/parser.mli |
| 1776 |
$(V_GEN)sed "s/MenhirLib/CamlinternalMenhirLib/g" $< > $@ |
| 1777 |
|
| 1778 |
beforedepend:: parsing/camlinternalMenhirLib.ml \ |
| 1779 |
parsing/camlinternalMenhirLib.mli \ |
| 1780 |
parsing/parser.ml parsing/parser.mli |
| 1781 |
|
| 1782 |
partialclean:: partialclean-menhir |
| 1783 |
|
| 1784 |
|
| 1785 |
# OCamldoc |
| 1786 |
|
| 1787 |
# First define the odoc_info library used to build OCamldoc |
| 1788 |
|
| 1789 |
odoc_info_SOURCES = $(addprefix ocamldoc/,\ |
| 1790 |
odoc_config.mli odoc_config.ml \ |
| 1791 |
odoc_messages.mli odoc_messages.ml \ |
| 1792 |
odoc_global.mli odoc_global.ml \ |
| 1793 |
odoc_types.mli odoc_types.ml \ |
| 1794 |
odoc_misc.mli odoc_misc.ml \ |
| 1795 |
odoc_text_parser.mly \ |
| 1796 |
odoc_text_lexer.mli odoc_text_lexer.mll \ |
| 1797 |
odoc_text.mli odoc_text.ml \ |
| 1798 |
odoc_name.mli odoc_name.ml \ |
| 1799 |
odoc_parameter.mli odoc_parameter.ml \ |
| 1800 |
odoc_value.mli odoc_value.ml \ |
| 1801 |
odoc_type.mli odoc_type.ml \ |
| 1802 |
odoc_extension.mli odoc_extension.ml \ |
| 1803 |
odoc_exception.mli odoc_exception.ml \ |
| 1804 |
odoc_class.mli odoc_class.ml \ |
| 1805 |
odoc_module.mli odoc_module.ml \ |
| 1806 |
odoc_print.mli odoc_print.ml \ |
| 1807 |
odoc_str.mli odoc_str.ml \ |
| 1808 |
odoc_comments_global.mli odoc_comments_global.ml \ |
| 1809 |
odoc_parser.mly \ |
| 1810 |
odoc_lexer.mli odoc_lexer.mll \ |
| 1811 |
odoc_see_lexer.mli odoc_see_lexer.mll \ |
| 1812 |
odoc_env.mli odoc_env.ml \ |
| 1813 |
odoc_merge.mli odoc_merge.ml \ |
| 1814 |
odoc_sig.mli odoc_sig.ml \ |
| 1815 |
odoc_ast.mli odoc_ast.ml \ |
| 1816 |
odoc_search.mli odoc_search.ml \ |
| 1817 |
odoc_scan.mli odoc_scan.ml \ |
| 1818 |
odoc_cross.mli odoc_cross.ml \ |
| 1819 |
odoc_comments.mli odoc_comments.ml \ |
| 1820 |
odoc_dep.mli odoc_dep.ml \ |
| 1821 |
odoc_analyse.mli odoc_analyse.ml \ |
| 1822 |
odoc_info.mli odoc_info.ml) |
| 1823 |
|
| 1824 |
ocamldoc_LIBRARIES = \ |
| 1825 |
compilerlibs/ocamlcommon \ |
| 1826 |
$(addprefix otherlibs/,\ |
| 1827 |
unix/unix \ |
| 1828 |
str/str \ |
| 1829 |
dynlink/dynlink) \ |
| 1830 |
ocamldoc/odoc_info |
| 1831 |
|
| 1832 |
ocamldoc_SOURCES = $(addprefix ocamldoc/,\ |
| 1833 |
odoc_dag2html.mli odoc_dag2html.ml \ |
| 1834 |
odoc_to_text.mli odoc_to_text.ml \ |
| 1835 |
odoc_ocamlhtml.mli odoc_ocamlhtml.mll \ |
| 1836 |
odoc_html.mli odoc_html.ml \ |
| 1837 |
odoc_man.mli odoc_man.ml \ |
| 1838 |
odoc_latex_style.mli odoc_latex_style.ml \ |
| 1839 |
odoc_latex.mli odoc_latex.ml \ |
| 1840 |
odoc_texi.mli odoc_texi.ml \ |
| 1841 |
odoc_dot.mli odoc_dot.ml \ |
| 1842 |
odoc_gen.mli odoc_gen.ml \ |
| 1843 |
odoc_args.mli odoc_args.ml \ |
| 1844 |
odoc.mli odoc.ml) |
| 1845 |
|
| 1846 |
# OCamldoc files to install (a subset of what is built) |
| 1847 |
|
| 1848 |
OCAMLDOC_LIBMLIS = $(addprefix ocamldoc/,$(addsuffix .mli,\ |
| 1849 |
odoc_dep odoc_dot odoc_extension odoc_html odoc_info odoc_latex \ |
| 1850 |
odoc_latex_style odoc_man odoc_messages odoc_ocamlhtml odoc_parameter \ |
| 1851 |
odoc_texi odoc_text_lexer odoc_to_text odoc_type odoc_value)) |
| 1852 |
OCAMLDOC_LIBCMIS=$(OCAMLDOC_LIBMLIS:.mli=.cmi) |
| 1853 |
OCAMLDOC_LIBCMTS=$(OCAMLDOC_LIBMLIS:.mli=.cmt) $(OCAMLDOC_LIBMLIS:.mli=.cmti) |
| 1854 |
|
| 1855 |
ocamldoc/%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS) |
| 1856 |
ocamldoc/%: CAMLOPT = $(BEST_OCAMLOPT) $(STDLIBFLAGS) |
| 1857 |
|
| 1858 |
.PHONY: ocamldoc |
| 1859 |
ocamldoc: ocamldoc/ocamldoc$(EXE) ocamldoc/odoc_test.cmo |
| 1860 |
|
| 1861 |
ocamldoc/ocamldoc$(EXE): ocamlc ocamlyacc ocamllex |
| 1862 |
|
| 1863 |
.PHONY: ocamldoc.opt |
| 1864 |
ocamldoc.opt: ocamldoc/ocamldoc.opt$(EXE) |
| 1865 |
|
| 1866 |
ocamldoc/ocamldoc.opt$(EXE): ocamlopt ocamlyacc ocamllex |
| 1867 |
|
| 1868 |
# OCamltest |
| 1869 |
|
| 1870 |
ifeq "$(build_ocamltest)" "true" |
| 1871 |
|
| 1872 |
# Libraries ocamltest depends on |
| 1873 |
|
| 1874 |
ocamltest_LIBRARIES = \ |
| 1875 |
$(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) \ |
| 1876 |
$(unix_library) |
| 1877 |
|
| 1878 |
# List of source files from which ocamltest is compiled |
| 1879 |
# (all the different sorts of files are derived from this) |
| 1880 |
|
| 1881 |
# ocamltest has two components: its core and the OCaml "plugin" |
| 1882 |
# which is actually built into the tool but clearly separated from its core |
| 1883 |
|
| 1884 |
ocamltest_CORE = \ |
| 1885 |
run_$(UNIX_OR_WIN32).c run_stubs.c \ |
| 1886 |
ocamltest_config.ml.in ocamltest_config.mli \ |
| 1887 |
ocamltest_unix.mli ocamltest_unix.ml \ |
| 1888 |
ocamltest_stdlib.mli ocamltest_stdlib.ml \ |
| 1889 |
run_command.mli run_command.ml \ |
| 1890 |
filecompare.mli filecompare.ml \ |
| 1891 |
variables.mli variables.ml \ |
| 1892 |
environments.mli environments.ml \ |
| 1893 |
result.mli result.ml \ |
| 1894 |
actions.mli actions.ml \ |
| 1895 |
tests.mli tests.ml \ |
| 1896 |
strace.mli strace.ml \ |
| 1897 |
tsl_ast.mli tsl_ast.ml \ |
| 1898 |
tsl_parser.mly \ |
| 1899 |
tsl_lexer.mli tsl_lexer.mll \ |
| 1900 |
modifier_parser.mli modifier_parser.ml \ |
| 1901 |
tsl_semantics.mli tsl_semantics.ml \ |
| 1902 |
builtin_variables.mli builtin_variables.ml \ |
| 1903 |
actions_helpers.mli actions_helpers.ml \ |
| 1904 |
builtin_actions.mli builtin_actions.ml \ |
| 1905 |
translate.mli translate.ml |
| 1906 |
|
| 1907 |
ocamltest_ocaml_PLUGIN = \ |
| 1908 |
ocaml_backends.mli ocaml_backends.ml \ |
| 1909 |
ocaml_filetypes.mli ocaml_filetypes.ml \ |
| 1910 |
ocaml_variables.mli ocaml_variables.ml \ |
| 1911 |
ocaml_modifiers.mli ocaml_modifiers.ml \ |
| 1912 |
ocaml_directories.mli ocaml_directories.ml \ |
| 1913 |
ocaml_files.mli ocaml_files.ml \ |
| 1914 |
ocaml_flags.mli ocaml_flags.ml \ |
| 1915 |
ocaml_commands.mli ocaml_commands.ml \ |
| 1916 |
ocaml_tools.mli ocaml_tools.ml \ |
| 1917 |
ocaml_compilers.mli ocaml_compilers.ml \ |
| 1918 |
ocaml_toplevels.mli ocaml_toplevels.ml \ |
| 1919 |
ocaml_actions.mli ocaml_actions.ml \ |
| 1920 |
ocaml_tests.mli ocaml_tests.ml \ |
| 1921 |
debugger_flags.mli debugger_flags.ml \ |
| 1922 |
debugger_variables.mli debugger_variables.ml \ |
| 1923 |
debugger_actions.mli debugger_actions.ml \ |
| 1924 |
|
| 1925 |
ocamltest_SOURCES = $(addprefix ocamltest/, \ |
| 1926 |
$(ocamltest_CORE) $(ocamltest_ocaml_PLUGIN) \ |
| 1927 |
options.mli options.ml \ |
| 1928 |
main.mli main.ml) |
| 1929 |
|
| 1930 |
$(eval $(call COMPILE_C_FILE,ocamltest/%.b,ocamltest/%)) |
| 1931 |
$(eval $(call COMPILE_C_FILE,ocamltest/%.n,ocamltest/%)) |
| 1932 |
|
| 1933 |
ifeq "$(COMPUTE_DEPS)" "true" |
| 1934 |
include $(addprefix $(DEPDIR)/, $(ocamltest_C_FILES:.c=.$(D))) |
| 1935 |
endif |
| 1936 |
|
| 1937 |
ocamltest_DEP_FILES = $(addprefix $(DEPDIR)/, $(ocamltest_C_FILES:.c=.$(D))) |
| 1938 |
|
| 1939 |
$(ocamltest_DEP_FILES): | $(DEPDIR)/ocamltest |
| 1940 |
|
| 1941 |
$(DEPDIR)/ocamltest: |
| 1942 |
$(MKDIR) $@ |
| 1943 |
|
| 1944 |
$(ocamltest_DEP_FILES): $(DEPDIR)/ocamltest/%.$(D): ocamltest/%.c |
| 1945 |
$(V_CCDEPS)$(DEP_CC) $(OC_CPPFLAGS) $(CPPFLAGS) $< -MT '$*.$(O)' -MF $@ |
| 1946 |
|
| 1947 |
ocamltest/%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS) |
| 1948 |
|
| 1949 |
ocamltest/%: CAMLOPT = $(BEST_OCAMLOPT) $(STDLIBFLAGS) |
| 1950 |
|
| 1951 |
ocamltest: ocamltest/ocamltest$(EXE) \ |
| 1952 |
testsuite/lib/lib.cmo testsuite/lib/testing.cma testsuite/tools/expect$(EXE) |
| 1953 |
|
| 1954 |
testsuite/lib/%: VPATH += testsuite/lib |
| 1955 |
|
| 1956 |
testing_SOURCES = testsuite/lib/testing.mli testsuite/lib/testing.ml |
| 1957 |
testing_LIBRARIES = |
| 1958 |
|
| 1959 |
$(addprefix testsuite/lib/testing., cma cmxa): \ |
| 1960 |
OC_COMMON_LINKFLAGS += -linkall |
| 1961 |
|
| 1962 |
testsuite/tools/%: VPATH += testsuite/tools |
| 1963 |
|
| 1964 |
expect_SOURCES = $(addprefix testsuite/tools/,expect.mli expect.ml) |
| 1965 |
expect_LIBRARIES = $(addprefix compilerlibs/,\ |
| 1966 |
ocamlcommon ocamlbytecomp ocamltoplevel) |
| 1967 |
|
| 1968 |
testsuite/tools/expect$(EXE): OC_BYTECODE_LINKFLAGS += -linkall |
| 1969 |
|
| 1970 |
codegen_SOURCES = $(addprefix testsuite/tools/,\ |
| 1971 |
parsecmmaux.mli parsecmmaux.ml \ |
| 1972 |
parsecmm.mly \ |
| 1973 |
lexcmm.mli lexcmm.mll \ |
| 1974 |
codegen_main.mli codegen_main.ml) |
| 1975 |
codegen_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamloptcomp) |
| 1976 |
|
| 1977 |
# The asmgen tests are not ported to MSVC64 yet, so make sure |
| 1978 |
# to compile the arch specific module they require only if necessary |
| 1979 |
ifeq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64" |
| 1980 |
asmgen_OBJECT = |
| 1981 |
else |
| 1982 |
asmgen_MODULE = testsuite/tools/asmgen_$(ARCH) |
| 1983 |
asmgen_SOURCE = $(asmgen_MODULE).S |
| 1984 |
asmgen_OBJECT = $(asmgen_MODULE).$(O) |
| 1985 |
$(asmgen_OBJECT): $(asmgen_SOURCE) |
| 1986 |
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR) |
| 1987 |
endif |
| 1988 |
|
| 1989 |
ocamltest/ocamltest$(EXE): OC_BYTECODE_LINKFLAGS += -custom -g |
| 1990 |
|
| 1991 |
ocamltest/ocamltest$(EXE): ocamlc ocamlyacc ocamllex |
| 1992 |
|
| 1993 |
ocamltest.opt: ocamltest/ocamltest.opt$(EXE) \ |
| 1994 |
testsuite/lib/testing.cmxa $(asmgen_OBJECT) testsuite/tools/codegen$(EXE) |
| 1995 |
|
| 1996 |
ocamltest/ocamltest.opt$(EXE): ocamlopt ocamlyacc ocamllex |
| 1997 |
|
| 1998 |
# ocamltest does _not_ want to have access to the Unix interface by default, |
| 1999 |
# to ensure functions and types are only used via Ocamltest_stdlib.Unix |
| 2000 |
# (see #9797) |
| 2001 |
ocamltest/%: \ |
| 2002 |
VPATH := $(filter-out $(unix_directory), $(VPATH)) |
| 2003 |
|
| 2004 |
# Ocamltest_unix and the linking of the executable itself should include the |
| 2005 |
# Unix library, if it's being built. |
| 2006 |
ocamltest/ocamltest_unix.% \ |
| 2007 |
ocamltest/ocamltest$(EXE) ocamltest/ocamltest.opt$(EXE): \ |
| 2008 |
VPATH += $(unix_directory) |
| 2009 |
|
| 2010 |
# For flambda mode, it is necessary for Ocamltest_unix to be compiled with |
| 2011 |
# -opaque to prevent errors compiling the other modules of ocamltest. |
| 2012 |
ocamltest/ocamltest_unix.%: \ |
| 2013 |
OC_COMMON_COMPFLAGS += -opaque |
| 2014 |
else # ifeq "$(build_ocamltest)" "true" |
| 2015 |
ocamltest_TARGETS = ocamltest ocamltest.opt |
| 2016 |
.PHONY: $(ocamltest_TARGETS) |
| 2017 |
$(ocamltest_TARGETS): |
| 2018 |
@echo ocamltest is disabled |
| 2019 |
@echo To build it, run configure again with --enable-ocamltest |
| 2020 |
@false |
| 2021 |
endif # ifeq "$(build_ocamltest)" "true" |
| 2022 |
|
| 2023 |
partialclean:: |
| 2024 |
rm -f ocamltest/ocamltest ocamltest/ocamltest.exe |
| 2025 |
rm -f ocamltest/ocamltest.opt ocamltest/ocamltest.opt.exe |
| 2026 |
rm -f $(addprefix ocamltest/,*.o *.obj *.cm*) |
| 2027 |
rm -f $(patsubst %.mll,%.ml, $(wildcard ocamltest/*.mll)) |
| 2028 |
rm -f $(patsubst %.mly,%.ml, $(wildcard ocamltest/*.mly)) |
| 2029 |
rm -f $(patsubst %.mly,%.mli, $(wildcard ocamltest/*.mly)) |
| 2030 |
rm -f $(patsubst %.mly,%.output, $(wildcard ocamltest/*.mly)) |
| 2031 |
rm -f ocamltest/ocamltest.html |
| 2032 |
rm -f $(addprefix testsuite/lib/*.,cm* o obj a lib) |
| 2033 |
rm -f $(addprefix testsuite/tools/*.,cm* o obj a lib) |
| 2034 |
rm -f testsuite/tools/codegen testsuite/tools/codegen.exe |
| 2035 |
rm -f testsuite/tools/expect testsuite/tools/expect.exe |
| 2036 |
rm -f testsuite/tools/lexcmm.ml |
| 2037 |
rm -f $(addprefix testsuite/tools/parsecmm., ml mli output) |
| 2038 |
|
| 2039 |
# Documentation |
| 2040 |
|
| 2041 |
.PHONY: html_doc |
| 2042 |
html_doc: ocamldoc |
| 2043 |
$(MAKE) -C api_docgen html |
| 2044 |
|
| 2045 |
.PHONY: manpages |
| 2046 |
manpages: |
| 2047 |
$(MAKE) -C api_docgen man |
| 2048 |
|
| 2049 |
partialclean:: |
| 2050 |
rm -f ocamldoc/ocamldoc ocamldoc/ocamldoc.exe |
| 2051 |
rm -f ocamldoc/ocamldoc.opt ocamldoc/ocamldoc.opt.exe |
| 2052 |
rm -f ocamldoc/\#*\# |
| 2053 |
rm -f ocamldoc/*.cm[aiotx] ocamldoc/*.cmxa ocamldoc/*.cmti \ |
| 2054 |
ocamldoc/*.a ocamldoc/*.lib ocamldoc/*.o ocamldoc/*.obj |
| 2055 |
rm -f ocamldoc/odoc_parser.output ocamldoc/odoc_text_parser.output |
| 2056 |
rm -f ocamldoc/odoc_lexer.ml ocamldoc/odoc_text_lexer.ml \ |
| 2057 |
ocamldoc/odoc_see_lexer.ml ocamldoc/odoc_ocamlhtml.ml |
| 2058 |
rm -f ocamldoc/odoc_parser.ml ocamldoc/odoc_parser.mli \ |
| 2059 |
ocamldoc/odoc_text_parser.ml ocamldoc/odoc_text_parser.mli |
| 2060 |
|
| 2061 |
partialclean:: |
| 2062 |
$(MAKE) -C api_docgen clean |
| 2063 |
|
| 2064 |
# The OCamltest manual |
| 2065 |
|
| 2066 |
.PHONY: ocamltest-manual |
| 2067 |
ocamltest-manual: ocamltest/ocamltest.html |
| 2068 |
|
| 2069 |
ocamltest/ocamltest.html: ocamltest/ocamltest.org |
| 2070 |
pandoc -s --toc -N -f org -t html -o $@ $< |
| 2071 |
|
| 2072 |
# The extra libraries |
| 2073 |
|
| 2074 |
.PHONY: otherlibraries |
| 2075 |
otherlibraries: ocamltools dynlink-all |
| 2076 |
$(MAKE) -C otherlibs all |
| 2077 |
|
| 2078 |
.PHONY: otherlibrariesopt |
| 2079 |
otherlibrariesopt: dynlink-allopt |
| 2080 |
$(MAKE) -C otherlibs allopt |
| 2081 |
|
| 2082 |
otherlibs/unix/unix.cmxa: otherlibrariesopt |
| 2083 |
otherlibs/str/str.cmxa: otherlibrariesopt |
| 2084 |
|
| 2085 |
partialclean:: |
| 2086 |
rm -f otherlibs/dynlink/*.cm[ioaxt] otherlibs/dynlink/*.cmti \ |
| 2087 |
otherlibs/dynlink/*.cmxa otherlibs/dynlink/byte/*.cm[iot] \ |
| 2088 |
otherlibs/dynlink/byte/*.cmti otherlibs/dynlink/native/*.cm[ixt] \ |
| 2089 |
otherlibs/dynlink/native/*.cmti otherlibs/dynlink/native/*.o \ |
| 2090 |
otherlibs/dynlink/native/*.obj |
| 2091 |
$(MAKE) -C otherlibs partialclean |
| 2092 |
|
| 2093 |
clean:: |
| 2094 |
rm -f otherlibs/dynlink/*.a otherlibs/dynlink/*.lib \ |
| 2095 |
otherlibs/dynlink/*.o otherlibs/dynlink/*.obj \ |
| 2096 |
otherlibs/dynlink/*.so otherlibs/dynlink/*.dll \ |
| 2097 |
otherlibs/dynlink/byte/dynlink.mli \ |
| 2098 |
otherlibs/dynlink/native/dynlink.mli \ |
| 2099 |
|
| 2100 |
$(MAKE) -C otherlibs clean |
| 2101 |
|
| 2102 |
# The replay debugger |
| 2103 |
|
| 2104 |
ocamldebug_LIBRARIES = compilerlibs/ocamlcommon \ |
| 2105 |
$(addprefix otherlibs/,unix/unix dynlink/dynlink) |
| 2106 |
|
| 2107 |
# The following dependencies are necessary at the moment, because the |
| 2108 |
# root Makefile does not know yet how to build the other libraries |
| 2109 |
# Once their build will happen in this root Makefile, too, it will become |
| 2110 |
# possible to get rid of these dependencies |
| 2111 |
|
| 2112 |
otherlibs/unix/unix.cma: otherlibraries |
| 2113 |
otherlibs/str/str.cma: otherlibraries |
| 2114 |
|
| 2115 |
debugger/%: VPATH += otherlibs/unix otherlibs/dynlink |
| 2116 |
|
| 2117 |
ocamldebug_COMPILER_SOURCES = $(addprefix toplevel/, \ |
| 2118 |
genprintval.mli genprintval.ml \ |
| 2119 |
topprinters.mli topprinters.ml) |
| 2120 |
|
| 2121 |
# The modules listed in the following variable are packed into ocamldebug.cmo |
| 2122 |
|
| 2123 |
ocamldebug_DEBUGGER_SOURCES = $(addprefix debugger/,\ |
| 2124 |
int64ops.mli int64ops.ml \ |
| 2125 |
primitives.mli primitives.ml \ |
| 2126 |
unix_tools.mli unix_tools.ml \ |
| 2127 |
debugger_config.mli debugger_config.ml \ |
| 2128 |
parameters.mli parameters.ml \ |
| 2129 |
debugger_lexer.mli debugger_lexer.mll \ |
| 2130 |
input_handling.mli input_handling.ml \ |
| 2131 |
question.mli question.ml \ |
| 2132 |
debugcom.mli debugcom.ml \ |
| 2133 |
exec.mli exec.ml \ |
| 2134 |
source.mli source.ml \ |
| 2135 |
pos.mli pos.ml \ |
| 2136 |
checkpoints.mli checkpoints.ml \ |
| 2137 |
events.mli events.ml \ |
| 2138 |
program_loading.mli program_loading.ml \ |
| 2139 |
symbols.mli symbols.ml \ |
| 2140 |
breakpoints.mli breakpoints.ml \ |
| 2141 |
trap_barrier.mli trap_barrier.ml \ |
| 2142 |
history.mli history.ml \ |
| 2143 |
printval.mli printval.ml \ |
| 2144 |
show_source.mli show_source.ml \ |
| 2145 |
time_travel.mli time_travel.ml \ |
| 2146 |
program_management.mli program_management.ml \ |
| 2147 |
frames.mli frames.ml \ |
| 2148 |
eval.mli eval.ml \ |
| 2149 |
show_information.mli show_information.ml \ |
| 2150 |
loadprinter.mli loadprinter.ml \ |
| 2151 |
debugger_parser.mly \ |
| 2152 |
command_line.mli command_line.ml \ |
| 2153 |
main.mli main.ml) |
| 2154 |
|
| 2155 |
ocamldebug_DEBUGGER_OBJECTS = \ |
| 2156 |
$(patsubst %.ml, %.cmo, \ |
| 2157 |
$(patsubst %.mll, %.cmo, \ |
| 2158 |
$(patsubst %.mly, %.cmo, \ |
| 2159 |
$(filter-out %.mli, $(ocamldebug_DEBUGGER_SOURCES))))) |
| 2160 |
|
| 2161 |
ocamldebug_SOURCES = \ |
| 2162 |
$(ocamldebug_COMPILER_SOURCES) \ |
| 2163 |
$(addprefix debugger/, \ |
| 2164 |
ocamldebug.ml \ |
| 2165 |
ocamldebug_entry.mli ocamldebug_entry.ml) |
| 2166 |
|
| 2167 |
ocamldebug_BYTECODE_LINKFLAGS = -linkall |
| 2168 |
|
| 2169 |
debugger/%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS) |
| 2170 |
|
| 2171 |
.PHONY: ocamldebug ocamldebugger |
| 2172 |
ocamldebug: debugger/ocamldebug$(EXE) |
| 2173 |
ocamldebugger: debugger/ocamldebug$(EXE) |
| 2174 |
# the 'ocamldebugger' target is an alias of 'ocamldebug' for |
| 2175 |
# backward-compatibility with old ./configure scripts; it can be |
| 2176 |
# removed after most contributors have re-run ./configure once, for |
| 2177 |
# example after 5.2 is branched |
| 2178 |
|
| 2179 |
debugger/ocamldebug$(EXE): ocamlc ocamlyacc ocamllex |
| 2180 |
|
| 2181 |
$(ocamldebug_DEBUGGER_OBJECTS): OC_COMMON_COMPFLAGS += -for-pack ocamldebug |
| 2182 |
debugger/ocamldebug.cmo: $(ocamldebug_DEBUGGER_OBJECTS) |
| 2183 |
$(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -pack -o $@ $^ |
| 2184 |
|
| 2185 |
debugger/ocamldebug_entry.cmo: debugger/ocamldebug.cmo |
| 2186 |
|
| 2187 |
clean:: |
| 2188 |
rm -f debugger/ocamldebug debugger/ocamldebug.exe |
| 2189 |
rm -f debugger/debugger_lexer.ml |
| 2190 |
rm -f $(addprefix debugger/debugger_parser.,ml mli output) |
| 2191 |
|
| 2192 |
beforedepend:: debugger/debugger_lexer.ml |
| 2193 |
|
| 2194 |
beforedepend:: debugger/debugger_parser.ml debugger/debugger_parser.mli |
| 2195 |
|
| 2196 |
# Check that the native-code compiler is supported |
| 2197 |
.PHONY: checknative |
| 2198 |
checknative: |
| 2199 |
ifeq "$(NATIVE_COMPILER)" "false" |
| 2200 |
$(error The source tree was configured with --disable-native-compiler!) |
| 2201 |
else |
| 2202 |
ifeq "$(ARCH)" "none" |
| 2203 |
$(error The native-code compiler is not supported on this platform) |
| 2204 |
else |
| 2205 |
@ |
| 2206 |
endif |
| 2207 |
endif |
| 2208 |
|
| 2209 |
# Check that the stack limit is reasonable (Unix-only) |
| 2210 |
.PHONY: checkstack |
| 2211 |
ifeq "$(UNIX_OR_WIN32)" "unix" |
| 2212 |
checkstack: tools/checkstack$(EXE) |
| 2213 |
$< |
| 2214 |
|
| 2215 |
.INTERMEDIATE: tools/checkstack$(EXE) tools/checkstack.$(O) |
| 2216 |
tools/checkstack$(EXE): tools/checkstack.$(O) |
| 2217 |
$(V_MKEXE)$(MKEXE) $(OUTPUTEXE)$@ $< |
| 2218 |
else |
| 2219 |
checkstack: |
| 2220 |
@ |
| 2221 |
endif |
| 2222 |
|
| 2223 |
# Lint @since and @deprecated annotations |
| 2224 |
|
| 2225 |
lintapidiff_LIBRARIES = \ |
| 2226 |
$(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) \ |
| 2227 |
otherlibs/str/str |
| 2228 |
lintapidiff_SOURCES = tools/lintapidiff.mli tools/lintapidiff.ml |
| 2229 |
|
| 2230 |
tools/lintapidiff.opt$(EXE): VPATH += otherlibs/str |
| 2231 |
|
| 2232 |
VERSIONS=$(shell git tag|grep '^[0-9]*.[0-9]*.[0-9]*$$'|grep -v '^[12].') |
| 2233 |
.PHONY: lintapidiff |
| 2234 |
lintapidiff: tools/lintapidiff.opt$(EXE) |
| 2235 |
git ls-files -- 'otherlibs/*/*.mli' 'stdlib/*.mli' |\ |
| 2236 |
grep -Ev internal\|obj\|stdLabels\|moreLabels |\ |
| 2237 |
tools/lintapidiff.opt $(VERSIONS) |
| 2238 |
|
| 2239 |
# Regenerate otherlibs/dynlink/byte/dynlink_symtable from its bytecomp sources |
| 2240 |
|
| 2241 |
sync_dynlink_SOURCES = tools/sync_dynlink.mli tools/sync_dynlink.ml |
| 2242 |
sync_dynlink_LIBRARIES = |
| 2243 |
|
| 2244 |
.PHONY: sync_dynlink |
| 2245 |
sync_dynlink: tools/sync_dynlink.opt$(EXE) |
| 2246 |
./tools/sync_dynlink.opt$(EXE) \ |
| 2247 |
otherlibs/dynlink/byte/dynlink_symtable.ml \ |
| 2248 |
> synced_dynlink.tmp |
| 2249 |
diff -u synced_dynlink.tmp otherlibs/dynlink/byte/dynlink_symtable.ml |
| 2250 |
rm synced_dynlink.tmp |
| 2251 |
# Tools |
| 2252 |
|
| 2253 |
TOOLS_BYTECODE_TARGETS = \ |
| 2254 |
$(TOOLS_NAT_PROGRAMS) $(TOOLS_BYT_PROGRAMS) $(TOOLS_MODULES:=.cmo) |
| 2255 |
|
| 2256 |
TOOLS_NATIVE_TARGETS = $(TOOLS_MODULES:=.cmx) |
| 2257 |
|
| 2258 |
TOOLS_OPT_TARGETS = $(TOOLS_NAT_PROGRAMS:=.opt) |
| 2259 |
|
| 2260 |
.PHONY: ocamltools |
| 2261 |
ocamltools: ocamlc ocamllex |
| 2262 |
$(MAKE) tools-all |
| 2263 |
|
| 2264 |
.PHONY: tools-all |
| 2265 |
tools-all: $(TOOLS_BYTECODE_TARGETS) |
| 2266 |
|
| 2267 |
.PHONY: tools-allopt |
| 2268 |
tools-allopt: $(TOOLS_NATIVE_TARGETS) |
| 2269 |
|
| 2270 |
.PHONY: tools-allopt.opt |
| 2271 |
tools-allopt.opt: $(TOOLS_OPT_TARGETS) |
| 2272 |
|
| 2273 |
.PHONY: ocamltoolsopt |
| 2274 |
ocamltoolsopt: ocamlopt |
| 2275 |
$(MAKE) tools-allopt |
| 2276 |
|
| 2277 |
.PHONY: ocamltoolsopt.opt |
| 2278 |
ocamltoolsopt.opt: ocamlc.opt ocamllex.opt |
| 2279 |
$(MAKE) tools-allopt.opt |
| 2280 |
|
| 2281 |
# Tools that require a full ocaml distribution: otherlibs and toplevel |
| 2282 |
|
| 2283 |
OTHER_TOOLS = |
| 2284 |
|
| 2285 |
ocamltex = tools/ocamltex$(EXE) |
| 2286 |
|
| 2287 |
ifeq "$(build_ocamltex)" "true" |
| 2288 |
OTHER_TOOLS += $(ocamltex) |
| 2289 |
endif |
| 2290 |
|
| 2291 |
.PHONY: othertools |
| 2292 |
othertools: $(OTHER_TOOLS) |
| 2293 |
|
| 2294 |
partialclean:: |
| 2295 |
for prefix in cm* dll so lib a obj; do \ |
| 2296 |
rm -f tools/*.$$prefix; \ |
| 2297 |
done |
| 2298 |
|
| 2299 |
# The dependency generator |
| 2300 |
|
| 2301 |
ocamldep_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 2302 |
ocamldep_SOURCES = tools/ocamldep.mli tools/ocamldep.ml |
| 2303 |
|
| 2304 |
tools/ocamldep$(EXE): OC_BYTECODE_LINKFLAGS += -compat-32 |
| 2305 |
|
| 2306 |
# The profiler |
| 2307 |
|
| 2308 |
ocamlprof_LIBRARIES = |
| 2309 |
ocamlprof_SOURCES = \ |
| 2310 |
config.mli config.ml \ |
| 2311 |
build_path_prefix_map.mli build_path_prefix_map.ml \ |
| 2312 |
format_doc.mli format_doc.ml \ |
| 2313 |
misc.mli misc.ml \ |
| 2314 |
identifiable.mli identifiable.ml \ |
| 2315 |
numbers.mli numbers.ml \ |
| 2316 |
arg_helper.mli arg_helper.ml \ |
| 2317 |
local_store.mli local_store.ml \ |
| 2318 |
load_path.mli load_path.ml \ |
| 2319 |
clflags.mli clflags.ml \ |
| 2320 |
terminfo.mli terminfo.ml \ |
| 2321 |
warnings.mli warnings.ml \ |
| 2322 |
location.mli location.ml \ |
| 2323 |
longident.mli longident.ml \ |
| 2324 |
docstrings.mli docstrings.ml \ |
| 2325 |
syntaxerr.mli syntaxerr.ml \ |
| 2326 |
ast_helper.mli ast_helper.ml \ |
| 2327 |
ast_iterator.mli ast_iterator.ml \ |
| 2328 |
builtin_attributes.mli builtin_attributes.ml \ |
| 2329 |
camlinternalMenhirLib.mli camlinternalMenhirLib.ml \ |
| 2330 |
parser.mli parser.ml \ |
| 2331 |
lexer.mli lexer.ml \ |
| 2332 |
pprintast.mli pprintast.ml \ |
| 2333 |
parse.mli parse.ml \ |
| 2334 |
ocamlprof.mli ocamlprof.ml |
| 2335 |
|
| 2336 |
ocamlcp_ocamloptp_SOURCES = \ |
| 2337 |
config.mli config.ml \ |
| 2338 |
build_path_prefix_map.mli build_path_prefix_map.ml \ |
| 2339 |
format_doc.mli format_doc.ml \ |
| 2340 |
misc.mli misc.ml \ |
| 2341 |
profile.mli profile.ml \ |
| 2342 |
warnings.mli warnings.ml \ |
| 2343 |
identifiable.mli identifiable.ml \ |
| 2344 |
numbers.mli numbers.ml \ |
| 2345 |
arg_helper.mli arg_helper.ml \ |
| 2346 |
local_store.mli local_store.ml \ |
| 2347 |
load_path.mli load_path.ml \ |
| 2348 |
clflags.mli clflags.ml \ |
| 2349 |
terminfo.mli terminfo.ml \ |
| 2350 |
location.mli location.ml \ |
| 2351 |
ccomp.mli ccomp.ml \ |
| 2352 |
compenv.mli compenv.ml \ |
| 2353 |
main_args.mli main_args.ml \ |
| 2354 |
ocamlcp_common.mli ocamlcp_common.ml |
| 2355 |
|
| 2356 |
ocamlcp_LIBRARIES = |
| 2357 |
ocamlcp_SOURCES = $(ocamlcp_ocamloptp_SOURCES) ocamlcp.mli ocamlcp.ml |
| 2358 |
|
| 2359 |
ocamloptp_LIBRARIES = |
| 2360 |
ocamloptp_SOURCES = $(ocamlcp_ocamloptp_SOURCES) ocamloptp.mli ocamloptp.ml |
| 2361 |
|
| 2362 |
# To help building mixed-mode libraries (OCaml + C) |
| 2363 |
ocamlmklib_LIBRARIES = |
| 2364 |
ocamlmklib_SOURCES = \ |
| 2365 |
config.ml \ |
| 2366 |
build_path_prefix_map.ml \ |
| 2367 |
format_doc.ml \ |
| 2368 |
misc.ml \ |
| 2369 |
ocamlmklib.mli ocamlmklib.ml |
| 2370 |
|
| 2371 |
# To make custom toplevels |
| 2372 |
|
| 2373 |
ocamlmktop_LIBRARIES = |
| 2374 |
ocamlmktop_SOURCES = \ |
| 2375 |
config.mli config.ml \ |
| 2376 |
build_path_prefix_map.mli build_path_prefix_map.ml \ |
| 2377 |
format_doc.mli format_doc.ml \ |
| 2378 |
misc.mli misc.ml \ |
| 2379 |
identifiable.mli identifiable.ml \ |
| 2380 |
numbers.mli numbers.ml \ |
| 2381 |
arg_helper.mli arg_helper.ml \ |
| 2382 |
local_store.mli local_store.ml \ |
| 2383 |
load_path.mli load_path.ml \ |
| 2384 |
clflags.mli clflags.ml \ |
| 2385 |
profile.mli profile.ml \ |
| 2386 |
ccomp.mli ccomp.ml \ |
| 2387 |
ocamlmktop.mli ocamlmktop.ml |
| 2388 |
|
| 2389 |
# Reading cmt files |
| 2390 |
|
| 2391 |
ocamlcmt_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 2392 |
ocamlcmt_SOURCES = tools/ocamlcmt.mli tools/ocamlcmt.ml |
| 2393 |
|
| 2394 |
# The bytecode disassembler |
| 2395 |
|
| 2396 |
dumpobj_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 2397 |
dumpobj_SOURCES = $(addprefix tools/, \ |
| 2398 |
opnames.mli opnames.ml \ |
| 2399 |
dumpobj.mli dumpobj.ml) |
| 2400 |
|
| 2401 |
make_opcodes = tools/make_opcodes$(EXE) |
| 2402 |
|
| 2403 |
make_opcodes_LIBRARIES = |
| 2404 |
make_opcodes_SOURCES = tools/make_opcodes.mli tools/make_opcodes.mll |
| 2405 |
|
| 2406 |
tools/opnames.ml: runtime/caml/instruct.h $(make_opcodes) |
| 2407 |
$(V_GEN)$(NEW_OCAMLRUN) $(make_opcodes) -opnames < $< > $@ |
| 2408 |
|
| 2409 |
clean:: |
| 2410 |
rm -f $(addprefix tools/,opnames.ml make_opcodes.ml) |
| 2411 |
|
| 2412 |
beforedepend:: $(addprefix tools/,opnames.ml make_opcodes.ml) |
| 2413 |
|
| 2414 |
# Display info on compiled files |
| 2415 |
|
| 2416 |
ocamlobjinfo_LIBRARIES = \ |
| 2417 |
$(addprefix compilerlibs/,ocamlcommon ocamlbytecomp ocamlmiddleend) |
| 2418 |
ocamlobjinfo_SOURCES = tools/objinfo.mli tools/objinfo.ml |
| 2419 |
|
| 2420 |
# Scan object files for required primitives |
| 2421 |
|
| 2422 |
primreq_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 2423 |
primreq_SOURCES = tools/primreq.mli tools/primreq.ml |
| 2424 |
|
| 2425 |
# Copy a bytecode executable, stripping debug info |
| 2426 |
|
| 2427 |
stripdebug_LIBRARIES = \ |
| 2428 |
$(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 2429 |
stripdebug_SOURCES = tools/stripdebug.mli tools/stripdebug.ml |
| 2430 |
|
| 2431 |
# Compare two bytecode executables |
| 2432 |
|
| 2433 |
cmpbyt_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp) |
| 2434 |
cmpbyt_SOURCES = tools/cmpbyt.mli tools/cmpbyt.ml |
| 2435 |
|
| 2436 |
# Scan latex files, and run ocaml code examples |
| 2437 |
|
| 2438 |
ocamltex_LIBRARIES = \ |
| 2439 |
$(addprefix compilerlibs/,ocamlcommon ocamlbytecomp ocamltoplevel) \ |
| 2440 |
$(addprefix otherlibs/,str/str unix/unix) |
| 2441 |
ocamltex_SOURCES = tools/ocamltex.mli tools/ocamltex.ml |
| 2442 |
|
| 2443 |
# ocamltex uses str.cma and unix.cma and so must be compiled with |
| 2444 |
# $(ROOTDIR)/ocamlc rather than with $(ROOTDIR)/boot/ocamlc since the boot |
| 2445 |
# compiler does not necessarily have the correct shared library |
| 2446 |
# configuration. |
| 2447 |
# Note: the following definitions apply to all the prerequisites |
| 2448 |
# of ocamltex. |
| 2449 |
$(ocamltex): CAMLC = $(OCAMLRUN) $(ROOTDIR)/ocamlc$(EXE) $(STDLIBFLAGS) |
| 2450 |
$(ocamltex): OC_COMMON_LINKFLAGS += -linkall |
| 2451 |
$(ocamltex): VPATH += $(addprefix otherlibs/,str unix) |
| 2452 |
|
| 2453 |
tools/ocamltex.cmo: OC_COMMON_COMPFLAGS += -no-alias-deps |
| 2454 |
|
| 2455 |
# we need str and unix which depend on the bytecode version of other tools |
| 2456 |
# thus we use the othertools target |
| 2457 |
## Test compilation of backend-specific parts |
| 2458 |
|
| 2459 |
ARCH_SPECIFIC =\ |
| 2460 |
asmcomp/arch.mli asmcomp/arch.ml asmcomp/proc.ml asmcomp/CSE.ml \ |
| 2461 |
asmcomp/selection.ml asmcomp/scheduling.ml asmcomp/reload.ml \ |
| 2462 |
asmcomp/stackframe.ml |
| 2463 |
|
| 2464 |
partialclean:: |
| 2465 |
rm -f $(ARCH_SPECIFIC) |
| 2466 |
|
| 2467 |
beforedepend:: $(ARCH_SPECIFIC) |
| 2468 |
|
| 2469 |
# This rule provides a quick way to check that machine-dependent |
| 2470 |
# files compiles fine for a foreign architecture (passed as ARCH=xxx). |
| 2471 |
|
| 2472 |
.PHONY: check_arch |
| 2473 |
check_arch: |
| 2474 |
@echo "========= CHECKING asmcomp/$(ARCH) ==============" |
| 2475 |
@rm -f $(ARCH_SPECIFIC) asmcomp/emit.ml asmcomp/*.cm* |
| 2476 |
@$(MAKE) compilerlibs/ocamloptcomp.cma \ |
| 2477 |
>/dev/null |
| 2478 |
@rm -f $(ARCH_SPECIFIC) asmcomp/emit.ml asmcomp/*.cm* |
| 2479 |
|
| 2480 |
.PHONY: check_all_arches |
| 2481 |
check_all_arches: |
| 2482 |
ifeq ($(ARCH64),true) |
| 2483 |
@STATUS=0; \ |
| 2484 |
for i in $(ARCHES); do \ |
| 2485 |
$(MAKE) --no-print-directory check_arch ARCH=$$i || STATUS=1; \ |
| 2486 |
done; \ |
| 2487 |
exit $$STATUS |
| 2488 |
else |
| 2489 |
@echo "Architecture tests are disabled on 32-bit platforms." |
| 2490 |
endif |
| 2491 |
|
| 2492 |
# The native toplevel |
| 2493 |
|
| 2494 |
ocamlnat_LIBRARIES = \ |
| 2495 |
compilerlibs/ocamlcommon compilerlibs/ocamloptcomp \ |
| 2496 |
compilerlibs/ocamlbytecomp otherlibs/dynlink/dynlink \ |
| 2497 |
compilerlibs/ocamltoplevel |
| 2498 |
|
| 2499 |
ocamlnat_SOURCES = $(ocaml_SOURCES) |
| 2500 |
|
| 2501 |
ocamlnat$(EXE): OC_NATIVE_LINKFLAGS += -linkall -I toplevel/native |
| 2502 |
|
| 2503 |
COMPILE_NATIVE_MODULE = \ |
| 2504 |
$(CAMLOPT) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) \ |
| 2505 |
$(OC_NATIVE_COMPFLAGS) |
| 2506 |
|
| 2507 |
|
| 2508 |
toplevel/topdirs.cmx toplevel/toploop.cmx $(ocamlnat_CMX_FILES): \ |
| 2509 |
OC_NATIVE_COMPFLAGS += -I toplevel/native |
| 2510 |
|
| 2511 |
toplevel/toploop.cmx: toplevel/native/topeval.cmx |
| 2512 |
|
| 2513 |
$(ocamlnat_CMX_FILES): toplevel/native/topmain.cmx |
| 2514 |
|
| 2515 |
partialclean:: |
| 2516 |
rm -f ocamlnat ocamlnat.exe |
| 2517 |
|
| 2518 |
toplevel/native/topeval.cmx: otherlibs/dynlink/dynlink.cmxa |
| 2519 |
|
| 2520 |
# The numeric opcodes |
| 2521 |
|
| 2522 |
bytecomp/opcodes.ml: runtime/caml/instruct.h $(make_opcodes) |
| 2523 |
$(V_GEN)$(NEW_OCAMLRUN) $(make_opcodes) -opcodes < $< > $@ |
| 2524 |
|
| 2525 |
bytecomp/opcodes.mli: bytecomp/opcodes.ml |
| 2526 |
$(V_GEN)$(CAMLC) -i $< > $@ |
| 2527 |
|
| 2528 |
partialclean:: |
| 2529 |
rm -f bytecomp/opcodes.ml |
| 2530 |
rm -f bytecomp/opcodes.mli |
| 2531 |
|
| 2532 |
beforedepend:: bytecomp/opcodes.ml bytecomp/opcodes.mli |
| 2533 |
|
| 2534 |
ifneq "$(wildcard .git)" "" |
| 2535 |
include Makefile.dev |
| 2536 |
endif |
| 2537 |
|
| 2538 |
# Default rules |
| 2539 |
|
| 2540 |
%.cmo: %.ml |
| 2541 |
$(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) -c $< |
| 2542 |
|
| 2543 |
%.cmi: %.mli |
| 2544 |
$(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) -c $< |
| 2545 |
|
| 2546 |
%.cmx: %.ml |
| 2547 |
$(V_OCAMLOPT)$(COMPILE_NATIVE_MODULE) -c $< |
| 2548 |
|
| •2549 |
utils/config.cmi: utils/config.mli |
| 2550 |
$(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) -opaque -c $< |
| 2551 |
|
| 2552 |
utils/config.cmx: utils/config.ml |
| 2553 |
$(V_OCAMLOPT)$(COMPILE_NATIVE_MODULE) -opaque -c $< |
| 2554 |
|
| 2555 |
partialclean:: |
| 2556 |
for d in utils parsing typing bytecomp asmcomp middle_end file_formats \ |
| 2557 |
lambda middle_end/closure middle_end/flambda \ |
| 2558 |
middle_end/flambda/base_types \ |
| 2559 |
driver toplevel toplevel/byte toplevel/native tools debugger; do \ |
| 2560 |
rm -f $$d/*.cm[ioxt] $$d/*.cmti $$d/*.annot $$d/*.s $$d/*.asm \ |
| 2561 |
$$d/*.o $$d/*.obj $$d/*.so $$d/*.dll; \ |
| 2562 |
done |
| 2563 |
|
| 2564 |
%.depend: beforedepend |
| 2565 |
$(V_OCAMLDEP)$(OCAMLDEP) $(OC_OCAMLDEPFLAGS) -I $* $(INCLUDES) \ |
| 2566 |
$(OCAMLDEPFLAGS) $*/*.mli $*/*.ml > $@ |
| 2567 |
|
| 2568 |
asmcomp.depend:: beforedepend $(cvt_emit) |
| 2569 |
$(V_OCAMLDEP)$(OCAMLDEP) $(OC_OCAMLDEPFLAGS) -I asmcomp $(INCLUDES) \ |
| 2570 |
$(OCAMLDEPFLAGS) $(filter-out $(ARCH_SPECIFIC) asmcomp/emit.ml, \ |
| 2571 |
$(wildcard asmcomp/*.mli asmcomp/*.ml)) > $@ |
| 2572 |
|
| 2573 |
partialclean:: |
| 2574 |
rm -f $(addsuffix .depend, $(ARCH_SPECIFIC) asmcomp/emit.ml) |
| 2575 |
|
| 2576 |
# asmcomp.depend contains the dependencies for all the backends, with ifeq used |
| 2577 |
# to select the correct one depending on the ARCH variable. In order to |
| 2578 |
# generate this file, we must temporarily replace the $(ARCH_SPECIFIC) files |
| 2579 |
# with the ones for each architecture. At the end of this process, the files for |
| 2580 |
# the active architecture (i.e. $(ARCH)) must be restored, but if we simply |
| 2581 |
# re-link the files we will trigger a complete rebuild of the native compiler |
| 2582 |
# and .opt binaries. The recipe for asmcomp.depend therefore begins by renaming |
| 2583 |
# the existing files, then it generates asmcomp.depend and then we rename the |
| 2584 |
# files back. This means their timestamps are unaltered, and the next invocation |
| 2585 |
# of make therefore correctly doesn't rebuild anything. |
| 2586 |
|
| 2587 |
define MV_FILE |
| 2588 |
asmcomp.depend:: |
| 2589 |
@mv $(1) $(2) |
| 2590 |
|
| 2591 |
endef |
| 2592 |
|
| 2593 |
$(foreach file, asmcomp/emit.ml $(ARCH_SPECIFIC),\ |
| 2594 |
$(eval $(call MV_FILE,$(file),$(file).depend))) |
| 2595 |
|
| 2596 |
define ADD_ARCH_SPECIFIC_DEPS |
| 2597 |
asmcomp.depend:: |
| 2598 |
@echo 'ifeq "$$$$(ARCH)" "$(1)"' > asmcomp/$(1).depend |
| 2599 |
@$$(MAKE) ARCH=$(1) asmcomp/emit.ml $$(ARCH_SPECIFIC) |
| 2600 |
@$$(OCAMLDEP) $$(OC_OCAMLDEPFLAGS) -I asmcomp $$(INCLUDES) \ |
| 2601 |
$$(OCAMLDEPFLAGS) asmcomp/emit.ml $$(ARCH_SPECIFIC) >> asmcomp/$(1).depend |
| 2602 |
@echo 'endif # ifeq "$$$$(ARCH)" "$(1)"' >> asmcomp/$(1).depend |
| 2603 |
@rm -f asmcomp/emit.ml $$(ARCH_SPECIFIC) |
| 2604 |
|
| 2605 |
endef |
| 2606 |
|
| 2607 |
$(foreach arch, $(ARCHES),\ |
| 2608 |
$(eval $(call ADD_ARCH_SPECIFIC_DEPS,$(arch)))) |
| 2609 |
|
| 2610 |
asmcomp.depend:: |
| 2611 |
@cat $(addprefix asmcomp/, $(addsuffix .depend, $(ARCHES))) >> $@ |
| 2612 |
@rm -f $(addprefix asmcomp/, $(addsuffix .depend, $(ARCHES))) |
| 2613 |
|
| 2614 |
$(foreach file, asmcomp/emit.ml $(ARCH_SPECIFIC),\ |
| 2615 |
$(eval $(call MV_FILE,$(file).depend,$(file)))) |
| 2616 |
|
| 2617 |
DEP_DIRS = \ |
| 2618 |
utils parsing typing bytecomp asmcomp middle_end lambda file_formats \ |
| 2619 |
middle_end/closure middle_end/flambda middle_end/flambda/base_types driver \ |
| 2620 |
toplevel toplevel/byte toplevel/native lex tools debugger ocamldoc ocamltest \ |
| 2621 |
testsuite/lib testsuite/tools otherlibs/dynlink |
| 2622 |
|
| 2623 |
DEP_FILES = $(addsuffix .depend, $(DEP_DIRS)) |
| 2624 |
|
| 2625 |
.INTERMEDIATE: $(DEP_FILES) |
| 2626 |
|
| 2627 |
.PHONY: depend |
| 2628 |
depend: $(DEP_FILES) | beforedepend |
| 2629 |
$(V_GEN)cat $^ > .$@ |
| 2630 |
@rm -f $(DYNLINK_DEPEND_DUMMY_FILES) |
| 2631 |
|
| 2632 |
.PHONY: distclean |
| 2633 |
distclean: clean |
| 2634 |
ifneq "$(FLEXDLL_SUBMODULE_PRESENT)" "" |
| 2635 |
$(MAKE) -C flexdll distclean MSVC_DETECT=0 |
| 2636 |
endif |
| 2637 |
$(MAKE) -C manual distclean |
| 2638 |
rm -f ocamldoc/META |
| 2639 |
rm -f $(addprefix ocamltest/,ocamltest_config.ml ocamltest_unix.ml) |
| 2640 |
rm -f otherlibs/dynlink/META otherlibs/dynlink/dynlink_config.ml \ |
| 2641 |
otherlibs/dynlink/dynlink_cmo_format.mli \ |
| 2642 |
otherlibs/dynlink/dynlink_cmxs_format.mli \ |
| 2643 |
otherlibs/dynlink/dynlink_platform_intf.mli |
| 2644 |
$(MAKE) -C otherlibs distclean |
| 2645 |
rm -f $(runtime_CONFIGURED_HEADERS) |
| 2646 |
$(MAKE) -C stdlib distclean |
| 2647 |
$(MAKE) -C testsuite distclean |
| 2648 |
rm -f tools/eventlog_metadata tools/*.bak |
| 2649 |
rm -f utils/config.common.ml utils/config.generated.ml |
| 2650 |
rm -f compilerlibs/META |
| 2651 |
rm -f boot/ocamlrun boot/ocamlrun.exe boot/$(HEADER_NAME) \ |
| 2652 |
boot/flexdll_*.o boot/flexdll_*.obj \ |
| 2653 |
boot/*.cm* boot/libcamlrun.a boot/libcamlrun.lib boot/ocamlc.opt |
| 2654 |
rm -f Makefile.config Makefile.build_config |
| 2655 |
rm -rf autom4te.cache winpthreads-sources flexdll-sources \ |
| 2656 |
$(BYTE_BUILD_TREE) $(OPT_BUILD_TREE) |
| 2657 |
rm -f config.log config.status libtool |
| 2658 |
|
| 2659 |
INSTALL_LIBDIR_DYNLINK = $(INSTALL_LIBDIR)/dynlink |
| 2660 |
|
| 2661 |
# Installation |
| 2662 |
.PHONY: install |
| 2663 |
install: |
| 2664 |
$(MKDIR) "$(INSTALL_BINDIR)" |
| 2665 |
$(MKDIR) "$(INSTALL_LIBDIR)" |
| 2666 |
$(MKDIR) "$(INSTALL_STUBLIBDIR)" |
| 2667 |
$(MKDIR) "$(INSTALL_COMPLIBDIR)" |
| 2668 |
$(MKDIR) "$(INSTALL_DOCDIR)" |
| 2669 |
$(MKDIR) "$(INSTALL_INCDIR)" |
| 2670 |
$(MKDIR) "$(INSTALL_LIBDIR_PROFILING)" |
| 2671 |
$(INSTALL_PROG) $(runtime_PROGRAMS) "$(INSTALL_BINDIR)" |
| 2672 |
$(INSTALL_DATA) $(runtime_BYTECODE_STATIC_LIBRARIES) \ |
| 2673 |
"$(INSTALL_LIBDIR)" |
| 2674 |
ifneq "$(runtime_BYTECODE_SHARED_LIBRARIES)" "" |
| 2675 |
$(INSTALL_PROG) $(runtime_BYTECODE_SHARED_LIBRARIES) \ |
| 2676 |
"$(INSTALL_LIBDIR)" |
| 2677 |
endif |
| 2678 |
$(INSTALL_DATA) runtime/caml/domain_state.tbl runtime/caml/*.h \ |
| 2679 |
"$(INSTALL_INCDIR)" |
| 2680 |
$(INSTALL_PROG) ocaml$(EXE) "$(INSTALL_BINDIR)" |
| 2681 |
ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2682 |
$(call INSTALL_STRIPPED_BYTE_PROG,\ |
| 2683 |
ocamlc$(EXE),"$(INSTALL_BINDIR)/ocamlc.byte$(EXE)") |
| 2684 |
endif |
| 2685 |
$(MAKE) -C stdlib install |
| 2686 |
ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2687 |
$(INSTALL_PROG) lex/ocamllex$(EXE) \ |
| 2688 |
"$(INSTALL_BINDIR)/ocamllex.byte$(EXE)" |
| 2689 |
for i in $(TOOLS_TO_INSTALL_NAT); \ |
| 2690 |
do \ |
| 2691 |
$(INSTALL_PROG) "tools/$$i$(EXE)" "$(INSTALL_BINDIR)/$$i.byte$(EXE)";\ |
| 2692 |
if test -f "tools/$$i".opt$(EXE); then \ |
| 2693 |
$(INSTALL_PROG) "tools/$$i.opt$(EXE)" "$(INSTALL_BINDIR)" && \ |
| 2694 |
(cd "$(INSTALL_BINDIR)" && $(LN) "$$i.opt$(EXE)" "$$i$(EXE)"); \ |
| 2695 |
else \ |
| 2696 |
(cd "$(INSTALL_BINDIR)" && $(LN) "$$i.byte$(EXE)" "$$i$(EXE)"); \ |
| 2697 |
fi; \ |
| 2698 |
done |
| 2699 |
else |
| 2700 |
for i in $(TOOLS_TO_INSTALL_NAT); \ |
| 2701 |
do \ |
| 2702 |
if test -f "tools/$$i".opt$(EXE); then \ |
| 2703 |
$(INSTALL_PROG) "tools/$$i.opt$(EXE)" "$(INSTALL_BINDIR)"; \ |
| 2704 |
(cd "$(INSTALL_BINDIR)" && $(LN) "$$i.opt$(EXE)" "$$i$(EXE)"); \ |
| 2705 |
fi; \ |
| 2706 |
done |
| 2707 |
endif |
| 2708 |
for i in $(TOOLS_TO_INSTALL_BYT); \ |
| 2709 |
do \ |
| 2710 |
$(INSTALL_PROG) "tools/$$i$(EXE)" "$(INSTALL_BINDIR)";\ |
| 2711 |
done |
| 2712 |
$(INSTALL_PROG) $(ocamlyacc_PROGRAM)$(EXE) "$(INSTALL_BINDIR)" |
| 2713 |
$(INSTALL_DATA) \ |
| 2714 |
utils/*.cmi \ |
| 2715 |
parsing/*.cmi \ |
| 2716 |
typing/*.cmi \ |
| 2717 |
bytecomp/*.cmi \ |
| 2718 |
file_formats/*.cmi \ |
| 2719 |
lambda/*.cmi \ |
| 2720 |
driver/*.cmi \ |
| 2721 |
toplevel/*.cmi \ |
| 2722 |
"$(INSTALL_COMPLIBDIR)" |
| 2723 |
$(INSTALL_DATA) \ |
| 2724 |
toplevel/byte/*.cmi \ |
| 2725 |
"$(INSTALL_COMPLIBDIR)" |
| 2726 |
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
| 2727 |
$(INSTALL_DATA) \ |
| 2728 |
utils/*.cmt utils/*.cmti utils/*.mli \ |
| 2729 |
parsing/*.cmt parsing/*.cmti parsing/*.mli \ |
| 2730 |
typing/*.cmt typing/*.cmti typing/*.mli \ |
| 2731 |
file_formats/*.cmt file_formats/*.cmti file_formats/*.mli \ |
| 2732 |
lambda/*.cmt lambda/*.cmti lambda/*.mli \ |
| 2733 |
bytecomp/*.cmt bytecomp/*.cmti bytecomp/*.mli \ |
| 2734 |
driver/*.cmt driver/*.cmti driver/*.mli \ |
| 2735 |
toplevel/*.cmt toplevel/*.cmti toplevel/*.mli \ |
| 2736 |
"$(INSTALL_COMPLIBDIR)" |
| 2737 |
$(INSTALL_DATA) \ |
| 2738 |
toplevel/byte/*.cmt \ |
| 2739 |
"$(INSTALL_COMPLIBDIR)" |
| 2740 |
$(INSTALL_DATA) \ |
| 2741 |
tools/profiling.cmt tools/profiling.cmti \ |
| 2742 |
"$(INSTALL_LIBDIR_PROFILING)" |
| 2743 |
endif |
| 2744 |
$(INSTALL_DATA) \ |
| 2745 |
compilerlibs/*.cma compilerlibs/META \ |
| 2746 |
"$(INSTALL_COMPLIBDIR)" |
| 2747 |
$(INSTALL_DATA) \ |
| 2748 |
$(ocamlc_CMO_FILES) $(ocaml_CMO_FILES) \ |
| 2749 |
"$(INSTALL_COMPLIBDIR)" |
| 2750 |
$(INSTALL_PROG) $(expunge) "$(INSTALL_LIBDIR)" |
| 2751 |
# If installing over a previous OCaml version, ensure some modules are removed |
| 2752 |
# from the previous installation. |
| 2753 |
rm -f "$(INSTALL_LIBDIR)"/topdirs.cm* "$(INSTALL_LIBDIR)/topdirs.mli" |
| 2754 |
rm -f "$(INSTALL_LIBDIR)"/profiling.cm* "$(INSTALL_LIBDIR)/profiling.$(O)" |
| 2755 |
$(INSTALL_DATA) \ |
| 2756 |
tools/profiling.cmi tools/profiling.cmo \ |
| 2757 |
"$(INSTALL_LIBDIR_PROFILING)" |
| 2758 |
ifeq "$(UNIX_OR_WIN32)" "unix" # Install manual pages only on Unix |
| 2759 |
$(MAKE) -C man install |
| 2760 |
endif |
| 2761 |
# For dynlink, if installing over a previous OCaml version, ensure |
| 2762 |
# dynlink is removed from the previous installation. |
| 2763 |
rm -f "$(INSTALL_LIBDIR)"/dynlink.cm* "$(INSTALL_LIBDIR)/dynlink.mli" \ |
| 2764 |
"$(INSTALL_LIBDIR)/dynlink.$(A)" \ |
| 2765 |
$(addprefix "$(INSTALL_LIBDIR)/", $(notdir $(dynlink_CMX_FILES))) |
| 2766 |
$(MKDIR) "$(INSTALL_LIBDIR_DYNLINK)" |
| 2767 |
$(INSTALL_DATA) \ |
| 2768 |
otherlibs/dynlink/dynlink.cmi otherlibs/dynlink/dynlink.cma \ |
| 2769 |
otherlibs/dynlink/META \ |
| 2770 |
"$(INSTALL_LIBDIR_DYNLINK)" |
| 2771 |
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
| 2772 |
$(INSTALL_DATA) \ |
| 2773 |
otherlibs/dynlink/dynlink.cmti otherlibs/dynlink/dynlink.mli \ |
| 2774 |
"$(INSTALL_LIBDIR_DYNLINK)" |
| 2775 |
endif |
| 2776 |
for i in $(OTHERLIBS); do \ |
| 2777 |
$(MAKE) -C otherlibs/$$i install || exit $$?; \ |
| 2778 |
done |
| 2779 |
ifeq "$(build_ocamldoc)" "true" |
| 2780 |
$(MKDIR) "$(INSTALL_LIBDIR)/ocamldoc" |
| 2781 |
$(INSTALL_PROG) $(OCAMLDOC) "$(INSTALL_BINDIR)" |
| 2782 |
$(INSTALL_DATA) \ |
| 2783 |
ocamldoc/ocamldoc.hva ocamldoc/*.cmi ocamldoc/odoc_info.cma \ |
| 2784 |
ocamldoc/META \ |
| 2785 |
"$(INSTALL_LIBDIR)/ocamldoc" |
| 2786 |
$(INSTALL_DATA) \ |
| 2787 |
$(OCAMLDOC_LIBCMIS) \ |
| 2788 |
"$(INSTALL_LIBDIR)/ocamldoc" |
| 2789 |
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
| 2790 |
$(INSTALL_DATA) \ |
| 2791 |
$(OCAMLDOC_LIBMLIS) $(OCAMLDOC_LIBCMTS) \ |
| 2792 |
"$(INSTALL_LIBDIR)/ocamldoc" |
| 2793 |
endif |
| 2794 |
endif |
| 2795 |
ifeq "$(build_libraries_manpages)" "true" |
| 2796 |
$(MAKE) -C api_docgen install |
| 2797 |
endif |
| 2798 |
if test -n "$(WITH_DEBUGGER)"; then \ |
| 2799 |
$(INSTALL_PROG) debugger/ocamldebug$(EXE) "$(INSTALL_BINDIR)"; \ |
| 2800 |
fi |
| 2801 |
ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 2802 |
ifeq "$(TOOLCHAIN)" "msvc" |
| 2803 |
$(INSTALL_DATA) $(FLEXDLL_SOURCE_DIR)/$(FLEXDLL_MANIFEST) \ |
| 2804 |
"$(INSTALL_BINDIR)/" |
| 2805 |
endif |
| 2806 |
ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2807 |
$(INSTALL_PROG) \ |
| 2808 |
flexlink.byte$(EXE) "$(INSTALL_BINDIR)" |
| 2809 |
endif # ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2810 |
$(MKDIR) "$(INSTALL_FLEXDLLDIR)" |
| 2811 |
$(INSTALL_DATA) $(FLEXDLL_OBJECTS) "$(INSTALL_FLEXDLLDIR)" |
| 2812 |
endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 2813 |
$(INSTALL_DATA) Makefile.config "$(INSTALL_LIBDIR)" |
| 2814 |
$(INSTALL_DATA) $(DOC_FILES) "$(INSTALL_DOCDIR)" |
| 2815 |
ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2816 |
if test -f ocamlopt$(EXE); then $(MAKE) installopt; else \ |
| 2817 |
cd "$(INSTALL_BINDIR)"; \ |
| 2818 |
$(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ |
| 2819 |
$(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ |
| 2820 |
(test -f flexlink.byte$(EXE) && \ |
| 2821 |
$(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true; \ |
| 2822 |
fi |
| 2823 |
else |
| 2824 |
if test -f ocamlopt$(EXE); then $(MAKE) installopt; fi |
| 2825 |
endif |
| 2826 |
|
| 2827 |
# Installation of the native-code compiler |
| 2828 |
.PHONY: installopt |
| 2829 |
installopt: |
| 2830 |
$(INSTALL_DATA) $(runtime_NATIVE_STATIC_LIBRARIES) "$(INSTALL_LIBDIR)" |
| 2831 |
ifneq "$(runtime_NATIVE_SHARED_LIBRARIES)" "" |
| 2832 |
$(INSTALL_PROG) $(runtime_NATIVE_SHARED_LIBRARIES) "$(INSTALL_LIBDIR)" |
| 2833 |
endif |
| 2834 |
ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2835 |
$(call INSTALL_STRIPPED_BYTE_PROG,\ |
| 2836 |
ocamlopt$(EXE),"$(INSTALL_BINDIR)/ocamlopt.byte$(EXE)") |
| 2837 |
endif |
| 2838 |
$(MAKE) -C stdlib installopt |
| 2839 |
$(INSTALL_DATA) \ |
| 2840 |
middle_end/*.cmi \ |
| 2841 |
"$(INSTALL_COMPLIBDIR)" |
| 2842 |
$(INSTALL_DATA) \ |
| 2843 |
middle_end/closure/*.cmi \ |
| 2844 |
"$(INSTALL_COMPLIBDIR)" |
| 2845 |
$(INSTALL_DATA) \ |
| 2846 |
middle_end/flambda/*.cmi \ |
| 2847 |
"$(INSTALL_COMPLIBDIR)" |
| 2848 |
$(INSTALL_DATA) \ |
| 2849 |
middle_end/flambda/base_types/*.cmi \ |
| 2850 |
"$(INSTALL_COMPLIBDIR)" |
| 2851 |
$(INSTALL_DATA) \ |
| 2852 |
asmcomp/*.cmi \ |
| 2853 |
"$(INSTALL_COMPLIBDIR)" |
| 2854 |
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
| 2855 |
$(INSTALL_DATA) \ |
| 2856 |
middle_end/*.cmt middle_end/*.cmti \ |
| 2857 |
middle_end/*.mli \ |
| 2858 |
"$(INSTALL_COMPLIBDIR)" |
| 2859 |
$(INSTALL_DATA) \ |
| 2860 |
middle_end/closure/*.cmt middle_end/closure/*.cmti \ |
| 2861 |
middle_end/closure/*.mli \ |
| 2862 |
"$(INSTALL_COMPLIBDIR)" |
| 2863 |
$(INSTALL_DATA) \ |
| 2864 |
middle_end/flambda/*.cmt middle_end/flambda/*.cmti \ |
| 2865 |
middle_end/flambda/*.mli \ |
| 2866 |
"$(INSTALL_COMPLIBDIR)" |
| 2867 |
$(INSTALL_DATA) \ |
| 2868 |
middle_end/flambda/base_types/*.cmt \ |
| 2869 |
middle_end/flambda/base_types/*.cmti \ |
| 2870 |
middle_end/flambda/base_types/*.mli \ |
| 2871 |
"$(INSTALL_COMPLIBDIR)" |
| 2872 |
$(INSTALL_DATA) \ |
| 2873 |
asmcomp/*.cmt asmcomp/*.cmti \ |
| 2874 |
asmcomp/*.mli \ |
| 2875 |
"$(INSTALL_COMPLIBDIR)" |
| 2876 |
endif |
| 2877 |
$(INSTALL_DATA) \ |
| 2878 |
$(ocamlopt_CMO_FILES) \ |
| 2879 |
"$(INSTALL_COMPLIBDIR)" |
| 2880 |
ifeq "$(build_ocamldoc)" "true" |
| 2881 |
$(MKDIR) "$(INSTALL_LIBDIR)/ocamldoc" |
| 2882 |
$(INSTALL_PROG) $(OCAMLDOC_OPT) "$(INSTALL_BINDIR)" |
| 2883 |
$(INSTALL_DATA) \ |
| 2884 |
$(OCAMLDOC_LIBCMIS) \ |
| 2885 |
"$(INSTALL_LIBDIR)/ocamldoc" |
| 2886 |
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
| 2887 |
$(INSTALL_DATA) \ |
| 2888 |
$(OCAMLDOC_LIBMLIS) $(OCAMLDOC_LIBCMTS) \ |
| 2889 |
"$(INSTALL_LIBDIR)/ocamldoc" |
| 2890 |
endif |
| 2891 |
$(INSTALL_DATA) \ |
| 2892 |
ocamldoc/ocamldoc.hva ocamldoc/*.cmx ocamldoc/odoc_info.$(A) \ |
| 2893 |
ocamldoc/odoc_info.cmxa \ |
| 2894 |
"$(INSTALL_LIBDIR)/ocamldoc" |
| 2895 |
endif |
| 2896 |
ifeq "$(strip $(NATDYNLINK))" "true" |
| 2897 |
$(INSTALL_DATA) \ |
| 2898 |
$(dynlink_CMX_FILES) otherlibs/dynlink/dynlink.cmxa \ |
| 2899 |
otherlibs/dynlink/dynlink.$(A) \ |
| 2900 |
"$(INSTALL_LIBDIR_DYNLINK)" |
| 2901 |
endif |
| 2902 |
for i in $(OTHERLIBS); do \ |
| 2903 |
$(MAKE) -C otherlibs/$$i installopt || exit $$?; \ |
| 2904 |
done |
| 2905 |
ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" |
| 2906 |
if test -f ocamlopt.opt$(EXE); then $(MAKE) installoptopt; else \ |
| 2907 |
cd "$(INSTALL_BINDIR)"; \ |
| 2908 |
$(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ |
| 2909 |
$(LN) ocamlopt.byte$(EXE) ocamlopt$(EXE); \ |
| 2910 |
$(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ |
| 2911 |
(test -f flexlink.byte$(EXE) && \ |
| 2912 |
$(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true; \ |
| 2913 |
fi |
| 2914 |
else |
| 2915 |
if test -f ocamlopt.opt$(EXE); then $(MAKE) installoptopt; fi |
| 2916 |
endif |
| 2917 |
$(INSTALL_DATA) \ |
| 2918 |
tools/profiling.cmx tools/profiling.$(O) \ |
| 2919 |
"$(INSTALL_LIBDIR_PROFILING)" |
| 2920 |
|
| 2921 |
.PHONY: installoptopt |
| 2922 |
installoptopt: |
| 2923 |
$(INSTALL_PROG) ocamlc.opt$(EXE) "$(INSTALL_BINDIR)" |
| 2924 |
$(INSTALL_PROG) ocamlopt.opt$(EXE) "$(INSTALL_BINDIR)" |
| 2925 |
$(INSTALL_PROG) lex/ocamllex.opt$(EXE) "$(INSTALL_BINDIR)" |
| 2926 |
cd "$(INSTALL_BINDIR)"; \ |
| 2927 |
$(LN) ocamlc.opt$(EXE) ocamlc$(EXE); \ |
| 2928 |
$(LN) ocamlopt.opt$(EXE) ocamlopt$(EXE); \ |
| 2929 |
$(LN) ocamllex.opt$(EXE) ocamllex$(EXE) |
| 2930 |
ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" |
| 2931 |
$(INSTALL_PROG) flexlink.opt$(EXE) "$(INSTALL_BINDIR)" |
| 2932 |
cd "$(INSTALL_BINDIR)"; \ |
| 2933 |
$(LN) flexlink.opt$(EXE) flexlink$(EXE) |
| 2934 |
endif |
| 2935 |
$(INSTALL_DATA) \ |
| 2936 |
utils/*.cmx parsing/*.cmx typing/*.cmx bytecomp/*.cmx \ |
| 2937 |
toplevel/*.cmx toplevel/native/*.cmx \ |
| 2938 |
toplevel/native/tophooks.cmi \ |
| 2939 |
file_formats/*.cmx \ |
| 2940 |
lambda/*.cmx \ |
| 2941 |
driver/*.cmx asmcomp/*.cmx middle_end/*.cmx \ |
| 2942 |
middle_end/closure/*.cmx \ |
| 2943 |
middle_end/flambda/*.cmx \ |
| 2944 |
middle_end/flambda/base_types/*.cmx \ |
| 2945 |
"$(INSTALL_COMPLIBDIR)" |
| 2946 |
$(INSTALL_DATA) \ |
| 2947 |
compilerlibs/*.cmxa compilerlibs/*.$(A) \ |
| 2948 |
"$(INSTALL_COMPLIBDIR)" |
| 2949 |
$(INSTALL_DATA) \ |
| 2950 |
$(ocamlc_CMX_FILES) $(ocamlc_CMX_FILES:.cmx=.$(O)) \ |
| 2951 |
$(ocamlopt_CMX_FILES) $(ocamlopt_CMX_FILES:.cmx=.$(O)) \ |
| 2952 |
$(ocamlnat_CMX_FILES:.cmx=.$(O)) \ |
| 2953 |
"$(INSTALL_COMPLIBDIR)" |
| 2954 |
ifeq "$(INSTALL_OCAMLNAT)" "true" |
| 2955 |
$(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)" |
| 2956 |
endif |
| 2957 |
|
| 2958 |
# Installation of the *.ml sources of compiler-libs |
| 2959 |
.PHONY: install-compiler-sources |
| 2960 |
install-compiler-sources: |
| 2961 |
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
| 2962 |
$(INSTALL_DATA) \ |
| 2963 |
utils/*.ml parsing/*.ml typing/*.ml bytecomp/*.ml driver/*.ml \ |
| 2964 |
file_formats/*.ml \ |
| 2965 |
lambda/*.ml \ |
| 2966 |
toplevel/*.ml toplevel/byte/*.ml \ |
| 2967 |
middle_end/*.ml middle_end/closure/*.ml \ |
| 2968 |
middle_end/flambda/*.ml middle_end/flambda/base_types/*.ml \ |
| 2969 |
asmcomp/*.ml \ |
| 2970 |
asmcmp/debug/*.ml \ |
| 2971 |
"$(INSTALL_COMPLIBDIR)" |
| 2972 |
endif |
| 2973 |
|
| 2974 |
include .depend |
| 2975 |
|
| 2976 |
# Include the cross-compiler recipes only when relevant |
| 2977 |
ifneq "$(HOST)" "$(TARGET)" |
| 2978 |
include Makefile.cross |
| 2979 |
endif |
| 2980 |
|
| 2981 |
Makefile.config Makefile.build_config: config.status |
| 2982 |
config.status: |
| 2983 |
@echo "Please refer to the installation instructions:" |
| 2984 |
@echo "- In file INSTALL for Unix systems." |
| 2985 |
@echo "- In file README.win32.adoc for Windows systems." |
| 2986 |
@echo "On Unix systems, if you've just unpacked the distribution," |
| 2987 |
@echo "something like" |
| 2988 |
@echo " ./configure" |
| 2989 |
@echo " make" |
| 2990 |
@echo " make install" |
| 2991 |
@echo "should work." |
| 2992 |
@false |
| 2993 |
|
| 2994 |
# We need to express that all the CMX files depend on the native compiler, |
| 2995 |
# so that they get invalidated and rebuilt when the compiler is updated |
| 2996 |
# This dependency must appear after all the definitions of the |
| 2997 |
# _SOURCES variable so that GNU make's secondary expansion mechanism works |
| 2998 |
# This is why this dependency is kept at the very end of this file |
| 2999 |
|
| 3000 |
$(ALL_CMX_FILES): ocamlopt$(EXE) |