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 #########################################################################
13 # $Id: Makefile 9480 2009-12-18 23:04:13Z doligez $
17 include config/Makefile
18 include stdlib/StdlibModules
20 CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
21 CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
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 NATTOPOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) \
106 driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
107 toplevel/genprintval.cmo toplevel/opttoploop.cmo toplevel/opttopdirs.cmo \
108 toplevel/opttopmain.cmo toplevel/opttopstart.cmo
110 OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
112 EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
113 utils/config.cmo utils/clflags.cmo \
114 typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
115 typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
116 bytecomp/dll.cmo bytecomp/meta.cmo bytecomp/symtable.cmo toplevel/expunge.cmo
118 PERVASIVES=$(STDLIB_MODULES) outcometree topdirs toploop
120 # For users who don't read the INSTALL file
122 @echo "Please refer to the installation instructions in file INSTALL."
123 @echo "If you've just unpacked the distribution, something like"
127 @echo " make install"
128 @echo "should work. But see the file INSTALL for more details."
130 # Recompile the system using the bootstrap compiler
131 all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
132 otherlibraries ocamlbuild.byte camlp4out $(DEBUGGER) ocamldoc
134 # Compile everything the first time
139 # Compile also native code compiler and libraries, fast
144 # Hard bootstrap how-to:
145 # (only necessary in some cases, for example if you remove some primitive)
147 # make coreboot [old system -- you were in a stable state]
148 # <change the source>
149 # make core [cross-compiler]
150 # make partialclean [if you get "inconsistent assumptions"]
151 # <debug your changes>
152 # make core [cross-compiler]
153 # make coreboot [new system -- now you are in a stable state]
155 # Core bootstrapping cycle
157 # Save the original bootstrap compiler
159 # Promote the new compiler but keep the old runtime
160 # This compiler runs on boot/ocamlrun and produces bytecode for
162 $(MAKE) promote-cross
163 # Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
165 $(MAKE) ocamlc ocamllex ocamltools
166 # Rebuild the library (using byterun/ocamlrun ./ocamlc)
167 $(MAKE) library-cross
168 # Promote the new compiler and the new runtime
170 # Rebuild the core system
173 # Check if fixpoint reached
176 # Bootstrap and rebuild the whole system.
177 # The compilation of ocaml will fail if the runtime has changed.
178 # Never mind, just do make bootstrap to reach fixpoint again.
184 LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
186 # Start up the system from the distribution compiler
188 cd byterun; $(MAKE) all
189 cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE)
191 cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE)
192 cd stdlib; $(MAKE) COMPILER=../boot/ocamlc all
193 cd stdlib; cp $(LIBFILES) ../boot
194 if test -f boot/libcamlrun.a; then :; else \
195 ln -s ../byterun/libcamlrun.a boot/libcamlrun.a; fi
196 if test -d stdlib/caml; then :; else \
197 ln -s ../byterun stdlib/caml; fi
199 # Build the core system: the minimum needed to make depend and bootstrap
200 core: coldstart ocamlc ocamllex ocamlyacc ocamltools library
202 # Recompile the core system using the bootstrap compiler
203 coreall: ocamlc ocamllex ocamlyacc ocamltools library
205 # Save the current bootstrap compiler
206 MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev
208 if test -d boot/Saved; then : ; else mkdir boot/Saved; fi
209 if test -d $(MAXSAVED); then rm -r $(MAXSAVED); else : ; fi
210 mv boot/Saved boot/Saved.prev
212 mv boot/Saved.prev boot/Saved/Saved.prev
213 cp boot/ocamlrun$(EXE) boot/Saved
214 mv boot/ocamlc boot/ocamllex boot/ocamlyacc$(EXE) boot/ocamldep \
216 cd boot; cp $(LIBFILES) Saved
218 # Promote the newly compiled system to the rank of cross compiler
219 # (Runs on the old runtime, produces code for the new runtime)
221 cp ocamlc boot/ocamlc
222 cp lex/ocamllex boot/ocamllex
223 cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE)
224 cp tools/ocamldep boot/ocamldep
225 cd stdlib; cp $(LIBFILES) ../boot
227 # Promote the newly compiled system to the rank of bootstrap compiler
228 # (Runs on the new runtime, produces code for the new runtime)
229 promote: promote-cross
230 cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE)
232 # Restore the saved bootstrap compiler if a problem arises
236 mv boot/Saved.prev boot/Saved
238 # Check if fixpoint reached
240 @if cmp boot/ocamlc ocamlc && cmp boot/ocamllex lex/ocamllex \
241 && cmp boot/ocamldep tools/ocamldep; \
242 then echo "Fixpoint reached, bootstrap succeeded."; \
243 else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
246 # Remove old bootstrap compilers
248 rm -rf boot/Saved/Saved.prev/*
250 # Compile the native-code compiler
260 $(MAKE) otherlibrariesopt
261 $(MAKE) ocamlbuildlib.native
263 # Native-code versions of the tools
264 opt.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
265 ocamlbuild.byte camlp4out $(DEBUGGER) ocamldoc ocamlopt.opt \
267 ocamllex.opt ocamltoolsopt.opt ocamlbuild.native camlp4opt ocamldoc.opt
271 if test -d $(BINDIR); then : ; else $(MKDIR) $(BINDIR); fi
272 if test -d $(LIBDIR); then : ; else $(MKDIR) $(LIBDIR); fi
273 if test -d $(STUBLIBDIR); then : ; else $(MKDIR) $(STUBLIBDIR); fi
274 if test -d $(MANDIR)/man$(MANEXT); then : ; \
275 else $(MKDIR) $(MANDIR)/man$(MANEXT); fi
276 cd $(LIBDIR); rm -f dllbigarray.so dlllabltk.so dllnums.so \
277 dllthreads.so dllunix.so dllgraphics.so dllmldbm.so dllstr.so \
279 cd byterun; $(MAKE) install
280 cp ocamlc $(BINDIR)/ocamlc$(EXE)
281 cp ocaml $(BINDIR)/ocaml$(EXE)
282 cd stdlib; $(MAKE) install
283 cp lex/ocamllex $(BINDIR)/ocamllex$(EXE)
284 cp yacc/ocamlyacc$(EXE) $(BINDIR)/ocamlyacc$(EXE)
285 cp toplevel/toplevellib.cma $(LIBDIR)/toplevellib.cma
286 cp expunge $(LIBDIR)/expunge$(EXE)
287 cp typing/outcometree.cmi typing/outcometree.mli $(LIBDIR)
288 cp toplevel/topstart.cmo $(LIBDIR)
289 cp toplevel/toploop.cmi toplevel/topdirs.cmi toplevel/topmain.cmi \
291 cd tools; $(MAKE) install
292 -$(MAKE) -C man install
293 for i in $(OTHERLIBRARIES); do \
294 (cd otherlibs/$$i; $(MAKE) install) || exit $$?; \
296 cd ocamldoc; $(MAKE) install
297 if test -f ocamlopt; then $(MAKE) installopt; else :; fi
298 if test -f debugger/ocamldebug; then (cd debugger; $(MAKE) install); \
300 cp config/Makefile $(LIBDIR)/Makefile.config
301 BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) \
302 ./build/partial-install.sh
304 # Installation of the native-code compiler
306 cd asmrun; $(MAKE) install
307 cp ocamlopt $(BINDIR)/ocamlopt$(EXE)
308 cd stdlib; $(MAKE) installopt
309 cd ocamldoc; $(MAKE) installopt
310 for i in $(OTHERLIBRARIES); \
311 do (cd otherlibs/$$i; $(MAKE) installopt) || exit $$?; done
312 if test -f ocamlc.opt; \
313 then cp ocamlc.opt $(BINDIR)/ocamlc.opt$(EXE); else :; fi
314 if test -f ocamlopt.opt; \
315 then cp ocamlopt.opt $(BINDIR)/ocamlopt.opt$(EXE); else :; fi
316 if test -f lex/ocamllex.opt; \
317 then cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt$(EXE); else :; fi
324 $(CAMLC) $(LINKFLAGS) -o ocamlc $(COMPOBJS)
325 @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
326 driver/ocamlcomp.sh.in > ocamlcomp.sh
327 @chmod +x ocamlcomp.sh
330 rm -f ocamlc ocamlcomp.sh
332 # The native-code compiler
335 $(CAMLC) $(LINKFLAGS) -o ocamlopt $(OPTOBJS)
336 @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
337 driver/ocamlcomp.sh.in > ocamlcompopt.sh
338 @chmod +x ocamlcompopt.sh
341 rm -f ocamlopt ocamlcompopt.sh
345 ocaml: $(TOPOBJS) expunge
346 $(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp $(TOPOBJS)
347 - $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES)
350 toplevel/toplevellib.cma: $(TOPLIB)
351 $(CAMLC) -a -o $@ $(TOPLIB)
354 rm -f ocaml toplevel/toplevellib.cma
356 # The native toplevel
358 ocamlnat: ocamlopt otherlibs/dynlink/dynlink.cmxa $(NATTOPOBJS:.cmo=.cmx)
359 $(CAMLOPT) $(LINKFLAGS) otherlibs/dynlink/dynlink.cmxa -o ocamlnat \
360 $(NATTOPOBJS:.cmo=.cmx) -linkall
362 toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
364 otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
365 cd otherlibs/dynlink && make allopt
367 # The configuration file
369 utils/config.ml: utils/config.mlp config/Makefile
370 @rm -f utils/config.ml
371 sed -e 's|%%LIBDIR%%|$(LIBDIR)|' \
372 -e 's|%%BYTERUN%%|$(BINDIR)/ocamlrun|' \
373 -e 's|%%CCOMPTYPE%%|cc|' \
374 -e 's|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)|' \
375 -e 's|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|' \
376 -e 's|%%PACKLD%%|$(PACKLD)|' \
377 -e 's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \
378 -e 's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \
379 -e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
380 -e 's|%%CC_PROFILE%%|$(CC_PROFILE)|' \
381 -e 's|%%ARCH%%|$(ARCH)|' \
382 -e 's|%%MODEL%%|$(MODEL)|' \
383 -e 's|%%SYSTEM%%|$(SYSTEM)|' \
384 -e 's|%%EXT_OBJ%%|.o|' \
385 -e 's|%%EXT_ASM%%|.s|' \
386 -e 's|%%EXT_LIB%%|.a|' \
387 -e 's|%%EXT_DLL%%|.so|' \
388 -e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
389 -e 's|%%ASM%%|$(ASM)|' \
390 -e 's|%%MKDLL%%|$(MKDLL)|' \
391 -e 's|%%MKEXE%%|$(MKEXE)|' \
392 -e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
393 utils/config.mlp > utils/config.ml
394 @chmod -w utils/config.ml
397 rm -f utils/config.ml
399 beforedepend:: utils/config.ml
403 parsing/parser.mli parsing/parser.ml: parsing/parser.mly
404 $(CAMLYACC) $(YACCFLAGS) parsing/parser.mly
407 rm -f parsing/parser.mli parsing/parser.ml parsing/parser.output
409 beforedepend:: parsing/parser.mli parsing/parser.ml
413 parsing/lexer.ml: parsing/lexer.mll
414 $(CAMLLEX) parsing/lexer.mll
417 rm -f parsing/lexer.ml
419 beforedepend:: parsing/lexer.ml
421 # The auxiliary lexer for counting line numbers
423 parsing/linenum.ml: parsing/linenum.mll
424 $(CAMLLEX) parsing/linenum.mll
427 rm -f parsing/linenum.ml
429 beforedepend:: parsing/linenum.ml
431 # The bytecode compiler compiled with the native-code compiler
433 ocamlc.opt: $(COMPOBJS:.cmo=.cmx)
434 cd asmrun; $(MAKE) meta.o dynlink.o
435 $(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
436 $(COMPOBJS:.cmo=.cmx) \
437 asmrun/meta.o asmrun/dynlink.o -cclib "$(BYTECCLIBS)"
438 @sed -e 's|@compiler@|$$topdir/ocamlc.opt|' \
439 driver/ocamlcomp.sh.in > ocamlcomp.sh
440 @chmod +x ocamlcomp.sh
445 # The native-code compiler compiled with itself
447 ocamlopt.opt: $(OPTOBJS:.cmo=.cmx)
448 $(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt $(OPTOBJS:.cmo=.cmx)
449 @sed -e 's|@compiler@|$$topdir/ocamlopt.opt|' \
450 driver/ocamlcomp.sh.in > ocamlcompopt.sh
451 @chmod +x ocamlcompopt.sh
456 $(OPTOBJS:.cmo=.cmx): ocamlopt
458 # The numeric opcodes
460 bytecomp/opcodes.ml: byterun/instruct.h
461 sed -n -e '/^enum/p' -e 's/,//g' -e '/^ /p' byterun/instruct.h | \
462 awk -f tools/make-opcodes > bytecomp/opcodes.ml
465 rm -f bytecomp/opcodes.ml
467 beforedepend:: bytecomp/opcodes.ml
469 # The predefined exceptions and primitives
472 cd byterun; $(MAKE) primitives
474 bytecomp/runtimedef.ml: byterun/primitives byterun/fail.h
475 (echo 'let builtin_exceptions = [|'; \
476 sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$| \1;|p' byterun/fail.h | \
477 sed -e '$$s/;$$//'; \
479 echo 'let builtin_primitives = [|'; \
480 sed -e 's/.*/ "&";/' -e '$$s/;$$//' byterun/primitives; \
481 echo '|]') > bytecomp/runtimedef.ml
484 rm -f bytecomp/runtimedef.ml
486 beforedepend:: bytecomp/runtimedef.ml
488 # Choose the right machine-dependent files
490 asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml
491 ln -s $(ARCH)/arch.ml asmcomp/arch.ml
494 rm -f asmcomp/arch.ml
496 beforedepend:: asmcomp/arch.ml
498 asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml
499 ln -s $(ARCH)/proc.ml asmcomp/proc.ml
502 rm -f asmcomp/proc.ml
504 beforedepend:: asmcomp/proc.ml
506 asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
507 ln -s $(ARCH)/selection.ml asmcomp/selection.ml
510 rm -f asmcomp/selection.ml
512 beforedepend:: asmcomp/selection.ml
514 asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
515 ln -s $(ARCH)/reload.ml asmcomp/reload.ml
518 rm -f asmcomp/reload.ml
520 beforedepend:: asmcomp/reload.ml
522 asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
523 ln -s $(ARCH)/scheduling.ml asmcomp/scheduling.ml
526 rm -f asmcomp/scheduling.ml
528 beforedepend:: asmcomp/scheduling.ml
530 # Preprocess the code emitters
532 asmcomp/emit.ml: asmcomp/$(ARCH)/emit.mlp tools/cvt_emit
533 $(CAMLRUN) tools/cvt_emit < asmcomp/$(ARCH)/emit.mlp > asmcomp/emit.ml \
534 || { rm -f asmcomp/emit.ml; exit 2; }
537 rm -f asmcomp/emit.ml
539 beforedepend:: asmcomp/emit.ml
541 tools/cvt_emit: tools/cvt_emit.mll
543 $(MAKE) CAMLC="../$(CAMLRUN) ../boot/ocamlc -I ../stdlib" cvt_emit
545 # The "expunge" utility
547 expunge: $(EXPUNGEOBJS)
548 $(CAMLC) $(LINKFLAGS) -o expunge $(EXPUNGEOBJS)
553 # The runtime system for the bytecode compiler
556 cd byterun; $(MAKE) all
557 if test -f stdlib/libcamlrun.a; then :; else \
558 ln -s ../byterun/libcamlrun.a stdlib/libcamlrun.a; fi
561 cd byterun; $(MAKE) clean
562 rm -f stdlib/libcamlrun.a
566 cd byterun; $(MAKE) depend
568 # The runtime system for the native-code compiler
570 runtimeopt: makeruntimeopt
571 cp asmrun/libasmrun.a stdlib/libasmrun.a
574 cd asmrun; $(MAKE) all
577 cd asmrun; $(MAKE) clean
578 rm -f stdlib/libasmrun.a
581 cd asmrun; $(MAKE) depend
586 cd stdlib; $(MAKE) all
589 cd stdlib; $(MAKE) RUNTIME=../byterun/ocamlrun all
592 cd stdlib; $(MAKE) allopt
595 cd stdlib; $(MAKE) clean
598 cd stdlib; $(MAKE) depend
600 # The lexer and parser generators
602 ocamllex: ocamlyacc ocamlc
605 ocamllex.opt: ocamlopt
606 cd lex; $(MAKE) allopt
609 cd lex; $(MAKE) clean
612 cd lex; $(MAKE) depend
618 cd yacc; $(MAKE) clean
622 ocamltools: ocamlc ocamlyacc ocamllex
623 cd tools; $(MAKE) all
625 ocamltoolsopt.opt: ocamlc.opt ocamlyacc ocamllex
626 cd tools; $(MAKE) opt.opt
629 cd tools; $(MAKE) clean
632 cd tools; $(MAKE) depend
636 ocamldoc: ocamlc ocamlyacc ocamllex otherlibraries
637 cd ocamldoc && $(MAKE) all
639 ocamldoc.opt: ocamlc.opt ocamlyacc ocamllex
640 cd ocamldoc && $(MAKE) opt.opt
643 cd ocamldoc && $(MAKE) clean
646 cd ocamldoc && $(MAKE) depend
648 # The extra libraries
650 otherlibraries: ocamltools
651 for i in $(OTHERLIBRARIES); do \
652 (cd otherlibs/$$i; $(MAKE) RUNTIME=$(RUNTIME) all) || exit $$?; \
656 for i in $(OTHERLIBRARIES); do \
657 (cd otherlibs/$$i; $(MAKE) allopt) || exit $$?; \
661 for i in $(OTHERLIBRARIES); do \
662 (cd otherlibs/$$i; $(MAKE) partialclean); \
666 for i in $(OTHERLIBRARIES); do (cd otherlibs/$$i; $(MAKE) clean); done
669 for i in $(OTHERLIBRARIES); do (cd otherlibs/$$i; $(MAKE) depend); done
671 # The replay debugger
673 ocamldebugger: ocamlc ocamlyacc ocamllex otherlibraries
674 cd debugger; $(MAKE) all
677 cd debugger; $(MAKE) clean
680 cd debugger; $(MAKE) depend
684 camlp4out: ocamlc otherlibraries ocamlbuild-mixed-boot ocamlbuild.byte
685 ./build/camlp4-byte-only.sh
687 camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot ocamlbuild.native
688 ./build/camlp4-native-only.sh
692 ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-mixed-boot
693 ./build/ocamlbuild-byte-only.sh
695 ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
696 ./build/ocamlbuild-native-only.sh
697 ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
698 ./build/ocamlbuildlib-native-only.sh
700 ocamlbuild-mixed-boot: ocamlc otherlibraries
701 ./build/mixed-boot.sh
705 if test -d test; then \
706 (cd test; $(MAKE) clean); \
709 # Check that the stack limit is reasonable.
712 @if $(BYTECC) -o tools/checkstack tools/checkstack.c; \
713 then tools/checkstack; \
716 @rm -f tools/checkstack
718 # Make MacOS X package
721 sudo rm -rf package-macosx/root
722 make PREFIX="`pwd`"/package-macosx/root install
723 tools/make-package-macosx
724 sudo rm -rf package-macosx/root
727 rm -rf package-macosx/*.pkg package-macosx/*.dmg
731 .SUFFIXES: .ml .mli .cmo .cmi .cmx
734 $(CAMLC) $(COMPFLAGS) -c $<
737 $(CAMLC) $(COMPFLAGS) -c $<
740 $(CAMLOPT) $(COMPFLAGS) -c $<
743 for d in utils parsing typing bytecomp asmcomp driver toplevel tools; \
744 do rm -f $$d/*.cm[iox] $$d/*.annot $$d/*.[so] $$d/*~; done
748 (for d in utils parsing typing bytecomp asmcomp driver toplevel; \
749 do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \
757 .PHONY: all backup bootstrap camlp4opt camlp4out checkstack clean
758 .PHONY: partialclean beforedepend alldepend cleanboot coldstart
759 .PHONY: compare core coreall
760 .PHONY: coreboot defaultentry depend distclean install installopt
761 .PHONY: library library-cross libraryopt ocamlbuild-mixed-boot
762 .PHONY: ocamlbuild.byte ocamlbuild.native ocamldebugger ocamldoc
763 .PHONY: ocamldoc.opt ocamllex ocamllex.opt ocamltools ocamltools.opt
764 .PHONY: ocamlyacc opt-core opt opt.opt otherlibraries
765 .PHONY: otherlibrariesopt package-macosx promote promote-cross
766 .PHONY: restore runtime runtimeopt makeruntimeopt world world.opt