1 #########################################################################
5 # Xavier Leroy, projet Cristal, INRIA Rocquencourt #
7 # Copyright 1999 Institut National de Recherche en Informatique et #
8 # en Automatique. All rights reserved. This file is distributed #
9 # under the terms of the Q Public License version 1.0. #
11 #########################################################################
17 include config
/Makefile
18 include stdlib
/StdlibModules
20 CAMLC
=boot
/ocamlrun boot
/ocamlc
-g
-nostdlib
-I boot
21 CAMLOPT
=boot
/ocamlrun .
/ocamlopt
-nostdlib
-I stdlib
22 COMPFLAGS
=-warn-error A
$(INCLUDES
)
25 CAMLYACC
=boot
/ocamlyacc
27 CAMLLEX
=boot
/ocamlrun boot
/ocamllex
28 CAMLDEP
=boot
/ocamlrun tools
/ocamldep
30 CAMLRUN
=byterun
/ocamlrun
34 INCLUDES
=-I utils
-I parsing
-I typing
-I bytecomp
-I asmcomp
-I driver \
37 UTILS
=utils
/misc.cmo utils
/tbl.cmo utils
/config.cmo \
38 utils
/clflags.cmo utils
/terminfo.cmo utils
/ccomp.cmo utils
/warnings.cmo \
43 PARSING
=parsing
/linenum.cmo parsing
/location.cmo parsing
/longident.cmo \
44 parsing
/syntaxerr.cmo parsing
/parser.cmo \
45 parsing
/lexer.cmo parsing
/parse.cmo parsing
/printast.cmo
47 TYPING
=typing
/unused_var.cmo typing
/ident.cmo typing
/path.cmo \
48 typing
/primitive.cmo typing
/types.cmo \
49 typing
/btype.cmo typing
/oprint.cmo \
50 typing
/subst.cmo typing
/predef.cmo \
51 typing
/datarepr.cmo typing
/env.cmo \
52 typing
/typedtree.cmo typing
/ctype.cmo \
53 typing
/printtyp.cmo typing
/includeclass.cmo \
54 typing
/mtype.cmo typing
/includecore.cmo \
55 typing
/includemod.cmo typing
/parmatch.cmo \
56 typing
/typetexp.cmo typing
/stypes.cmo typing
/typecore.cmo \
57 typing
/typedecl.cmo typing
/typeclass.cmo \
60 COMP
=bytecomp
/lambda.cmo bytecomp
/printlambda.cmo \
61 bytecomp
/typeopt.cmo bytecomp
/switch.cmo bytecomp
/matching.cmo \
62 bytecomp
/translobj.cmo bytecomp
/translcore.cmo \
63 bytecomp
/translclass.cmo bytecomp
/translmod.cmo \
64 bytecomp
/simplif.cmo bytecomp
/runtimedef.cmo
66 BYTECOMP
=bytecomp
/meta.cmo bytecomp
/instruct.cmo bytecomp
/bytegen.cmo \
67 bytecomp
/printinstr.cmo bytecomp
/opcodes.cmo bytecomp
/emitcode.cmo \
68 bytecomp
/bytesections.cmo bytecomp
/dll.cmo bytecomp
/symtable.cmo \
69 bytecomp
/bytelink.cmo bytecomp
/bytelibrarian.cmo bytecomp
/bytepackager.cmo
71 ASMCOMP
=asmcomp
/arch.cmo asmcomp
/debuginfo.cmo \
72 asmcomp
/cmm.cmo asmcomp
/printcmm.cmo \
73 asmcomp
/reg.cmo asmcomp
/mach.cmo asmcomp
/proc.cmo \
74 asmcomp
/clambda.cmo asmcomp
/compilenv.cmo \
75 asmcomp
/closure.cmo asmcomp
/cmmgen.cmo \
76 asmcomp
/printmach.cmo asmcomp
/selectgen.cmo asmcomp
/selection.cmo \
77 asmcomp
/comballoc.cmo asmcomp
/liveness.cmo \
78 asmcomp
/spill.cmo asmcomp
/split.cmo \
79 asmcomp
/interf.cmo asmcomp
/coloring.cmo \
80 asmcomp
/reloadgen.cmo asmcomp
/reload.cmo \
81 asmcomp
/printlinear.cmo asmcomp
/linearize.cmo \
82 asmcomp
/schedgen.cmo asmcomp
/scheduling.cmo \
83 asmcomp
/emitaux.cmo asmcomp
/emit.cmo asmcomp
/asmgen.cmo \
84 asmcomp
/asmlink.cmo asmcomp
/asmlibrarian.cmo asmcomp
/asmpackager.cmo
86 DRIVER
=driver
/pparse.cmo driver
/errors.cmo driver
/compile.cmo \
87 driver
/main_args.cmo driver
/main.cmo
89 OPTDRIVER
= driver
/pparse.cmo driver
/opterrors.cmo driver
/optcompile.cmo \
92 TOPLEVEL
=driver
/pparse.cmo driver
/errors.cmo driver
/compile.cmo \
93 toplevel
/genprintval.cmo toplevel
/toploop.cmo \
94 toplevel
/trace.cmo toplevel
/topdirs.cmo toplevel
/topmain.cmo
96 TOPLEVELLIB
=toplevel
/toplevellib.cma
97 TOPLEVELSTART
=toplevel
/topstart.cmo
99 COMPOBJS
=$(UTILS
) $(PARSING
) $(TYPING
) $(COMP
) $(BYTECOMP
) $(DRIVER
)
101 TOPLIB
=$(UTILS
) $(PARSING
) $(TYPING
) $(COMP
) $(BYTECOMP
) $(TOPLEVEL
)
103 TOPOBJS
=$(TOPLEVELLIB
) $(TOPLEVELSTART
)
105 OPTOBJS
=$(OPTUTILS
) $(PARSING
) $(TYPING
) $(COMP
) $(ASMCOMP
) $(OPTDRIVER
)
107 EXPUNGEOBJS
=utils
/misc.cmo utils
/tbl.cmo \
108 utils
/config.cmo utils
/clflags.cmo \
109 typing
/ident.cmo typing
/path.cmo typing
/types.cmo typing
/btype.cmo \
110 typing
/predef.cmo bytecomp
/runtimedef.cmo bytecomp
/bytesections.cmo \
111 bytecomp
/dll.cmo bytecomp
/meta.cmo bytecomp
/symtable.cmo toplevel
/expunge.cmo
113 PERVASIVES
=$(STDLIB_MODULES
) outcometree topdirs toploop
115 # For users who don't read the INSTALL file
117 @echo
"Please refer to the installation instructions in file INSTALL."
118 @echo
"If you've just unpacked the distribution, something like"
122 @echo
" make install"
123 @echo
"should work. But see the file INSTALL for more details."
125 # Recompile the system using the bootstrap compiler
126 all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
127 otherlibraries ocamlbuild.byte camlp4out
$(DEBUGGER
) ocamldoc
129 # The compilation of ocaml will fail if the runtime has changed.
130 # Never mind, just do make bootstrap to reach fixpoint again.
132 # Compile everything the first time
135 # Compile also native code compiler and libraries, fast
136 world.opt
: coldstart opt.opt
138 # Core bootstrapping cycle
140 # Save the original bootstrap compiler
142 # Promote the new compiler but keep the old runtime
143 # This compiler runs on boot/ocamlrun and produces bytecode for
145 $(MAKE
) promote-cross
146 # Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
148 $(MAKE
) ocamlc ocamllex ocamltools
149 # Rebuild the library (using byterun/ocamlrun ./ocamlc)
150 $(MAKE
) library-cross
151 # Promote the new compiler and the new runtime
153 # Rebuild the core system
156 # Check if fixpoint reached
159 # Bootstrap and rebuild the whole system.
165 LIBFILES
=stdlib.cma std_exit.cmo
*.cmi camlheader
167 # Start up the system from the distribution compiler
169 cd byterun
; $(MAKE
) all
170 cp byterun
/ocamlrun
$(EXE
) boot
/ocamlrun
$(EXE
)
172 cp
yacc/ocamlyacc
$(EXE
) boot
/ocamlyacc
$(EXE
)
173 cd stdlib
; $(MAKE
) COMPILER
=..
/boot
/ocamlc
all
174 cd stdlib
; cp
$(LIBFILES
) ..
/boot
175 if
test -f boot
/libcamlrun.a
; then
:; else \
176 ln
-s ..
/byterun
/libcamlrun.a boot
/libcamlrun.a
; fi
177 if
test -d stdlib
/caml
; then
:; else \
178 ln
-s ..
/byterun stdlib
/caml
; fi
180 # Build the core system: the minimum needed to make depend and bootstrap
181 core
: coldstart ocamlc ocamllex ocamlyacc ocamltools library
183 # Save the current bootstrap compiler
184 MAXSAVED
=boot
/Saved
/Saved.prev
/Saved.prev
/Saved.prev
/Saved.prev
/Saved.prev
186 if
test -d boot
/Saved
; then
: ; else mkdir boot
/Saved
; fi
187 if
test -d
$(MAXSAVED
); then
rm -r
$(MAXSAVED
); else : ; fi
188 mv boot
/Saved boot
/Saved.prev
190 mv boot
/Saved.prev boot
/Saved
/Saved.prev
191 cp boot
/ocamlrun
$(EXE
) boot
/Saved
192 mv boot
/ocamlc boot
/ocamllex boot
/ocamlyacc
$(EXE
) boot
/ocamldep boot
/Saved
193 cd boot
; cp
$(LIBFILES
) Saved
195 # Promote the newly compiled system to the rank of cross compiler
196 # (Runs on the old runtime, produces code for the new runtime)
198 cp ocamlc boot
/ocamlc
199 cp
lex/ocamllex boot
/ocamllex
200 cp
yacc/ocamlyacc
$(EXE
) boot
/ocamlyacc
$(EXE
)
201 cp tools
/ocamldep boot
/ocamldep
202 cd stdlib
; cp
$(LIBFILES
) ..
/boot
204 # Promote the newly compiled system to the rank of bootstrap compiler
205 # (Runs on the new runtime, produces code for the new runtime)
206 promote
: promote-cross
207 cp byterun
/ocamlrun
$(EXE
) boot
/ocamlrun
$(EXE
)
209 # Restore the saved bootstrap compiler if a problem arises
213 mv boot
/Saved.prev boot
/Saved
215 # Check if fixpoint reached
217 @if cmp boot
/ocamlc ocamlc
&& cmp boot
/ocamllex
lex/ocamllex
&& cmp boot
/ocamldep tools
/ocamldep
; \
218 then echo
"Fixpoint reached, bootstrap succeeded."; \
219 else echo
"Fixpoint not reached, try one more bootstrapping cycle."; \
222 # Remove old bootstrap compilers
224 rm -rf boot
/Saved
/Saved.prev
/*
226 # Compile the native-code compiler
227 opt-core
:runtimeopt ocamlopt libraryopt
228 opt
: runtimeopt ocamlopt libraryopt otherlibrariesopt ocamlbuildlib.native
230 # Native-code versions of the tools
231 opt.opt
: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
232 ocamlbuild.byte camlp4out
$(DEBUGGER
) ocamldoc ocamlopt.opt otherlibrariesopt \
233 ocamllex.opt ocamltoolsopt.opt ocamlbuild.native camlp4opt ocamldoc.opt
237 if
test -d
$(BINDIR
); then
: ; else $(MKDIR
) $(BINDIR
); fi
238 if
test -d
$(LIBDIR
); then
: ; else $(MKDIR
) $(LIBDIR
); fi
239 if
test -d
$(STUBLIBDIR
); then
: ; else $(MKDIR
) $(STUBLIBDIR
); fi
240 if
test -d
$(MANDIR
)/man
$(MANEXT
); then
: ; else $(MKDIR
) $(MANDIR
)/man
$(MANEXT
); fi
241 cd
$(LIBDIR
); rm -f dllbigarray.so dlllabltk.so dllnums.so \
242 dllthreads.so dllunix.so dllgraphics.so dllmldbm.so dllstr.so \
244 cd byterun
; $(MAKE
) install
245 cp ocamlc
$(BINDIR
)/ocamlc
$(EXE
)
246 cp ocaml
$(BINDIR
)/ocaml
$(EXE
)
247 cd stdlib
; $(MAKE
) install
248 cp
lex/ocamllex
$(BINDIR
)/ocamllex
$(EXE
)
249 cp
yacc/ocamlyacc
$(EXE
) $(BINDIR
)/ocamlyacc
$(EXE
)
250 cp toplevel
/toplevellib.cma
$(LIBDIR
)/toplevellib.cma
251 cp expunge
$(LIBDIR
)/expunge
$(EXE
)
252 cp typing
/outcometree.cmi typing
/outcometree.mli
$(LIBDIR
)
253 cp toplevel
/topstart.cmo
$(LIBDIR
)
254 cp toplevel
/toploop.cmi toplevel
/topdirs.cmi toplevel
/topmain.cmi
$(LIBDIR
)
255 cd tools
; $(MAKE
) install
256 -cd man
; $(MAKE
) install
257 for i in
$(OTHERLIBRARIES
); do \
258 (cd otherlibs
/$$i; $(MAKE
) install) || exit
$$?
; \
260 cd ocamldoc
; $(MAKE
) install
261 if
test -f ocamlopt
; then
$(MAKE
) installopt
; else :; fi
262 if
test -f debugger
/ocamldebug
; then
(cd debugger
; $(MAKE
) install); \
264 cp config
/Makefile
$(LIBDIR
)/Makefile.config
265 BINDIR
=$(BINDIR
) LIBDIR
=$(LIBDIR
) PREFIX
=$(PREFIX
) .
/build
/partial-install.sh
267 # Installation of the native-code compiler
269 cd asmrun
; $(MAKE
) install
270 cp ocamlopt
$(BINDIR
)/ocamlopt
$(EXE
)
271 cd stdlib
; $(MAKE
) installopt
272 cd ocamldoc
; $(MAKE
) installopt
273 for i in
$(OTHERLIBRARIES
); do
(cd otherlibs
/$$i; $(MAKE
) installopt
) || exit
$$?
; done
274 if
test -f ocamlc.opt
; \
275 then cp ocamlc.opt
$(BINDIR
)/ocamlc.opt
$(EXE
); else :; fi
276 if
test -f ocamlopt.opt
; \
277 then cp ocamlopt.opt
$(BINDIR
)/ocamlopt.opt
$(EXE
); else :; fi
278 if
test -f
lex/ocamllex.opt
; \
279 then cp
lex/ocamllex.opt
$(BINDIR
)/ocamllex.opt
$(EXE
); else :; fi
286 $(CAMLC
) $(LINKFLAGS
) -o ocamlc
$(COMPOBJS
)
287 @sed
-e
's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
288 driver
/ocamlcomp.sh.in
> ocamlcomp.sh
289 @chmod
+x ocamlcomp.sh
292 rm -f ocamlc ocamlcomp.sh
294 # The native-code compiler
297 $(CAMLC
) $(LINKFLAGS
) -o ocamlopt
$(OPTOBJS
)
298 @sed
-e
's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
299 driver
/ocamlcomp.sh.in
> ocamlcompopt.sh
300 @chmod
+x ocamlcompopt.sh
303 rm -f ocamlopt ocamlcompopt.sh
307 ocaml
: $(TOPOBJS
) expunge
308 $(CAMLC
) $(LINKFLAGS
) -linkall
-o ocaml.tmp
$(TOPOBJS
)
309 - $(CAMLRUN
) .
/expunge ocaml.tmp ocaml
$(PERVASIVES
)
312 toplevel
/toplevellib.cma
: $(TOPLIB
)
313 $(CAMLC
) -a
-o
$@
$(TOPLIB
)
316 rm -f ocaml toplevel
/toplevellib.cma
318 # The configuration file
320 utils
/config.ml
: utils
/config.mlp config
/Makefile
321 @
rm -f utils
/config.ml
322 sed
-e
's|%%LIBDIR%%|$(LIBDIR)|' \
323 -e
's|%%BYTERUN%%|$(BINDIR)/ocamlrun|' \
324 -e
's|%%CCOMPTYPE%%|cc|' \
325 -e
's|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)|' \
326 -e
's|%%BYTELINK%%|$(BYTECC) $(BYTECCLINKOPTS)|' \
327 -e
's|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|' \
328 -e
's|%%NATIVELINK%%|$(NATIVECC) $(NATIVECCLINKOPTS)|' \
329 -e
's|%%PARTIALLD%%|$(PARTIALLD) $(NATIVECCLINKOPTS)|' \
330 -e
's|%%PACKLD%%|$(PARTIALLD) $(NATIVECCLINKOPTS) -o |' \
331 -e
's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \
332 -e
's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \
333 -e
's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
334 -e
's|%%CC_PROFILE%%|$(CC_PROFILE)|' \
335 -e
's|%%ARCH%%|$(ARCH)|' \
336 -e
's|%%MODEL%%|$(MODEL)|' \
337 -e
's|%%SYSTEM%%|$(SYSTEM)|' \
338 -e
's|%%EXT_OBJ%%|.o|' \
339 -e
's|%%EXT_ASM%%|.s|' \
340 -e
's|%%EXT_LIB%%|.a|' \
341 -e
's|%%EXT_DLL%%|.so|' \
342 -e
's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
343 utils
/config.mlp
> utils
/config.ml
344 @chmod
-w utils
/config.ml
347 rm -f utils
/config.ml
349 beforedepend
:: utils
/config.ml
353 parsing
/parser.mli parsing
/parser.ml
: parsing
/parser.mly
354 $(CAMLYACC
) $(YACCFLAGS
) parsing
/parser.mly
357 rm -f parsing
/parser.mli parsing
/parser.ml parsing
/parser.output
359 beforedepend
:: parsing
/parser.mli parsing
/parser.ml
363 parsing
/lexer.ml
: parsing
/lexer.mll
364 $(CAMLLEX
) parsing
/lexer.mll
367 rm -f parsing
/lexer.ml
369 beforedepend
:: parsing
/lexer.ml
371 # The auxiliary lexer for counting line numbers
373 parsing
/linenum.ml
: parsing
/linenum.mll
374 $(CAMLLEX
) parsing
/linenum.mll
377 rm -f parsing
/linenum.ml
379 beforedepend
:: parsing
/linenum.ml
381 # The bytecode compiler compiled with the native-code compiler
383 ocamlc.opt
: $(COMPOBJS
:.cmo
=.cmx
)
384 cd asmrun
; $(MAKE
) meta.o dynlink.o
385 $(CAMLOPT
) $(LINKFLAGS
) -ccopt
"$(BYTECCLINKOPTS)" -o ocamlc.opt \
386 $(COMPOBJS
:.cmo
=.cmx
) \
387 asmrun
/meta.o asmrun
/dynlink.o
-cclib
"$(BYTECCLIBS)"
388 @sed
-e
's|@compiler@|$$topdir/ocamlc.opt|' \
389 driver
/ocamlcomp.sh.in
> ocamlcomp.sh
390 @chmod
+x ocamlcomp.sh
395 # The native-code compiler compiled with itself
397 ocamlopt.opt
: $(OPTOBJS
:.cmo
=.cmx
)
398 $(CAMLOPT
) $(LINKFLAGS
) -o ocamlopt.opt
$(OPTOBJS
:.cmo
=.cmx
)
399 @sed
-e
's|@compiler@|$$topdir/ocamlopt.opt|' \
400 driver
/ocamlcomp.sh.in
> ocamlcompopt.sh
401 @chmod
+x ocamlcompopt.sh
406 $(OPTOBJS
:.cmo
=.cmx
): ocamlopt
408 # The numeric opcodes
410 bytecomp
/opcodes.ml
: byterun
/instruct.h
411 sed
-n
-e
'/^enum/p' -e
's/,//g' -e
'/^ /p' byterun
/instruct.h | \
412 awk
-f tools
/make-opcodes
> bytecomp
/opcodes.ml
415 rm -f bytecomp
/opcodes.ml
417 beforedepend
:: bytecomp
/opcodes.ml
419 # The predefined exceptions and primitives
422 cd byterun
; $(MAKE
) primitives
424 bytecomp
/runtimedef.ml
: byterun
/primitives byterun
/fail.h
425 (echo
'let builtin_exceptions = [|'; \
426 sed
-n
-e
's|.*/\* \("[A-Za-z_]*"\) \*/$$| \1;|p' byterun
/fail.h | \
427 sed
-e
'$$s/;$$//'; \
429 echo
'let builtin_primitives = [|'; \
430 sed
-e
's/.*/ "&";/' -e
'$$s/;$$//' byterun
/primitives
; \
431 echo
'|]') > bytecomp
/runtimedef.ml
434 rm -f bytecomp
/runtimedef.ml
436 beforedepend
:: bytecomp
/runtimedef.ml
438 # Choose the right machine-dependent files
440 asmcomp
/arch.ml
: asmcomp
/$(ARCH
)/arch.ml
441 ln
-s
$(ARCH
)/arch.ml asmcomp
/arch.ml
444 rm -f asmcomp
/arch.ml
446 beforedepend
:: asmcomp
/arch.ml
448 asmcomp
/proc.ml
: asmcomp
/$(ARCH
)/proc.ml
449 ln
-s
$(ARCH
)/proc.ml asmcomp
/proc.ml
452 rm -f asmcomp
/proc.ml
454 beforedepend
:: asmcomp
/proc.ml
456 asmcomp
/selection.ml
: asmcomp
/$(ARCH
)/selection.ml
457 ln
-s
$(ARCH
)/selection.ml asmcomp
/selection.ml
460 rm -f asmcomp
/selection.ml
462 beforedepend
:: asmcomp
/selection.ml
464 asmcomp
/reload.ml
: asmcomp
/$(ARCH
)/reload.ml
465 ln
-s
$(ARCH
)/reload.ml asmcomp
/reload.ml
468 rm -f asmcomp
/reload.ml
470 beforedepend
:: asmcomp
/reload.ml
472 asmcomp
/scheduling.ml
: asmcomp
/$(ARCH
)/scheduling.ml
473 ln
-s
$(ARCH
)/scheduling.ml asmcomp
/scheduling.ml
476 rm -f asmcomp
/scheduling.ml
478 beforedepend
:: asmcomp
/scheduling.ml
480 # Preprocess the code emitters
482 asmcomp
/emit.ml
: asmcomp
/$(ARCH
)/emit.mlp tools
/cvt_emit
483 $(CAMLRUN
) tools
/cvt_emit
< asmcomp
/$(ARCH
)/emit.mlp
> asmcomp
/emit.ml \
484 ||
{ rm -f asmcomp
/emit.ml
; exit
2; }
487 rm -f asmcomp
/emit.ml
489 beforedepend
:: asmcomp
/emit.ml
491 tools
/cvt_emit
: tools
/cvt_emit.mll
493 $(MAKE
) CAMLC
="../$(CAMLRUN) ../boot/ocamlc -I ../stdlib" cvt_emit
495 # The "expunge" utility
497 expunge
: $(EXPUNGEOBJS
)
498 $(CAMLC
) $(LINKFLAGS
) -o expunge
$(EXPUNGEOBJS
)
503 # The runtime system for the bytecode compiler
506 cd byterun
; $(MAKE
) all
507 if
test -f stdlib
/libcamlrun.a
; then
:; else \
508 ln
-s ..
/byterun
/libcamlrun.a stdlib
/libcamlrun.a
; fi
510 cd byterun
; $(MAKE
) clean
511 rm -f stdlib
/libcamlrun.a
514 cd byterun
; $(MAKE
) depend
516 # The runtime system for the native-code compiler
519 cd asmrun
; $(MAKE
) all
520 if
test -f stdlib
/libasmrun.a
; then
:; else \
521 ln
-s ..
/asmrun
/libasmrun.a stdlib
/libasmrun.a
; fi
523 cd asmrun
; $(MAKE
) clean
524 rm -f stdlib
/libasmrun.a
526 cd asmrun
; $(MAKE
) depend
531 cd stdlib
; $(MAKE
) all
533 cd stdlib
; $(MAKE
) RUNTIME
=..
/byterun
/ocamlrun
all
535 cd stdlib
; $(MAKE
) allopt
537 cd stdlib
; $(MAKE
) clean
539 cd stdlib
; $(MAKE
) depend
541 # The lexer and parser generators
543 ocamllex
: ocamlyacc ocamlc
545 ocamllex.opt
: ocamlopt
546 cd
lex; $(MAKE
) allopt
548 cd
lex; $(MAKE
) clean
550 cd
lex; $(MAKE
) depend
555 cd
yacc; $(MAKE
) clean
559 ocamltools
: ocamlc ocamlyacc ocamllex
560 cd tools
; $(MAKE
) all
561 ocamltoolsopt.opt
: ocamlc.opt ocamlyacc ocamllex
562 cd tools
; $(MAKE
) opt.opt
564 cd tools
; $(MAKE
) clean
566 cd tools
; $(MAKE
) depend
570 ocamldoc
: ocamlc ocamlyacc ocamllex
571 cd ocamldoc
&& $(MAKE
) all
572 ocamldoc.opt
: ocamlc.opt ocamlyacc ocamllex
573 cd ocamldoc
&& $(MAKE
) opt.opt
575 cd ocamldoc
&& $(MAKE
) clean
577 cd ocamldoc
&& $(MAKE
) depend
579 # The extra libraries
582 for i in
$(OTHERLIBRARIES
); do \
583 (cd otherlibs
/$$i; $(MAKE
) RUNTIME
=$(RUNTIME
) all) || exit
$$?
; \
586 for i in
$(OTHERLIBRARIES
); do \
587 (cd otherlibs
/$$i; $(MAKE
) allopt
) || exit
$$?
; \
590 for i in
$(OTHERLIBRARIES
); do \
591 (cd otherlibs
/$$i; $(MAKE
) partialclean
); \
594 for i in
$(OTHERLIBRARIES
); do
(cd otherlibs
/$$i; $(MAKE
) clean); done
596 for i in
$(OTHERLIBRARIES
); do
(cd otherlibs
/$$i; $(MAKE
) depend
); done
598 # The replay debugger
600 ocamldebugger
: ocamlc ocamlyacc ocamllex
601 cd debugger
; $(MAKE
) all
603 cd debugger
; $(MAKE
) clean
605 cd debugger
; $(MAKE
) depend
609 camlp4out
: ocamlc otherlibraries ocamlbuild-partial-boot ocamlbuild.byte
610 .
/build
/camlp4-byte-only.sh
611 camlp4opt
: ocamlopt otherlibrariesopt ocamlbuild-partial-boot ocamlbuild.native
612 .
/build
/camlp4-native-only.sh
616 ocamlbuild.byte
: ocamlc otherlibraries ocamlbuild-partial-boot
617 .
/build
/ocamlbuild-byte-only.sh
618 ocamlbuild.native
: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
619 .
/build
/ocamlbuild-native-only.sh
620 ocamlbuildlib.native
: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
621 .
/build
/ocamlbuildlib-native-only.sh
623 .PHONY
: ocamlbuild-partial-boot
624 ocamlbuild-partial-boot
:
625 .
/build
/partial-boot.sh
629 # Check that the stack limit is reasonable.
632 @if
$(BYTECC
) -o tools
/checkstack tools
/checkstack.c
; \
633 then tools
/checkstack
; \
636 @
rm -f tools
/checkstack
638 # Make MacOS X package
640 .PHONY
: package-macosx
643 sudo
rm -rf package-macosx
/root
644 make BINDIR
="`pwd`"/package-macosx
/root
/bin \
645 LIBDIR
="`pwd`"/package-macosx
/root
/lib
/ocaml \
646 MANDIR
="`pwd`"/package-macosx
/root
/man \
648 tools
/make-package-macosx
649 sudo
rm -rf package-macosx
/root
652 rm -rf package-macosx
/*.pkg package-macosx
/*.dmg
656 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
659 $(CAMLC
) $(COMPFLAGS
) -c
$<
662 $(CAMLC
) $(COMPFLAGS
) -c
$<
665 $(CAMLOPT
) $(COMPFLAGS
) -c
$<
668 rm -f utils
/*.cm
[iox
] utils
/*.
[so
] utils
/*~
669 rm -f parsing
/*.cm
[iox
] parsing
/*.
[so
] parsing
/*~
670 rm -f typing
/*.cm
[iox
] typing
/*.
[so
] typing
/*~
671 rm -f bytecomp
/*.cm
[iox
] bytecomp
/*.
[so
] bytecomp
/*~
672 rm -f asmcomp
/*.cm
[iox
] asmcomp
/*.
[so
] asmcomp
/*~
673 rm -f driver
/*.cm
[iox
] driver
/*.
[so
] driver
/*~
674 rm -f toplevel
/*.cm
[iox
] toplevel
/*.
[so
] toplevel
/*~
675 rm -f tools
/*.cm
[iox
] tools
/*.
[so
] tools
/*~
679 (for d in utils parsing typing bytecomp asmcomp driver toplevel
; \
680 do
$(CAMLDEP
) $(DEPFLAGS
) $$d/*.mli
$$d/*.ml
; \