summaryrefslogtreecommitdiff
path: root/Makefile.shared
blob: 6df3e35542c3ea5fbb2934481cb9bcb0a1142ece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#########################################################################
#                                                                       #
#                                 OCaml                                 #
#                                                                       #
#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
#                                                                       #
#   Copyright 1999 Institut National de Recherche en Informatique et    #
#   en Automatique.  All rights reserved.  This file is distributed     #
#   under the terms of the Q Public License version 1.0.                #
#                                                                       #
#########################################################################

# The main Makefile, fragments shared between Makefile and Makefile.nt

include config/Makefile
CAMLRUN ?= boot/ocamlrun
CAMLYACC ?= boot/ocamlyacc
include stdlib/StdlibModules

CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot
CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink
COMPFLAGS=-strict-sequence -w +33..39+48+50 -warn-error A -bin-annot \
          -safe-string $(INCLUDES)
LINKFLAGS=

YACCFLAGS=-v
CAMLLEX=$(CAMLRUN) boot/ocamllex
CAMLDEP=$(CAMLRUN) tools/ocamldep
DEPFLAGS=$(INCLUDES)

OCAMLBUILDBYTE=$(WITH_OCAMLBUILD:=.byte)
OCAMLBUILDNATIVE=$(WITH_OCAMLBUILD:=.native)

OCAMLDOC_OPT=$(WITH_OCAMLDOC:=.opt)

INCLUDES=-I utils -I parsing -I typing -I bytecomp -I middle_end \
         -I middle_end/base_types -I asmcomp -I driver -I toplevel

UTILS=utils/config.cmo utils/timings.cmo utils/misc.cmo \
  utils/ext_types.cmo utils/arg_helper.cmo utils/clflags.cmo \
  utils/tbl.cmo \
  utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \
  utils/consistbl.cmo \
  utils/sort_connected_components.cmo

PARSING=parsing/location.cmo parsing/longident.cmo \
  parsing/docstrings.cmo parsing/ast_helper.cmo \
  parsing/syntaxerr.cmo parsing/parser.cmo \
  parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo \
  parsing/pprintast.cmo \
  parsing/ast_mapper.cmo parsing/attr_helper.cmo

TYPING=typing/ident.cmo typing/path.cmo \
  typing/primitive.cmo typing/types.cmo \
  typing/btype.cmo typing/oprint.cmo \
  typing/subst.cmo typing/predef.cmo \
  typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
  typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo \
  typing/printtyp.cmo typing/includeclass.cmo \
  typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo \
  typing/typedtreeIter.cmo typing/typedtreeMap.cmo \
  typing/tast_mapper.cmo \
  typing/cmt_format.cmo \
  typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
  typing/stypes.cmo typing/typecore.cmo \
  typing/typedecl.cmo typing/typeclass.cmo \
  typing/typemod.cmo typing/untypeast.cmo

COMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \
  bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo \
  bytecomp/translobj.cmo bytecomp/translattribute.cmo \
  bytecomp/translcore.cmo \
  bytecomp/translclass.cmo bytecomp/translmod.cmo \
  bytecomp/simplif.cmo bytecomp/runtimedef.cmo \
  bytecomp/debuginfo.cmo \
  driver/pparse.cmo driver/main_args.cmo \
  driver/compenv.cmo driver/compmisc.cmo

COMMON=$(UTILS) $(PARSING) $(TYPING) $(COMP)

BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \
  bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
  bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \
  bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo \
  driver/errors.cmo driver/compile.cmo

INTEL_ASM=\
  asmcomp/x86_proc.cmo \
  asmcomp/x86_dsl.cmo \
  asmcomp/x86_gas.cmo \
  asmcomp/x86_masm.cmo

ARCH_SPECIFIC_ASMCOMP=
ifeq ($(ARCH),i386)
ARCH_SPECIFIC_ASMCOMP=$(INTEL_ASM)
endif
ifeq ($(ARCH),amd64)
ARCH_SPECIFIC_ASMCOMP=$(INTEL_ASM)
endif

