Sys.Signals module for a Variant type of signals (and a set_signal function that...
[ocaml.git] / Makefile.nt
blobb52bc8a2e8b73db973611ecdc96ceab604c12577
1 #########################################################################
2 #                                                                       #
3 #                            Objective Caml                             #
4 #                                                                       #
5 #            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
6 #                                                                       #
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.                #
10 #                                                                       #
11 #########################################################################
13 # $Id$
15 # The main Makefile
17 include config/Makefile
18 include stdlib/StdlibModules
20 CAMLC=boot/ocamlrun boot/ocamlc -g -I boot
21 CAMLOPT=boot/ocamlrun ./ocamlopt -I stdlib
22 COMPFLAGS=$(INCLUDES)
23 LINKFLAGS=
24 CAMLYACC=boot/ocamlyacc
25 YACCFLAGS=
26 CAMLLEX=boot/ocamlrun boot/ocamllex
27 CAMLDEP=boot/ocamlrun tools/ocamldep
28 DEPFLAGS=$(INCLUDES)
29 CAMLRUN=byterun/ocamlrun
31 INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel
33 UTILS=utils/misc.cmo utils/tbl.cmo utils/config.cmo \
34   utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \
35   utils/consistbl.cmo
37 OPTUTILS=$(UTILS)
39 PARSING=parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
40   parsing/syntaxerr.cmo parsing/parser.cmo \
41   parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo
43 TYPING=typing/unused_var.cmo typing/ident.cmo typing/path.cmo \
44   typing/primitive.cmo typing/types.cmo \
45   typing/btype.cmo typing/oprint.cmo \
46   typing/subst.cmo typing/predef.cmo \
47   typing/datarepr.cmo typing/env.cmo \
48   typing/typedtree.cmo typing/ctype.cmo \
49   typing/printtyp.cmo typing/includeclass.cmo \
50   typing/mtype.cmo typing/includecore.cmo \
51   typing/includemod.cmo typing/parmatch.cmo \
52   typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo \
53   typing/typedecl.cmo typing/typeclass.cmo \
54   typing/typemod.cmo
56 COMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \
57   bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo \
58   bytecomp/translobj.cmo bytecomp/translcore.cmo \
59   bytecomp/translclass.cmo bytecomp/translmod.cmo \
60   bytecomp/simplif.cmo bytecomp/runtimedef.cmo
62 BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \
63   bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
64   bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \
65   bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo
67 ASMCOMP=asmcomp/arch.cmo asmcomp/debuginfo.cmo \
68   asmcomp/cmm.cmo asmcomp/printcmm.cmo \
69   asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
70   asmcomp/clambda.cmo asmcomp/compilenv.cmo \
71   asmcomp/closure.cmo asmcomp/cmmgen.cmo \
72   asmcomp/printmach.cmo asmcomp/selectgen.cmo asmcomp/selection.cmo \
73   asmcomp/comballoc.cmo asmcomp/liveness.cmo \
74   asmcomp/spill.cmo asmcomp/split.cmo \
75   asmcomp/interf.cmo asmcomp/coloring.cmo \
76   asmcomp/reloadgen.cmo asmcomp/reload.cmo \
77   asmcomp/printlinear.cmo asmcomp/linearize.cmo \
78   asmcomp/schedgen.cmo asmcomp/scheduling.cmo \
79   asmcomp/emitaux.cmo asmcomp/emit.cmo asmcomp/asmgen.cmo \
80   asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo
82 DRIVER=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
83   driver/main_args.cmo driver/main.cmo
85 OPTDRIVER=driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
86   driver/optmain.cmo
88 TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
89   toplevel/genprintval.cmo toplevel/toploop.cmo \
90   toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
92 TOPLEVELLIB=toplevel/toplevellib.cma
93 TOPLEVELSTART=toplevel/topstart.cmo
95 COMPOBJS=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(DRIVER)
97 TOPLIB=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(TOPLEVEL)
99 TOPOBJS=$(TOPLEVELLIB) $(TOPLEVELSTART)
101 OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
103 EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
104   utils/config.cmo utils/clflags.cmo \
105   typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
106   typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
107   bytecomp/dll.cmo \
108   bytecomp/symtable.cmo toplevel/expunge.cmo
110 PERVASIVES=$(STDLIB_MODULES) topdirs toploop outcometree
112 # For users who don't read the INSTALL file
113 defaultentry:
114         @echo "Please refer to the installation instructions in file README.win32."
116 # Recompile the system using the bootstrap compiler
117 all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml otherlibraries ocamldoc.byte ocamlbuild.byte camlp4out win32gui
119 # The compilation of ocaml will fail if the runtime has changed.
120 # Never mind, just do make bootstrap to reach fixpoint again.
122 # Compile everything the first time
123 world: coldstart all
125 # Complete bootstrapping cycle
126 bootstrap:
127 # Save the original bootstrap compiler
128         $(MAKEREC) backup
129 # Promote the new compiler but keep the old runtime
130 # This compiler runs on boot/ocamlrun and produces bytecode for byterun/ocamlrun
131         $(MAKEREC) promote-cross
132 # Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
133         $(MAKEREC) partialclean
134         $(MAKEREC) ocamlc ocamllex ocamltools
135 # Rebuild the library (using byterun/ocamlrun ./ocamlc)
136         $(MAKEREC) library-cross
137 # Promote the new compiler and the new runtime
138         $(MAKEREC) promote
139 # Rebuild everything, including ocaml and the tools
140         $(MAKEREC) partialclean
141         $(MAKEREC) all
142 # Check if fixpoint reached
143         $(MAKEREC) compare
145 LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
147 # Start up the system from the distribution compiler
148 coldstart:
149         cd byterun ; $(MAKEREC) all
150         cp byterun/ocamlrun.exe boot/ocamlrun.exe
151         cp byterun/ocamlrun.dll boot/ocamlrun.dll
152         cd yacc ; $(MAKEREC) all
153         cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
154         cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc all
155         cd stdlib ; cp $(LIBFILES) ../boot
157 # Build the core system: the minimum needed to make depend and bootstrap
158 core : runtime ocamlc ocamllex ocamlyacc ocamltools library
160 # Save the current bootstrap compiler
161 MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev
162 backup:
163         mkdir -p boot/Saved
164         if test -d $(MAXSAVED); then rm -r $(MAXSAVED); fi
165         mv boot/Saved boot/Saved.prev
166         mkdir boot/Saved
167         mv boot/Saved.prev boot/Saved/Saved.prev
168         cp boot/ocamlrun.exe boot/Saved/ocamlrun.exe
169         cd boot ; mv ocamlc ocamllex ocamldep ocamlyacc.exe Saved
170         cd boot ; cp $(LIBFILES) Saved
172 # Promote the newly compiled system to the rank of cross compiler
173 # (Runs on the old runtime, produces code for the new runtime)
174 promote-cross:
175         cp ocamlc boot/ocamlc
176         cp lex/ocamllex boot/ocamllex
177         cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
178         cp tools/ocamldep boot/ocamldep
179         cd stdlib ; cp $(LIBFILES) ../boot
181 # Promote the newly compiled system to the rank of bootstrap compiler
182 # (Runs on the new runtime, produces code for the new runtime)
183 promote: promote-cross
184         cp byterun/ocamlrun.exe boot/ocamlrun.exe
186 # Restore the saved bootstrap compiler if a problem arises
187 restore:
188         cd boot/Saved ; mv * ..
189         rmdir boot/Saved
190         mv boot/Saved.prev boot/Saved
192 # Check if fixpoint reached
193 compare:
194         - cmp -i 4096 boot/ocamlc ocamlc
195         - cmp -i 4096 boot/ocamllex lex/ocamllex
196         - cmp -i 4096 boot/ocamldep tools/ocamldep
198 # Remove old bootstrap compilers
199 cleanboot:
200         rm -rf boot/Saved/Saved.prev/*
202 # Compile the native-code compiler
203 opt: runtimeopt ocamlopt libraryopt otherlibrariesopt ocamlbuildlib.native
205 # Native-code versions of the tools
206 opt.opt: ocamlc.opt ocamlopt.opt ocamllex.opt ocamltoolsopt.opt \
207         ocamlbuild.native camlp4opt ocamldoc.opt
209 # Installation
210 install: installbyt installopt
212 installbyt:
213         mkdir -p $(BINDIR)
214         mkdir -p $(LIBDIR)
215         cd byterun ; $(MAKEREC) install
216         echo "$(STUBLIBDIR)" > $(LIBDIR)/ld.conf
217         echo "$(LIBDIR)" >> $(LIBDIR)/ld.conf
218         cp ocamlc $(BINDIR)/ocamlc.exe
219         cp ocaml $(BINDIR)/ocaml.exe
220         cd stdlib ; $(MAKEREC) install
221         cp lex/ocamllex $(BINDIR)/ocamllex.exe
222         cp yacc/ocamlyacc.exe $(BINDIR)/ocamlyacc.exe
223         cp toplevel/toplevellib.cma $(LIBDIR)/toplevellib.cma
224         cp expunge $(LIBDIR)/expunge.exe
225         cp typing/outcometree.cmi typing/outcometree.mli $(LIBDIR)
226         cp toplevel/topstart.cmo $(LIBDIR)
227         cp toplevel/toploop.cmi toplevel/topdirs.cmi toplevel/topmain.cmi $(LIBDIR)
228         cd tools ; $(MAKEREC) install
229         cd ocamldoc ; $(MAKEREC) install
230         mkdir -p $(STUBLIBDIR)
231         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done
232         cd win32caml ; $(MAKE) install
233         ./build/partial-install.sh
234         cp config/Makefile $(LIBDIR)/Makefile.config
235         cp README $(DISTRIB)/Readme.general.txt
236         cp README.win32 $(DISTRIB)/Readme.windows.txt
237         cp LICENSE $(DISTRIB)/License.txt
238         cp Changes $(DISTRIB)/Changes.txt
240 # Installation of the native-code compiler
241 installopt:
242         cd asmrun ; $(MAKEREC) install
243         cp ocamlopt $(BINDIR)/ocamlopt.exe
244         cd stdlib ; $(MAKEREC) installopt
245         cd ocamldoc ; $(MAKEREC) installopt
246         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i installopt; done
247         if test -f ocamlc.opt; \
248           then cp ocamlc.opt $(BINDIR)/ocamlc.opt.exe; else :; fi
249         if test -f ocamlopt.opt; \
250           then cp ocamlopt.opt $(BINDIR)/ocamlopt.opt.exe; else :; fi
251         if test -f lex/ocamllex.opt; \
252           then cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt.exe; else :; fi
254 clean:: partialclean
256 # The compiler
258 ocamlc: $(COMPOBJS)
259         $(CAMLC) $(LINKFLAGS) -o ocamlc $(COMPOBJS)
260         @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
261           driver/ocamlcomp.sh.in > ocamlcomp.sh
262         @chmod +x ocamlcomp.sh
264 partialclean::
265         rm -f ocamlc
267 # The native-code compiler
269 ocamlopt: $(OPTOBJS)
270         $(CAMLC) $(LINKFLAGS) -o ocamlopt $(OPTOBJS)
271         @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
272           driver/ocamlcomp.sh.in > ocamlcompopt.sh
273         @chmod +x ocamlcompopt.sh
275 partialclean::
276         rm -f ocamlopt
278 # The toplevel
280 ocaml: $(TOPOBJS) expunge
281         $(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp $(TOPOBJS)
282         - $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES)
283         rm -f ocaml.tmp
285 toplevel/toplevellib.cma: $(TOPLIB)
286         $(CAMLC) -a -o $@ $(TOPLIB)
288 partialclean::
289         rm -f ocaml
291 # The configuration file
293 utils/config.ml: utils/config.mlp config/Makefile
294         @rm -f utils/config.ml
295         sed -e "s|%%LIBDIR%%|$(LIBDIR)|" \
296             -e "s|%%BYTERUN%%|ocamlrun|" \
297             -e 's|%%CCOMPTYPE%%|$(CCOMPTYPE)|' \
298             -e "s|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS)|" \
299             -e "s|%%BYTELINK%%|$(BYTECC) $(BYTECCLINKOPTS)|" \
300             -e "s|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|" \
301             -e "s|%%NATIVELINK%%|$(NATIVECC) $(NATIVECCLINKOPTS)|" \
302             -e "s|%%PARTIALLD%%|$(PARTIALLD)|" \
303             -e "s|%%PACKLD%%|$(PACKLD)|" \
304             -e "s|%%BYTECCLIBS%%|$(BYTECCLIBS)|" \
305             -e "s|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|" \
306             -e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
307             -e 's|%%BINUTILS_NM%%|$(BINUTILS_NM)|' \
308             -e 's|%%BINUTILS_OBJCOPY%%|$(BINUTILS_OBJCOPY)|' \
309             -e "s|%%ARCH%%|$(ARCH)|" \
310             -e "s|%%MODEL%%|$(MODEL)|" \
311             -e "s|%%SYSTEM%%|$(SYSTEM)|" \
312             -e "s|%%EXT_OBJ%%|.$(O)|" \
313             -e "s|%%EXT_ASM%%|.$(S)|" \
314             -e "s|%%EXT_LIB%%|.$(A)|" \
315             -e "s|%%EXT_DLL%%|.dll|" \
316             -e "s|%%SYSTHREAD_SUPPORT%%|true|" \
317             utils/config.mlp > utils/config.ml
318         @chmod -w utils/config.ml
320 partialclean::
321         rm -f utils/config.ml
323 beforedepend:: utils/config.ml
325 # The parser
327 parsing/parser.mli parsing/parser.ml: parsing/parser.mly
328         $(CAMLYACC) $(YACCFLAGS) parsing/parser.mly
330 partialclean::
331         rm -f parsing/parser.mli parsing/parser.ml parsing/parser.output
333 beforedepend:: parsing/parser.mli parsing/parser.ml
335 # The lexer
337 parsing/lexer.ml: parsing/lexer.mll
338         $(CAMLLEX) parsing/lexer.mll
340 partialclean::
341         rm -f parsing/lexer.ml
343 beforedepend:: parsing/lexer.ml
345 # The auxiliary lexer for counting line numbers
347 parsing/linenum.ml: parsing/linenum.mll
348         $(CAMLLEX) parsing/linenum.mll
350 partialclean::
351         rm -f parsing/linenum.ml
353 beforedepend:: parsing/linenum.ml
355 # The bytecode compiler compiled with the native-code compiler
357 ocamlc.opt: $(COMPOBJS:.cmo=.cmx)
358         cd asmrun ; $(MAKEREC) meta.$(O) dynlink.$(O)
359         $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) asmrun/meta.$(O) asmrun/dynlink.$(O)
361 partialclean::
362         rm -f ocamlc.opt
364 # The native-code compiler compiled with itself
366 ocamlopt.opt: $(OPTOBJS:.cmo=.cmx)
367         $(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt $(OPTOBJS:.cmo=.cmx)
369 partialclean::
370         rm -f ocamlopt.opt
372 $(OPTOBJS:.cmo=.cmx): ocamlopt
374 # The numeric opcodes
376 bytecomp/opcodes.ml: byterun/instruct.h
377         sed -n -e "/^enum/p" -e "s|,||g" -e "/^  /p" byterun/instruct.h | \
378         gawk -f tools/make-opcodes > bytecomp/opcodes.ml
380 partialclean::
381         rm -f bytecomp/opcodes.ml
383 beforedepend:: bytecomp/opcodes.ml
385 # The predefined exceptions and primitives
387 byterun/primitives:
388         cd byterun ; $(MAKEREC) primitives
390 bytecomp/runtimedef.ml: byterun/primitives byterun/fail.h
391         (echo 'let builtin_exceptions = [|'; \
392          sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$|  \1;|p' byterun/fail.h | \
393          sed -e '$$s/;$$//'; \
394          echo '|]'; \
395          echo 'let builtin_primitives = [|'; \
396          sed -e 's/.*/  "&";/' -e '$$s/;$$//' byterun/primitives; \
397          echo '|]') > bytecomp/runtimedef.ml
399 partialclean::
400         rm -f bytecomp/runtimedef.ml
402 beforedepend:: bytecomp/runtimedef.ml
404 # Choose the right machine-dependent files
406 asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml
407         cp asmcomp/$(ARCH)/arch.ml asmcomp/arch.ml
409 partialclean::
410         rm -f asmcomp/arch.ml
412 beforedepend:: asmcomp/arch.ml
414 ifeq ($(TOOLCHAIN),msvc)
415 ASMCOMP_PROC=asmcomp/$(ARCH)/proc_nt.ml
416 ASMCOMP_EMIT=asmcomp/$(ARCH)/emit_nt.mlp
417 else
418 ASMCOMP_PROC=asmcomp/$(ARCH)/proc.ml
419 ASMCOMP_EMIT=asmcomp/$(ARCH)/emit.mlp
420 endif
422 asmcomp/proc.ml: $(ASMCOMP_PROC)
423         cp $(ASMCOMP_PROC) asmcomp/proc.ml
425 partialclean::
426         rm -f asmcomp/proc.ml
428 beforedepend:: asmcomp/proc.ml
430 asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
431         cp asmcomp/$(ARCH)/selection.ml asmcomp/selection.ml
433 partialclean::
434         rm -f asmcomp/selection.ml
436 beforedepend:: asmcomp/selection.ml
438 asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
439         cp asmcomp/$(ARCH)/reload.ml asmcomp/reload.ml
441 partialclean::
442         rm -f asmcomp/reload.ml
444 beforedepend:: asmcomp/reload.ml
446 asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
447         cp asmcomp/$(ARCH)/scheduling.ml asmcomp/scheduling.ml
449 partialclean::
450         rm -f asmcomp/scheduling.ml
452 beforedepend:: asmcomp/scheduling.ml
454 # Preprocess the code emitters
456 asmcomp/emit.ml: $(ASMCOMP_EMIT) tools/cvt_emit
457         boot/ocamlrun tools/cvt_emit < $(ASMCOMP_EMIT) > asmcomp/emit.ml
459 partialclean::
460         rm -f asmcomp/emit.ml
462 beforedepend:: asmcomp/emit.ml
464 tools/cvt_emit: tools/cvt_emit.mll
465         cd tools ; $(MAKEREC) cvt_emit
467 # The "expunge" utility
469 expunge: $(EXPUNGEOBJS)
470         $(CAMLC) $(LINKFLAGS) -o expunge $(EXPUNGEOBJS)
472 partialclean::
473         rm -f expunge
475 # The runtime system for the bytecode compiler
477 runtime: makeruntime stdlib/libcamlrun.$(A)
479 makeruntime:
480         cd byterun ; $(MAKEREC) all
481 stdlib/libcamlrun.$(A): byterun/libcamlrun.$(A)
482         cp byterun/libcamlrun.$(A) stdlib/libcamlrun.$(A)
483 clean::
484         cd byterun ; $(MAKEREC) clean
485         rm -f stdlib/libcamlrun.$(A)
486 alldepend::
487         cd byterun ; $(MAKEREC) depend
489 # The runtime system for the native-code compiler
491 runtimeopt: makeruntimeopt stdlib/libasmrun.$(A)
493 makeruntimeopt:
494         cd asmrun ; $(MAKEREC) all
495 stdlib/libasmrun.$(A): asmrun/libasmrun.$(A)
496         cp asmrun/libasmrun.$(A) stdlib/libasmrun.$(A)
497 clean::
498         cd asmrun ; $(MAKEREC) clean
499         rm -f stdlib/libasmrun.$(A)
500 alldepend::
501         cd asmrun ; $(MAKEREC) depend
503 # The library
505 library:
506         cd stdlib ; $(MAKEREC) all
507 library-cross:
508         cd stdlib ; $(MAKEREC) RUNTIME=../byterun/ocamlrun all
509 libraryopt:
510         cd stdlib ; $(MAKEREC) allopt
511 partialclean::
512         cd stdlib ; $(MAKEREC) clean
513 alldepend::
514         cd stdlib ; $(MAKEREC) depend
516 # The lexer and parser generators
518 ocamllex:
519         cd lex ; $(MAKEREC) all
520 ocamllex.opt:
521         cd lex ; $(MAKEREC) allopt
522 partialclean::
523         cd lex ; $(MAKEREC) clean
524 alldepend::
525         cd lex ; $(MAKEREC) depend
527 ocamlyacc:
528         cd yacc ; $(MAKEREC) all
529 clean::
530         cd yacc ; $(MAKEREC) clean
532 # Tools
534 ocamltools:
535         cd tools ; $(MAKEREC) all
536 ocamltoolsopt.opt:
537         cd tools ; $(MAKEREC) opt.opt
538 partialclean::
539         cd tools ; $(MAKEREC) clean
540 alldepend::
541         cd tools ; $(MAKEREC) depend
543 # OCamldoc
545 ocamldoc.byte: 
546         cd ocamldoc ; $(MAKEREC) all
547 ocamldoc.opt: 
548         cd ocamldoc ; $(MAKEREC) opt.opt
549 partialclean::
550         cd ocamldoc ; $(MAKEREC) clean
551 alldepend::
552         cd ocamldoc ; $(MAKEREC) depend
554 # The extra libraries
556 otherlibraries:
557         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i all; done
558 otherlibrariesopt:
559         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i allopt; done
560 partialclean::
561         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i partialclean; done
562 clean::
563         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i clean; done
564 alldepend::
565         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i depend; done
567 # Camlp4
569 camlp4out: ocamlc otherlibraries ocamlbuild-partial-boot ocamlbuild.byte
570         ./build/camlp4-byte-only.sh
571 camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-partial-boot ocamlbuild.native
572         ./build/camlp4-native-only.sh
574 # Ocamlbuild
576 ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-partial-boot
577         ./build/ocamlbuild-byte-only.sh
578 ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
579         ./build/ocamlbuild-native-only.sh
580 ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
581         ./build/ocamlbuildlib-native-only.sh
584 .PHONY: ocamlbuild-partial-boot
585 ocamlbuild-partial-boot:
586         ./build/partial-boot.sh
587 partialclean::
588         rm -rf _build
590 # The Win32 toplevel GUI
592 win32gui:
593         cd win32caml ; $(MAKE) all
595 clean::
596         cd win32caml ; $(MAKE) clean
598 # Default rules
600 .SUFFIXES: .ml .mli .cmo .cmi .cmx
602 .ml.cmo:
603         $(CAMLC) $(COMPFLAGS) -c $<
605 .mli.cmi:
606         $(CAMLC) $(COMPFLAGS) -c $<
608 .ml.cmx:
609         $(CAMLOPT) $(COMPFLAGS) -c $<
611 partialclean::
612         rm -f utils/*.cm* utils/*.$(O) utils/*.$(S)
613         rm -f parsing/*.cm* parsing/*.$(O) parsing/*.$(S)
614         rm -f typing/*.cm* typing/*.$(O) typing/*.$(S)
615         rm -f bytecomp/*.cm* bytecomp/*.$(O) bytecomp/*.$(S)
616         rm -f asmcomp/*.cm* asmcomp/*.$(O) asmcomp/*.$(S)
617         rm -f driver/*.cm* driver/*.$(O) driver/*.$(S)
618         rm -f toplevel/*.cm* toplevel/*.$(O) toplevel/*.$(S)
619         rm -f tools/*.cm* tools/*.$(O) tools/*.$(S)
621 depend: beforedepend
622         (for d in utils parsing typing bytecomp asmcomp driver toplevel; \
623          do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \
624          done) > .depend
626 alldepend:: depend
628 include .depend