]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/Makefile.nt
Inital import
[l4.git] / l4 / pkg / ocaml / contrib / Makefile.nt
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 #########################################################################
12
13 # $Id: Makefile.nt 9127 2008-11-10 16:13:20Z ertai $
14
15 # The main Makefile
16
17 include config/Makefile
18 include stdlib/StdlibModules
19
20 CAMLC=boot/ocamlrun boot/ocamlc -I boot
21 CAMLOPT=boot/ocamlrun ./ocamlopt -I stdlib -I otherlibs/dynlink
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
30
31 INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver \
32          -I toplevel
33
34 UTILS=utils/misc.cmo utils/tbl.cmo utils/config.cmo \
35   utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \
36   utils/consistbl.cmo
37
38 OPTUTILS=$(UTILS)
39
40 PARSING=parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
41   parsing/syntaxerr.cmo parsing/parser.cmo \
42   parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo
43
44 TYPING=typing/unused_var.cmo typing/ident.cmo typing/path.cmo \
45   typing/primitive.cmo typing/types.cmo \
46   typing/btype.cmo typing/oprint.cmo \
47   typing/subst.cmo typing/predef.cmo \
48   typing/datarepr.cmo typing/env.cmo \
49   typing/typedtree.cmo typing/ctype.cmo \
50   typing/printtyp.cmo typing/includeclass.cmo \
51   typing/mtype.cmo typing/includecore.cmo \
52   typing/includemod.cmo typing/parmatch.cmo \
53   typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo \
54   typing/typedecl.cmo typing/typeclass.cmo \
55   typing/typemod.cmo
56
57 COMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \
58   bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo \
59   bytecomp/translobj.cmo bytecomp/translcore.cmo \
60   bytecomp/translclass.cmo bytecomp/translmod.cmo \
61   bytecomp/simplif.cmo bytecomp/runtimedef.cmo
62
63 BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \
64   bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
65   bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \
66   bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo
67
68 ASMCOMP=asmcomp/arch.cmo asmcomp/debuginfo.cmo \
69   asmcomp/cmm.cmo asmcomp/printcmm.cmo \
70   asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
71   asmcomp/clambda.cmo asmcomp/compilenv.cmo \
72   asmcomp/closure.cmo asmcomp/cmmgen.cmo \
73   asmcomp/printmach.cmo asmcomp/selectgen.cmo asmcomp/selection.cmo \
74   asmcomp/comballoc.cmo asmcomp/liveness.cmo \
75   asmcomp/spill.cmo asmcomp/split.cmo \
76   asmcomp/interf.cmo asmcomp/coloring.cmo \
77   asmcomp/reloadgen.cmo asmcomp/reload.cmo \
78   asmcomp/printlinear.cmo asmcomp/linearize.cmo \
79   asmcomp/schedgen.cmo asmcomp/scheduling.cmo \
80   asmcomp/emitaux.cmo asmcomp/emit.cmo asmcomp/asmgen.cmo \
81   asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo
82
83 DRIVER=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
84   driver/main_args.cmo driver/main.cmo
85
86 OPTDRIVER=driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
87   driver/optmain.cmo
88
89 TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
90   toplevel/genprintval.cmo toplevel/toploop.cmo \
91   toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
92
93 TOPLEVELLIB=toplevel/toplevellib.cma
94 TOPLEVELSTART=toplevel/topstart.cmo
95
96 COMPOBJS=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(DRIVER)
97
98 TOPLIB=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(TOPLEVEL)
99
100 TOPOBJS=$(TOPLEVELLIB) $(TOPLEVELSTART)
101
102 NATTOPOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) \
103   driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
104   toplevel/genprintval.cmo toplevel/opttoploop.cmo toplevel/opttopdirs.cmo \
105   toplevel/opttopmain.cmo toplevel/opttopstart.cmo
106
107 OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
108
109 EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
110   utils/config.cmo utils/clflags.cmo \
111   typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
112   typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
113   bytecomp/dll.cmo \
114   bytecomp/symtable.cmo toplevel/expunge.cmo
115
116 PERVASIVES=$(STDLIB_MODULES) topdirs toploop outcometree
117
118 # For users who don't read the INSTALL file
119 defaultentry:
120         @echo "Please refer to the installation instructions in file README.win32."
121
122 # Recompile the system using the bootstrap compiler
123 all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml otherlibraries ocamldoc.byte ocamlbuild.byte camlp4out $(DEBUGGER) win32gui
124
125 # The compilation of ocaml will fail if the runtime has changed.
126 # Never mind, just do make bootstrap to reach fixpoint again.
127
128 # Compile everything the first time
129 world: coldstart all
130
131 # Complete bootstrapping cycle
132 bootstrap:
133 # Save the original bootstrap compiler
134         $(MAKEREC) backup
135 # Promote the new compiler but keep the old runtime
136 # This compiler runs on boot/ocamlrun and produces bytecode for byterun/ocamlrun
137         $(MAKEREC) promote-cross
138 # Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
139         $(MAKEREC) partialclean
140         $(MAKEREC) ocamlc ocamllex ocamltools
141 # Rebuild the library (using byterun/ocamlrun ./ocamlc)
142         $(MAKEREC) library-cross
143 # Promote the new compiler and the new runtime
144         $(MAKEREC) promote
145 # Rebuild everything, including ocaml and the tools
146         $(MAKEREC) partialclean
147         $(MAKEREC) all
148 # Check if fixpoint reached
149         $(MAKEREC) compare
150
151 LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
152
153 # Start up the system from the distribution compiler
154 coldstart:
155         cd byterun ; $(MAKEREC) all
156         cp byterun/ocamlrun.exe boot/ocamlrun.exe
157         cd yacc ; $(MAKEREC) all
158         cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
159         cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc all
160         cd stdlib ; cp $(LIBFILES) ../boot
161
162 # Build the core system: the minimum needed to make depend and bootstrap
163 core : runtime ocamlc ocamllex ocamlyacc ocamltools library
164
165 # Save the current bootstrap compiler
166 MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev
167 backup:
168         mkdir -p boot/Saved
169         if test -d $(MAXSAVED); then rm -r $(MAXSAVED); fi
170         mv boot/Saved boot/Saved.prev
171         mkdir boot/Saved
172         mv boot/Saved.prev boot/Saved/Saved.prev
173         cp boot/ocamlrun.exe boot/Saved/ocamlrun.exe
174         cd boot ; mv ocamlc ocamllex ocamldep ocamlyacc.exe Saved
175         cd boot ; cp $(LIBFILES) Saved
176
177 # Promote the newly compiled system to the rank of cross compiler
178 # (Runs on the old runtime, produces code for the new runtime)
179 promote-cross:
180         cp ocamlc boot/ocamlc
181         cp lex/ocamllex boot/ocamllex
182         cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
183         cp tools/ocamldep boot/ocamldep
184         cd stdlib ; cp $(LIBFILES) ../boot
185
186 # Promote the newly compiled system to the rank of bootstrap compiler
187 # (Runs on the new runtime, produces code for the new runtime)
188 promote: promote-cross
189         cp byterun/ocamlrun.exe boot/ocamlrun.exe
190
191 # Restore the saved bootstrap compiler if a problem arises
192 restore:
193         cd boot/Saved ; mv * ..
194         rmdir boot/Saved
195         mv boot/Saved.prev boot/Saved
196
197 # Check if fixpoint reached
198 compare:
199         - cmp -i 4096 boot/ocamlc ocamlc
200         - cmp -i 4096 boot/ocamllex lex/ocamllex
201         - cmp -i 4096 boot/ocamldep tools/ocamldep
202
203 # Remove old bootstrap compilers
204 cleanboot:
205         rm -rf boot/Saved/Saved.prev/*
206
207 # Compile the native-code compiler
208 opt: runtimeopt ocamlopt libraryopt otherlibrariesopt ocamlbuildlib.native
209
210 # Native-code versions of the tools
211 opt.opt: ocamlc.opt ocamlopt.opt ocamllex.opt ocamltoolsopt.opt \
212         ocamlbuild.native camlp4opt ocamldoc.opt
213
214 # Installation
215 install: installbyt installopt
216
217 installbyt:
218         mkdir -p $(BINDIR)
219         mkdir -p $(LIBDIR)
220         cd byterun ; $(MAKEREC) install
221         cp ocamlc $(BINDIR)/ocamlc.exe
222         cp ocaml $(BINDIR)/ocaml.exe
223         cd stdlib ; $(MAKEREC) install
224         cp lex/ocamllex $(BINDIR)/ocamllex.exe
225         cp yacc/ocamlyacc.exe $(BINDIR)/ocamlyacc.exe
226         cp toplevel/toplevellib.cma $(LIBDIR)/toplevellib.cma
227         cp expunge $(LIBDIR)/expunge.exe
228         cp typing/outcometree.cmi typing/outcometree.mli $(LIBDIR)
229         cp toplevel/topstart.cmo $(LIBDIR)
230         cp toplevel/toploop.cmi toplevel/topdirs.cmi toplevel/topmain.cmi $(LIBDIR)
231         cd tools ; $(MAKEREC) install
232         cd ocamldoc ; $(MAKEREC) install
233         mkdir -p $(STUBLIBDIR)
234         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done
235         if test -f debugger/ocamldebug.exe; then (cd debugger; $(MAKEREC) install); \
236            else :; fi
237         cd win32caml ; $(MAKE) install
238         ./build/partial-install.sh
239         cp config/Makefile $(LIBDIR)/Makefile.config
240         cp README $(DISTRIB)/Readme.general.txt
241         cp README.win32 $(DISTRIB)/Readme.windows.txt
242         cp LICENSE $(DISTRIB)/License.txt
243         cp Changes $(DISTRIB)/Changes.txt
244
245 # Installation of the native-code compiler
246 installopt:
247         cd asmrun ; $(MAKEREC) install
248         cp ocamlopt $(BINDIR)/ocamlopt.exe
249         cd stdlib ; $(MAKEREC) installopt
250         cd ocamldoc ; $(MAKEREC) installopt
251         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i installopt; done
252         if test -f ocamlc.opt; \
253           then cp ocamlc.opt $(BINDIR)/ocamlc.opt.exe; else :; fi
254         if test -f ocamlopt.opt; \
255           then cp ocamlopt.opt $(BINDIR)/ocamlopt.opt.exe; else :; fi
256         if test -f lex/ocamllex.opt; \
257           then cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt.exe; else :; fi
258
259 clean:: partialclean
260
261 # The compiler
262
263 ocamlc: $(COMPOBJS)
264         $(CAMLC) $(LINKFLAGS) -o ocamlc $(COMPOBJS)
265         @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
266           driver/ocamlcomp.sh.in > ocamlcomp.sh
267         @chmod +x ocamlcomp.sh
268
269 partialclean::
270         rm -f ocamlc
271
272 # The native-code compiler
273
274 ocamlopt: $(OPTOBJS)
275         $(CAMLC) $(LINKFLAGS) -o ocamlopt $(OPTOBJS)
276         @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
277           driver/ocamlcomp.sh.in > ocamlcompopt.sh
278         @chmod +x ocamlcompopt.sh
279
280 partialclean::
281         rm -f ocamlopt
282
283 # The toplevel
284
285 ocaml: $(TOPOBJS) expunge
286         $(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp $(TOPOBJS)
287         - $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES)
288         rm -f ocaml.tmp
289
290 toplevel/toplevellib.cma: $(TOPLIB)
291         $(CAMLC) -a -o $@ $(TOPLIB)
292
293 partialclean::
294         rm -f ocaml
295
296 # The native toplevel
297
298 ocamlnat: ocamlopt otherlibs/dynlink/dynlink.cmxa $(NATTOPOBJS:.cmo=.cmx) 
299         $(CAMLOPT) $(LINKFLAGS) otherlibs/dynlink/dynlink.cmxa -o ocamlnat $(NATTOPOBJS:.cmo=.cmx) -linkall
300
301 toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
302
303 otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
304         cd otherlibs/dynlink && make allopt
305
306
307 # The configuration file
308
309 utils/config.ml: utils/config.mlp config/Makefile
310         @rm -f utils/config.ml
311         sed -e "s|%%LIBDIR%%|$(LIBDIR)|" \
312             -e "s|%%BYTERUN%%|ocamlrun|" \
313             -e 's|%%CCOMPTYPE%%|$(CCOMPTYPE)|' \
314             -e "s|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS)|" \
315             -e "s|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|" \
316             -e "s|%%PARTIALLD%%|$(PARTIALLD)|" \
317             -e "s|%%PACKLD%%|$(PACKLD)|" \
318             -e "s|%%BYTECCLIBS%%|$(BYTECCLIBS)|" \
319             -e "s|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|" \
320             -e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
321             -e 's|%%BINUTILS_NM%%|$(BINUTILS_NM)|' \
322             -e 's|%%BINUTILS_OBJCOPY%%|$(BINUTILS_OBJCOPY)|' \
323             -e "s|%%ARCH%%|$(ARCH)|" \
324             -e "s|%%MODEL%%|$(MODEL)|" \
325             -e "s|%%SYSTEM%%|$(SYSTEM)|" \
326             -e "s|%%EXT_OBJ%%|.$(O)|" \
327             -e "s|%%EXT_ASM%%|.$(S)|" \
328             -e "s|%%EXT_LIB%%|.$(A)|" \
329             -e "s|%%EXT_DLL%%|.dll|" \
330             -e "s|%%SYSTHREAD_SUPPORT%%|true|" \
331             -e 's|%%ASM%%|$(ASM)|' \
332             -e 's|%%MKDLL%%|$(MKDLL)|' \
333             -e 's|%%MKEXE%%|$(MKEXE)|' \
334             -e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
335             -e 's|%%CC_PROFILE%%||' \
336             utils/config.mlp > utils/config.ml
337         @chmod -w utils/config.ml
338
339 partialclean::
340         rm -f utils/config.ml
341
342 beforedepend:: utils/config.ml
343
344 # The parser
345
346 parsing/parser.mli parsing/parser.ml: parsing/parser.mly
347         $(CAMLYACC) $(YACCFLAGS) parsing/parser.mly
348
349 partialclean::
350         rm -f parsing/parser.mli parsing/parser.ml parsing/parser.output
351
352 beforedepend:: parsing/parser.mli parsing/parser.ml
353
354 # The lexer
355
356 parsing/lexer.ml: parsing/lexer.mll
357         $(CAMLLEX) parsing/lexer.mll
358
359 partialclean::
360         rm -f parsing/lexer.ml
361
362 beforedepend:: parsing/lexer.ml
363
364 # The auxiliary lexer for counting line numbers
365
366 parsing/linenum.ml: parsing/linenum.mll
367         $(CAMLLEX) parsing/linenum.mll
368
369 partialclean::
370         rm -f parsing/linenum.ml
371
372 beforedepend:: parsing/linenum.ml
373
374 # The bytecode compiler compiled with the native-code compiler
375
376 ocamlc.opt: $(COMPOBJS:.cmo=.cmx)
377         cd asmrun ; $(MAKEREC) meta.$(O) dynlink.$(O)
378         $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) asmrun/meta.$(O) asmrun/dynlink.$(O)
379
380 partialclean::
381         rm -f ocamlc.opt
382
383 # The native-code compiler compiled with itself
384
385 ocamlopt.opt: $(OPTOBJS:.cmo=.cmx)
386         $(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt $(OPTOBJS:.cmo=.cmx)
387
388 partialclean::
389         rm -f ocamlopt.opt
390
391 $(OPTOBJS:.cmo=.cmx): ocamlopt
392
393 # The numeric opcodes
394
395 bytecomp/opcodes.ml: byterun/instruct.h
396         sed -n -e "/^enum/p" -e "s|,||g" -e "/^  /p" byterun/instruct.h | \
397         gawk -f tools/make-opcodes > bytecomp/opcodes.ml
398
399 partialclean::
400         rm -f bytecomp/opcodes.ml
401
402 beforedepend:: bytecomp/opcodes.ml
403
404 # The predefined exceptions and primitives
405
406 byterun/primitives:
407         cd byterun ; $(MAKEREC) primitives
408
409 bytecomp/runtimedef.ml: byterun/primitives byterun/fail.h
410         (echo 'let builtin_exceptions = [|'; \
411          sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$|  \1;|p' byterun/fail.h | \
412          sed -e '$$s/;$$//'; \
413          echo '|]'; \
414          echo 'let builtin_primitives = [|'; \
415          sed -e 's/.*/  "&";/' -e '$$s/;$$//' byterun/primitives; \
416          echo '|]') > bytecomp/runtimedef.ml
417
418 partialclean::
419         rm -f bytecomp/runtimedef.ml
420
421 beforedepend:: bytecomp/runtimedef.ml
422
423 # Choose the right machine-dependent files
424
425 asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml
426         cp asmcomp/$(ARCH)/arch.ml asmcomp/arch.ml
427
428 partialclean::
429         rm -f asmcomp/arch.ml
430
431 beforedepend:: asmcomp/arch.ml
432
433 ifeq ($(TOOLCHAIN),msvc)
434 ASMCOMP_PROC=asmcomp/$(ARCH)/proc_nt.ml
435 ASMCOMP_EMIT=asmcomp/$(ARCH)/emit_nt.mlp
436 else
437 ASMCOMP_PROC=asmcomp/$(ARCH)/proc.ml
438 ASMCOMP_EMIT=asmcomp/$(ARCH)/emit.mlp
439 endif
440
441 asmcomp/proc.ml: $(ASMCOMP_PROC)
442         cp $(ASMCOMP_PROC) asmcomp/proc.ml
443
444 partialclean::
445         rm -f asmcomp/proc.ml
446
447 beforedepend:: asmcomp/proc.ml
448
449 asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
450         cp asmcomp/$(ARCH)/selection.ml asmcomp/selection.ml
451
452 partialclean::
453         rm -f asmcomp/selection.ml
454
455 beforedepend:: asmcomp/selection.ml
456
457 asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
458         cp asmcomp/$(ARCH)/reload.ml asmcomp/reload.ml
459
460 partialclean::
461         rm -f asmcomp/reload.ml
462
463 beforedepend:: asmcomp/reload.ml
464
465 asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
466         cp asmcomp/$(ARCH)/scheduling.ml asmcomp/scheduling.ml
467
468 partialclean::
469         rm -f asmcomp/scheduling.ml
470
471 beforedepend:: asmcomp/scheduling.ml
472
473 # Preprocess the code emitters
474
475 asmcomp/emit.ml: $(ASMCOMP_EMIT) tools/cvt_emit
476         boot/ocamlrun tools/cvt_emit < $(ASMCOMP_EMIT) > asmcomp/emit.ml
477
478 partialclean::
479         rm -f asmcomp/emit.ml
480
481 beforedepend:: asmcomp/emit.ml
482
483 tools/cvt_emit: tools/cvt_emit.mll
484         cd tools ; $(MAKEREC) cvt_emit
485
486 # The "expunge" utility
487
488 expunge: $(EXPUNGEOBJS)
489         $(CAMLC) $(LINKFLAGS) -o expunge $(EXPUNGEOBJS)
490
491 partialclean::
492         rm -f expunge
493
494 # The runtime system for the bytecode compiler
495
496 runtime: makeruntime stdlib/libcamlrun.$(A)
497
498 makeruntime:
499         cd byterun ; $(MAKEREC) all
500 stdlib/libcamlrun.$(A): byterun/libcamlrun.$(A)
501         cp byterun/libcamlrun.$(A) stdlib/libcamlrun.$(A)
502 clean::
503         cd byterun ; $(MAKEREC) clean
504         rm -f stdlib/libcamlrun.$(A)
505 alldepend::
506         cd byterun ; $(MAKEREC) depend
507
508 # The runtime system for the native-code compiler
509
510 runtimeopt: makeruntimeopt stdlib/libasmrun.$(A)
511
512 makeruntimeopt:
513         cd asmrun ; $(MAKEREC) all
514 stdlib/libasmrun.$(A): asmrun/libasmrun.$(A)
515         cp asmrun/libasmrun.$(A) stdlib/libasmrun.$(A)
516 clean::
517         cd asmrun ; $(MAKEREC) clean
518         rm -f stdlib/libasmrun.$(A)
519 alldepend::
520         cd asmrun ; $(MAKEREC) depend
521
522 # The library
523
524 library:
525         cd stdlib ; $(MAKEREC) all
526 library-cross:
527         cd stdlib ; $(MAKEREC) RUNTIME=../byterun/ocamlrun all
528 libraryopt:
529         cd stdlib ; $(MAKEREC) allopt
530 partialclean::
531         cd stdlib ; $(MAKEREC) clean
532 alldepend::
533         cd stdlib ; $(MAKEREC) depend
534
535 # The lexer and parser generators
536
537 ocamllex:
538         cd lex ; $(MAKEREC) all
539 ocamllex.opt:
540         cd lex ; $(MAKEREC) allopt
541 partialclean::
542         cd lex ; $(MAKEREC) clean
543 alldepend::
544         cd lex ; $(MAKEREC) depend
545
546 ocamlyacc:
547         cd yacc ; $(MAKEREC) all
548 clean::
549         cd yacc ; $(MAKEREC) clean
550
551 # Tools
552
553 ocamltools:
554         cd tools ; $(MAKEREC) all
555 ocamltoolsopt.opt:
556         cd tools ; $(MAKEREC) opt.opt
557 partialclean::
558         cd tools ; $(MAKEREC) clean
559 alldepend::
560         cd tools ; $(MAKEREC) depend
561
562 # OCamldoc
563
564 ocamldoc.byte: 
565         cd ocamldoc ; $(MAKEREC) all
566 ocamldoc.opt: 
567         cd ocamldoc ; $(MAKEREC) opt.opt
568 partialclean::
569         cd ocamldoc ; $(MAKEREC) clean
570 alldepend::
571         cd ocamldoc ; $(MAKEREC) depend
572
573 # The extra libraries
574
575 otherlibraries:
576         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i all; done
577 otherlibrariesopt:
578         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i allopt; done
579 partialclean::
580         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i partialclean; done
581 clean::
582         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i clean; done
583 alldepend::
584         for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i depend; done
585
586 # The replay debugger
587
588 ocamldebugger: ocamlc ocamlyacc ocamllex
589         cd debugger; $(MAKEREC) all
590 partialclean::
591         cd debugger; $(MAKEREC) clean
592 alldepend::
593         cd debugger; $(MAKEREC) depend
594
595 # Camlp4
596
597 camlp4out: ocamlc otherlibraries ocamlbuild-mixed-boot ocamlbuild.byte
598         ./build/camlp4-byte-only.sh
599 camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot ocamlbuild.native
600         ./build/camlp4-native-only.sh
601
602 # Ocamlbuild
603
604 ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-mixed-boot
605         ./build/ocamlbuild-byte-only.sh
606 ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
607         ./build/ocamlbuild-native-only.sh
608 ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
609         ./build/ocamlbuildlib-native-only.sh
610
611
612 .PHONY: ocamlbuild-mixed-boot
613 ocamlbuild-mixed-boot:
614         ./build/mixed-boot.sh
615 partialclean::
616         rm -rf _build
617
618 # The Win32 toplevel GUI
619
620 win32gui:
621         cd win32caml ; $(MAKE) all
622
623 clean::
624         cd win32caml ; $(MAKE) clean
625
626 # Default rules
627
628 .SUFFIXES: .ml .mli .cmo .cmi .cmx
629
630 .ml.cmo:
631         $(CAMLC) $(COMPFLAGS) -c $<
632
633 .mli.cmi:
634         $(CAMLC) $(COMPFLAGS) -c $<
635
636 .ml.cmx:
637         $(CAMLOPT) $(COMPFLAGS) -c $<
638
639 partialclean::
640         rm -f utils/*.cm* utils/*.$(O) utils/*.$(S)
641         rm -f parsing/*.cm* parsing/*.$(O) parsing/*.$(S)
642         rm -f typing/*.cm* typing/*.$(O) typing/*.$(S)
643         rm -f bytecomp/*.cm* bytecomp/*.$(O) bytecomp/*.$(S)
644         rm -f asmcomp/*.cm* asmcomp/*.$(O) asmcomp/*.$(S)
645         rm -f driver/*.cm* driver/*.$(O) driver/*.$(S)
646         rm -f toplevel/*.cm* toplevel/*.$(O) toplevel/*.$(S)
647         rm -f tools/*.cm* tools/*.$(O) tools/*.$(S)
648
649 depend: beforedepend
650         (for d in utils parsing typing bytecomp asmcomp driver toplevel; \
651          do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \
652          done) > .depend
653
654 alldepend:: depend
655
656 include .depend