ASMCOMP=\
  $(ARCH_SPECIFIC_ASMCOMP) \
  asmcomp/arch.cmo \
  asmcomp/cmm.cmo asmcomp/printcmm.cmo \
  asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
  asmcomp/clambda.cmo asmcomp/printclambda.cmo \
  asmcomp/export_info.cmo \
  asmcomp/export_info_for_pack.cmo \
  asmcomp/compilenv.cmo \
  asmcomp/build_export_info.cmo \
  asmcomp/closure_offsets.cmo \
  asmcomp/flambda_to_clambda.cmo \
  asmcomp/import_approx.cmo \
  asmcomp/un_anf.cmo \
  asmcomp/strmatch.cmo asmcomp/cmmgen.cmo \
  asmcomp/printmach.cmo asmcomp/selectgen.cmo asmcomp/selection.cmo \
  asmcomp/comballoc.cmo \
  asmcomp/CSEgen.cmo asmcomp/CSE.cmo \
  asmcomp/liveness.cmo \
  asmcomp/spill.cmo asmcomp/split.cmo \
  asmcomp/interf.cmo asmcomp/coloring.cmo \
  asmcomp/reloadgen.cmo asmcomp/reload.cmo \
  asmcomp/deadcode.cmo \
  asmcomp/printlinear.cmo asmcomp/linearize.cmo \
  asmcomp/schedgen.cmo asmcomp/scheduling.cmo \
  asmcomp/branch_relaxation_intf.cmo \
  asmcomp/branch_relaxation.cmo \
  asmcomp/emitaux.cmo asmcomp/emit.cmo asmcomp/asmgen.cmo \
  asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo \
  driver/opterrors.cmo driver/optcompile.cmo

MIDDLE_END=\
  middle_end/base_types/tag.cmo \
  middle_end/base_types/linkage_name.cmo \
  middle_end/base_types/compilation_unit.cmo \
  middle_end/base_types/variable.cmo \
  middle_end/base_types/mutable_variable.cmo \
  middle_end/base_types/set_of_closures_id.cmo \
  middle_end/base_types/closure_element.cmo \
  middle_end/base_types/closure_id.cmo \
  middle_end/base_types/var_within_closure.cmo \
  middle_end/base_types/static_exception.cmo \
  middle_end/base_types/export_id.cmo \
  middle_end/base_types/symbol.cmo \
  middle_end/semantics_of_primitives.cmo \
  middle_end/allocated_const.cmo \
  middle_end/flambda.cmo \
  middle_end/flambda_iterators.cmo \
  middle_end/flambda_utils.cmo \
  middle_end/inlining_cost.cmo \
  middle_end/effect_analysis.cmo \
  middle_end/freshening.cmo \
  middle_end/simple_value_approx.cmo \
  middle_end/lift_code.cmo \
  middle_end/closure_conversion_aux.cmo \
  middle_end/closure_conversion.cmo \
  middle_end/initialize_symbol_to_let_symbol.cmo \
  middle_end/lift_let_to_initialize_symbol.cmo \
  middle_end/find_recursive_functions.cmo \
  middle_end/invariant_params.cmo \
  middle_end/inconstant_idents.cmo \
  middle_end/alias_analysis.cmo \
  middle_end/lift_constants.cmo \
  middle_end/share_constants.cmo \
  middle_end/simplify_common.cmo \
  middle_end/eliminate_const_block.cmo \
  middle_end/remove_unused_arguments.cmo \
  middle_end/remove_unused_closure_vars.cmo \
  middle_end/remove_unused_globals.cmo \
  middle_end/simplify_boxed_integer_ops.cmo \
  middle_end/simplify_primitives.cmo \
  middle_end/inlining_stats_types.cmo \
  middle_end/inlining_stats.cmo \
  middle_end/inline_and_simplify_aux.cmo \
  middle_end/augment_closure.cmo \
  middle_end/unbox_closures.cmo \
  middle_end/inlining_transforms.cmo \
  middle_end/inlining_decision.cmo \
  middle_end/inline_and_simplify.cmo \
  middle_end/ref_to_variables.cmo \
  middle_end/flambda_invariants.cmo \
  middle_end/middle_end.cmo

TOPLEVEL=toplevel/genprintval.cmo toplevel/toploop.cmo \
  toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo

BYTESTART=driver/main.cmo

OPTSTART=driver/optmain.cmo

TOPLEVELSTART=toplevel/topstart.cmo

NATTOPOBJS=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(MIDDLE_END) $(ASMCOMP) \
  toplevel/genprintval.cmo toplevel/opttoploop.cmo toplevel/opttopdirs.cmo \
  toplevel/opttopmain.cmo toplevel/opttopstart.cmo

PERVASIVES=$(STDLIB_MODULES) outcometree topdirs toploop