1996-02-21 02:49:46 -08:00
|
|
|
# The main Makefile
|
|
|
|
|
|
|
|
!include config\Makefile.nt
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLC=boot\ocamlrun boot\ocamlc -I boot
|
|
|
|
CAMLOPT=boot\ocamlrun .\ocamlopt -I stdlib
|
1996-02-21 02:49:46 -08:00
|
|
|
COMPFLAGS=$(INCLUDES)
|
|
|
|
LINKFLAGS=
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLYACC=boot\ocamlyacc
|
1996-02-21 02:49:46 -08:00
|
|
|
YACCFLAGS=
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLLEX=boot\ocamlrun boot\ocamllex
|
|
|
|
CAMLDEP=boot\ocamlrun tools\ocamldep
|
1996-02-21 02:49:46 -08:00
|
|
|
DEPFLAGS=$(INCLUDES)
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLRUN=byterun\ocamlrun
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel
|
|
|
|
|
|
|
|
UTILS=utils\misc.cmo utils\tbl.cmo utils\config.cmo \
|
1998-12-02 06:39:27 -08:00
|
|
|
utils\clflags.cmo utils\terminfo.cmo utils\ccomp.cmo utils\warnings.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-03-04 02:19:15 -08:00
|
|
|
OPTUTILS=$(UTILS) utils\nativeint.cmo
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
PARSING=parsing\linenum.cmo parsing\location.cmo parsing\longident.cmo \
|
1997-08-22 01:55:41 -07:00
|
|
|
parsing\syntaxerr.cmo parsing\pstream.cmo parsing\parser.cmo \
|
|
|
|
parsing\lexer.cmo parsing\parse.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
TYPING=typing\ident.cmo typing\path.cmo \
|
1996-09-26 08:05:31 -07:00
|
|
|
typing\primitive.cmo typing\types.cmo \
|
1997-09-02 09:01:39 -07:00
|
|
|
typing\btype.cmo \
|
1996-04-22 04:15:41 -07:00
|
|
|
typing\subst.cmo typing\predef.cmo \
|
|
|
|
typing\datarepr.cmo typing\env.cmo \
|
1998-08-14 02:57:43 -07:00
|
|
|
typing\typedtree.cmo typing\ctype.cmo \
|
|
|
|
typing\printtyp.cmo typing\includeclass.cmo \
|
1996-04-22 04:15:41 -07:00
|
|
|
typing\mtype.cmo typing\includecore.cmo \
|
|
|
|
typing\includemod.cmo typing\parmatch.cmo \
|
1996-02-21 02:49:46 -08:00
|
|
|
typing\typetexp.cmo typing\typecore.cmo \
|
1996-04-22 04:15:41 -07:00
|
|
|
typing\typedecl.cmo typing\typeclass.cmo \
|
|
|
|
typing\typemod.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
COMP=bytecomp\lambda.cmo bytecomp\printlambda.cmo \
|
1998-04-07 01:38:17 -07:00
|
|
|
bytecomp\typeopt.cmo bytecomp\translobj.cmo \
|
|
|
|
bytecomp\matching.cmo bytecomp\translcore.cmo \
|
1996-04-22 04:15:41 -07:00
|
|
|
bytecomp\translclass.cmo bytecomp\translmod.cmo \
|
1996-02-21 02:49:46 -08:00
|
|
|
bytecomp\simplif.cmo bytecomp\runtimedef.cmo
|
|
|
|
|
|
|
|
BYTECOMP=bytecomp\meta.cmo bytecomp\instruct.cmo bytecomp\bytegen.cmo \
|
|
|
|
bytecomp\printinstr.cmo bytecomp\opcodes.cmo bytecomp\emitcode.cmo \
|
|
|
|
bytecomp\symtable.cmo bytecomp\bytelibrarian.cmo bytecomp\bytelink.cmo
|
|
|
|
|
|
|
|
ASMCOMP=asmcomp\arch.cmo asmcomp\cmm.cmo asmcomp\printcmm.cmo \
|
|
|
|
asmcomp\reg.cmo asmcomp\mach.cmo asmcomp\proc.cmo \
|
|
|
|
asmcomp\clambda.cmo asmcomp\compilenv.cmo \
|
|
|
|
asmcomp\closure.cmo asmcomp\cmmgen.cmo \
|
1997-07-24 04:49:12 -07:00
|
|
|
asmcomp\printmach.cmo asmcomp\selectgen.cmo asmcomp\selection.cmo \
|
|
|
|
asmcomp\liveness.cmo asmcomp\spill.cmo asmcomp\split.cmo \
|
|
|
|
asmcomp\interf.cmo asmcomp\coloring.cmo \
|
|
|
|
asmcomp\reloadgen.cmo asmcomp\reload.cmo \
|
|
|
|
asmcomp\printlinear.cmo asmcomp\linearize.cmo \
|
|
|
|
asmcomp\schedgen.cmo asmcomp\scheduling.cmo \
|
1996-02-21 02:49:46 -08:00
|
|
|
asmcomp\emitaux.cmo asmcomp\emit.cmo asmcomp\asmgen.cmo \
|
|
|
|
asmcomp\asmlink.cmo asmcomp\asmlibrarian.cmo
|
|
|
|
|
1998-04-06 09:32:10 -07:00
|
|
|
DRIVER=driver\errors.cmo driver\compile.cmo driver\main_args.cmo driver\main.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
OPTDRIVER=driver\opterrors.cmo driver\optcompile.cmo driver\optmain.cmo
|
|
|
|
|
|
|
|
TOPLEVEL=driver\errors.cmo driver\compile.cmo \
|
1997-09-02 09:01:39 -07:00
|
|
|
toplevel\genprintval.cmo \
|
1996-02-21 02:49:46 -08:00
|
|
|
toplevel\printval.cmo toplevel\toploop.cmo \
|
|
|
|
toplevel\trace.cmo toplevel\topdirs.cmo
|
|
|
|
|
|
|
|
TOPLEVELMAIN=toplevel\topmain.cmo
|
|
|
|
|
|
|
|
COMPOBJS=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(DRIVER)
|
|
|
|
|
|
|
|
TOPLIB=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(TOPLEVEL)
|
|
|
|
|
|
|
|
TOPOBJS=$(TOPLIB) $(TOPLEVELMAIN)
|
|
|
|
|
1997-03-04 02:19:15 -08:00
|
|
|
OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
EXPUNGEOBJS=utils\misc.cmo utils\tbl.cmo \
|
|
|
|
utils\config.cmo utils\clflags.cmo \
|
1998-08-14 02:57:43 -07:00
|
|
|
typing\ident.cmo typing\path.cmo typing\types.cmo typing\btype.cmo \
|
|
|
|
typing\predef.cmo bytecomp\runtimedef.cmo bytecomp\symtable.cmo \
|
1996-02-21 02:49:46 -08:00
|
|
|
toplevel\expunge.cmo
|
|
|
|
|
1997-03-05 02:48:39 -08:00
|
|
|
PERVASIVES=arg array callback char digest filename format gc hashtbl \
|
|
|
|
lexing list map obj parsing pervasives printexc printf queue random \
|
1997-12-09 01:14:38 -08:00
|
|
|
set sort stack string stream sys oo genlex topdirs toploop weak lazy \
|
|
|
|
marshal
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Recompile the system using the bootstrap compiler
|
1996-04-30 07:53:58 -07:00
|
|
|
all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml otherlibraries
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
# The compilation of ocaml will fail if the runtime has changed.
|
1996-02-21 02:49:46 -08:00
|
|
|
# Never mind, just do make bootstrap to reach fixpoint again.
|
|
|
|
|
|
|
|
# Compile everything the first time
|
1997-02-16 05:36:42 -08:00
|
|
|
world: coldstart all
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Set up the configuration files
|
1998-08-14 02:57:43 -07:00
|
|
|
configure: FORCE
|
1996-02-21 02:49:46 -08:00
|
|
|
cp config\m-nt.h config\m.h
|
|
|
|
cp config\s-nt.h config\s.h
|
1996-02-22 04:51:04 -08:00
|
|
|
cp config\Makefile.nt config\Makefile
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Complete bootstrapping cycle
|
|
|
|
bootstrap:
|
|
|
|
# Save the original bootstrap compiler
|
|
|
|
$(MAKEREC) backup
|
|
|
|
# Promote the new compiler but keep the old runtime
|
1996-04-30 07:53:58 -07:00
|
|
|
# This compiler runs on boot\ocamlrun and produces bytecode for byterun\ocamlrun
|
1996-02-21 02:49:46 -08:00
|
|
|
$(MAKEREC) promote-cross
|
1996-04-30 07:53:58 -07:00
|
|
|
# Rebuild ocamlc and ocamllex (run on byterun\ocamlrun)
|
1997-02-16 05:36:42 -08:00
|
|
|
$(MAKEREC) partialclean
|
1996-04-30 07:53:58 -07:00
|
|
|
$(MAKEREC) ocamlc ocamllex
|
|
|
|
# Rebuild the library (using byterun\ocamlrun .\ocamlc)
|
1996-02-21 02:49:46 -08:00
|
|
|
$(MAKEREC) library-cross
|
|
|
|
# Promote the new compiler and the new runtime
|
|
|
|
$(MAKEREC) promote
|
1996-04-30 07:53:58 -07:00
|
|
|
# Rebuild everything, including ocaml and the tools
|
1997-02-16 05:36:42 -08:00
|
|
|
$(MAKEREC) partialclean
|
1996-02-21 02:49:46 -08:00
|
|
|
$(MAKEREC) all
|
|
|
|
# Check if fixpoint reached
|
|
|
|
$(MAKEREC) compare
|
|
|
|
|
1996-05-07 06:08:11 -07:00
|
|
|
LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Start up the system from the distribution compiler
|
|
|
|
coldstart:
|
|
|
|
cd byterun & $(MAKEREC) all
|
1996-04-30 07:53:58 -07:00
|
|
|
cp byterun\ocamlrun.exe boot\ocamlrun.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
cd yacc & $(MAKEREC) all
|
1996-04-30 07:53:58 -07:00
|
|
|
cp yacc\ocamlyacc.exe boot\ocamlyacc.exe
|
|
|
|
cd stdlib & $(MAKEREC) COMPILER=..\boot\ocamlc all
|
1996-02-21 02:49:46 -08:00
|
|
|
cd stdlib & cp $(LIBFILES) ..\boot
|
|
|
|
|
|
|
|
# Save the current bootstrap compiler
|
1997-07-24 04:49:12 -07:00
|
|
|
MAXSAVED=boot\Saved\Saved.prev\Saved.prev\Saved.prev\Saved.prev\Saved.prev
|
1996-02-21 02:49:46 -08:00
|
|
|
backup:
|
|
|
|
if not exist boot\Saved mkdir boot\Saved
|
1997-07-24 04:49:12 -07:00
|
|
|
if exist $(MAXSAVED) rm -r $(MAXSAVED)
|
1996-02-21 02:49:46 -08:00
|
|
|
mv boot\Saved boot\Saved.prev
|
|
|
|
mkdir boot\Saved
|
|
|
|
mv boot\Saved.prev boot\Saved\Saved.prev
|
1996-04-30 07:53:58 -07:00
|
|
|
cp boot\ocamlrun.exe boot\Saved\ocamlrun.exe
|
|
|
|
cd boot & mv ocamlc ocamllex ocamlyacc.exe Saved
|
1996-02-21 02:49:46 -08:00
|
|
|
cd boot & cp $(LIBFILES) Saved
|
|
|
|
|
|
|
|
# Promote the newly compiled system to the rank of cross compiler
|
|
|
|
# (Runs on the old runtime, produces code for the new runtime)
|
|
|
|
promote-cross:
|
1996-04-30 07:53:58 -07:00
|
|
|
cp ocamlc boot\ocamlc
|
|
|
|
cp lex\ocamllex boot\ocamllex
|
|
|
|
cp yacc\ocamlyacc.exe boot\ocamlyacc.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
cd stdlib & cp $(LIBFILES) ..\boot
|
|
|
|
|
|
|
|
# Promote the newly compiled system to the rank of bootstrap compiler
|
|
|
|
# (Runs on the new runtime, produces code for the new runtime)
|
|
|
|
promote: promote-cross
|
1996-04-30 07:53:58 -07:00
|
|
|
cp byterun\ocamlrun.exe boot\ocamlrun.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Restore the saved bootstrap compiler if a problem arises
|
|
|
|
restore:
|
1996-02-26 05:52:15 -08:00
|
|
|
cd boot\Saved & mv * ..
|
1996-02-21 02:49:46 -08:00
|
|
|
rmdir boot\Saved
|
|
|
|
mv boot\Saved.prev boot\Saved
|
|
|
|
|
|
|
|
# Check if fixpoint reached
|
|
|
|
compare:
|
1996-04-30 07:53:58 -07:00
|
|
|
fc /b boot\ocamlc ocamlc
|
|
|
|
fc /b boot\ocamllex lex\ocamllex
|
1996-02-21 02:49:46 -08:00
|
|
|
echo "Fixpoint reached, bootstrap succeeded."
|
|
|
|
|
|
|
|
# Remove old bootstrap compilers
|
|
|
|
cleanboot:
|
|
|
|
rm -rf boot\Saved\Saved.prev\*
|
|
|
|
|
|
|
|
# Compile the native-code compiler
|
1996-04-30 07:53:58 -07:00
|
|
|
opt: runtimeopt ocamlopt libraryopt otherlibrariesopt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Installation
|
1996-02-22 04:51:04 -08:00
|
|
|
install: installbyt installopt
|
|
|
|
|
|
|
|
installbyt:
|
1996-02-21 02:49:46 -08:00
|
|
|
cd byterun & $(MAKEREC) install
|
1996-04-30 07:53:58 -07:00
|
|
|
cp ocamlc $(BINDIR)\ocamlc.exe
|
|
|
|
cp ocaml $(BINDIR)\ocaml.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
cd stdlib & $(MAKEREC) install
|
1996-04-30 07:53:58 -07:00
|
|
|
cp lex\ocamllex $(BINDIR)\ocamllex.exe
|
|
|
|
cp yacc\ocamlyacc.exe $(BINDIR)\ocamlyacc.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
$(CAMLC) -a -o $(LIBDIR)\toplevellib.cma $(TOPLIB)
|
1996-03-15 02:32:32 -08:00
|
|
|
cp expunge $(LIBDIR)\expunge.exe
|
1996-02-22 04:51:04 -08:00
|
|
|
cp toplevel\topmain.cmo $(LIBDIR)\topmain.cmo
|
|
|
|
cp toplevel\toploop.cmi $(LIBDIR)\toploop.cmi
|
|
|
|
cp toplevel\topdirs.cmi $(LIBDIR)\topdirs.cmi
|
1996-02-21 02:49:46 -08:00
|
|
|
cd tools & $(MAKEREC) install
|
1996-03-11 05:58:14 -08:00
|
|
|
for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) install & cd ..\..)
|
1996-03-18 04:07:01 -08:00
|
|
|
cd wingui & $(MAKE) -nologo install
|
1997-10-24 08:49:12 -07:00
|
|
|
copy /a README $(DISTRIB)\Readme.gen
|
|
|
|
copy /a README.win32 $(DISTRIB)\Readme.win
|
1996-03-18 04:07:01 -08:00
|
|
|
copy /a LICENSE $(DISTRIB)\License.txt
|
|
|
|
copy /a Changes $(DISTRIB)\Changes.txt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Installation of the native-code compiler
|
|
|
|
installopt:
|
|
|
|
cd asmrun & $(MAKEREC) install
|
1996-04-30 07:53:58 -07:00
|
|
|
cp ocamlopt $(BINDIR)\ocamlopt.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
cd stdlib & $(MAKEREC) installopt
|
1996-02-22 04:51:04 -08:00
|
|
|
for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) installopt & cd ..\..)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
clean:: partialclean
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The compiler
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlc: $(COMPOBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlc $(COMPOBJS)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlc
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The native-code compiler
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlopt: $(OPTOBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlopt $(OPTOBJS)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlopt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The toplevel
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocaml: $(TOPOBJS) expunge
|
|
|
|
$(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp $(TOPOBJS)
|
|
|
|
- $(CAMLRUN) .\expunge ocaml.tmp ocaml $(PERVASIVES)
|
|
|
|
rm -f ocaml.tmp
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocaml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The configuration file
|
|
|
|
|
|
|
|
utils\config.ml: utils\config.mlp config\Makefile.nt
|
|
|
|
@rm -f utils\config.ml
|
|
|
|
sed -e "s|%%%%LIBDIR%%%%|$(LIBDIR:\=/)|" \
|
1998-05-11 11:42:59 -07:00
|
|
|
-e "s|%%%%BYTERUN%%%%|ocamlrun|" \
|
1996-02-21 02:49:46 -08:00
|
|
|
-e "s|%%%%BYTECC%%%%|$(BYTECC) $(BYTECCLINKOPTS)|" \
|
|
|
|
-e "s|%%%%NATIVECC%%%%|$(NATIVECC) $(NATIVECCLINKOPTS)|" \
|
1997-05-13 07:02:58 -07:00
|
|
|
-e "s|%%%%PARTIALLD%%%%|lib /nologo /debugtype:cv|" \
|
1996-02-21 02:49:46 -08:00
|
|
|
-e "s|%%%%CCLIBS%%%%|$(CCLIBS)|" \
|
|
|
|
-e "s|%%%%ARCH%%%%|$(ARCH)|" \
|
|
|
|
-e "s|%%%%MODEL%%%%|$(MODEL)|" \
|
|
|
|
-e "s|%%%%SYSTEM%%%%|$(SYSTEM)|" \
|
|
|
|
-e "s|%%%%EXT_OBJ%%%%|.obj|" \
|
|
|
|
-e "s|%%%%EXT_ASM%%%%|.asm|" \
|
|
|
|
-e "s|%%%%EXT_LIB%%%%|.lib|" \
|
|
|
|
utils\config.mlp > utils\config.ml
|
|
|
|
@attrib +r utils\config.ml
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f utils\config.ml
|
|
|
|
|
|
|
|
beforedepend:: utils\config.ml
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
# The parser
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
parsing\parser.mli parsing\parser.ml: parsing\parser.mly
|
|
|
|
$(CAMLYACC) $(YACCFLAGS) parsing\parser.mly
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f parsing\parser.mli parsing\parser.ml parsing\parser.output
|
|
|
|
|
|
|
|
beforedepend:: parsing\parser.mli parsing\parser.ml
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
# The lexer
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
parsing\lexer.ml: parsing\lexer.mll
|
|
|
|
$(CAMLLEX) parsing\lexer.mll
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f parsing\lexer.ml
|
|
|
|
|
|
|
|
beforedepend:: parsing\lexer.ml
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
# The auxiliary lexer for counting line numbers
|
|
|
|
|
|
|
|
parsing\linenum.ml: parsing\linenum.mll
|
|
|
|
$(CAMLLEX) parsing\linenum.mll
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1997-02-04 07:40:22 -08:00
|
|
|
rm -f parsing\linenum.ml
|
|
|
|
|
|
|
|
beforedepend:: parsing\linenum.ml
|
|
|
|
|
1997-11-17 02:39:01 -08:00
|
|
|
# The bytecode compiler compiled with the native-code compiler
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-11-17 02:39:01 -08:00
|
|
|
ocamlc.opt: $(COMPOBJS:.cmo=.cmx)
|
1997-11-17 08:36:56 -08:00
|
|
|
cd asmrun & $(MAKEREC) meta.obj
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) asmrun\meta.obj
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlc.opt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The native-code compiler compiled with itself
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlopt.opt: $(OPTOBJS:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt $(OPTOBJS:.cmo=.cmx)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlopt.opt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
$(OPTOBJS:.cmo=.cmx): ocamlopt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The numeric opcodes
|
|
|
|
|
|
|
|
bytecomp\opcodes.ml: byterun\instruct.h
|
|
|
|
sed -n -e "/^enum/p" -e "s|,||g" -e "/^ /p" byterun\instruct.h | \
|
|
|
|
gawk -f tools\make-opcodes > bytecomp\opcodes.ml
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f bytecomp\opcodes.ml
|
|
|
|
|
|
|
|
beforedepend:: bytecomp\opcodes.ml
|
|
|
|
|
|
|
|
# The predefined exceptions and primitives
|
|
|
|
|
1996-10-09 09:20:19 -07:00
|
|
|
byterun\primitives:
|
|
|
|
cd byterun & $(MAKEREC) primitives
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
bytecomp\runtimedef.ml: byterun\primitives byterun\fail.h
|
1996-06-11 07:57:55 -07:00
|
|
|
echo let builtin_exceptions = ^[^| > bytecomp\runtimedef.ml
|
|
|
|
sed -n -e "s|.*/\* \(\"[A-Za-z_]*\"\) \*/$$| \1;|p" byterun\fail.h | \
|
1996-02-21 02:49:46 -08:00
|
|
|
sed -e "$$s|;$$||" >> bytecomp\runtimedef.ml
|
1996-06-11 07:57:55 -07:00
|
|
|
echo ^|^] >> bytecomp\runtimedef.ml
|
|
|
|
echo let builtin_primitives = ^[^| >> bytecomp\runtimedef.ml
|
|
|
|
sed -e "s|.*| \"^&\";|" -e "$$s|;$$||" byterun\primitives \
|
1996-02-21 02:49:46 -08:00
|
|
|
>> bytecomp\runtimedef.ml
|
1996-06-11 07:57:55 -07:00
|
|
|
echo ^|^] >> bytecomp\runtimedef.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f bytecomp\runtimedef.ml
|
|
|
|
|
|
|
|
beforedepend:: bytecomp\runtimedef.ml
|
|
|
|
|
1997-07-24 04:49:12 -07:00
|
|
|
# Choose the right machine-dependent files
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-07-24 04:49:12 -07:00
|
|
|
asmcomp\arch.ml: asmcomp\$(ARCH)\arch.ml
|
1997-09-02 09:01:39 -07:00
|
|
|
cp asmcomp\$(ARCH)\arch.ml asmcomp\arch.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f asmcomp\arch.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp\arch.ml
|
|
|
|
|
1997-07-24 04:49:12 -07:00
|
|
|
asmcomp\proc.ml: asmcomp\$(ARCH)\proc_nt.ml
|
1997-09-02 09:01:39 -07:00
|
|
|
cp asmcomp\$(ARCH)\proc_nt.ml asmcomp\proc.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f asmcomp\proc.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp\proc.ml
|
|
|
|
|
1997-07-24 04:49:12 -07:00
|
|
|
asmcomp\selection.ml: asmcomp\$(ARCH)\selection.ml
|
1997-09-02 09:01:39 -07:00
|
|
|
cp asmcomp\$(ARCH)\selection.ml asmcomp\selection.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp\selection.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp\selection.ml
|
|
|
|
|
|
|
|
asmcomp\reload.ml: asmcomp\$(ARCH)\reload.ml
|
1997-09-02 09:01:39 -07:00
|
|
|
cp asmcomp\$(ARCH)\reload.ml asmcomp\reload.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp\reload.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp\reload.ml
|
|
|
|
|
|
|
|
asmcomp\scheduling.ml: asmcomp\$(ARCH)\scheduling.ml
|
1997-09-02 09:01:39 -07:00
|
|
|
cp asmcomp\$(ARCH)\scheduling.ml asmcomp\scheduling.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp\scheduling.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp\scheduling.ml
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Preprocess the code emitters
|
|
|
|
|
1997-07-24 04:49:12 -07:00
|
|
|
asmcomp\emit.ml: asmcomp\$(ARCH)\emit_nt.mlp tools\cvt_emit
|
|
|
|
boot\ocamlrun tools\cvt_emit < asmcomp\$(ARCH)\emit_nt.mlp > asmcomp\emit.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f asmcomp\emit.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp\emit.ml
|
|
|
|
|
1996-10-07 06:19:16 -07:00
|
|
|
tools\cvt_emit: tools\cvt_emit.mll
|
1996-10-29 06:51:49 -08:00
|
|
|
cd tools && $(MAKEREC) cvt_emit
|
1996-10-07 06:19:16 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The "expunge" utility
|
|
|
|
|
|
|
|
expunge: $(EXPUNGEOBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o expunge $(EXPUNGEOBJS)
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f expunge
|
|
|
|
|
|
|
|
# The runtime system for the bytecode compiler
|
|
|
|
|
1997-01-05 06:06:13 -08:00
|
|
|
runtime: makeruntime stdlib\libcamlrun.lib
|
|
|
|
|
|
|
|
makeruntime:
|
1996-02-21 02:49:46 -08:00
|
|
|
cd byterun & $(MAKEREC) all
|
1997-03-05 02:48:39 -08:00
|
|
|
stdlib\libcamlrun.lib: byterun\libcamlrun.lib
|
1997-01-05 06:06:13 -08:00
|
|
|
cp byterun\libcamlrun.lib stdlib\libcamlrun.lib
|
1997-02-16 05:36:42 -08:00
|
|
|
clean::
|
1996-02-21 02:49:46 -08:00
|
|
|
cd byterun & $(MAKEREC) clean
|
1997-01-05 06:06:13 -08:00
|
|
|
rm -f stdlib\libcamlrun.lib
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
|
|
|
cd byterun & $(MAKEREC) depend
|
|
|
|
|
|
|
|
# The runtime system for the native-code compiler
|
|
|
|
|
|
|
|
runtimeopt: makeruntimeopt stdlib\libasmrun.lib
|
|
|
|
|
|
|
|
makeruntimeopt:
|
|
|
|
cd asmrun & $(MAKEREC) all
|
|
|
|
stdlib\libasmrun.lib: asmrun\libasmrun.lib
|
|
|
|
cp asmrun\libasmrun.lib stdlib\libasmrun.lib
|
1997-02-16 05:36:42 -08:00
|
|
|
clean::
|
1996-02-21 02:49:46 -08:00
|
|
|
cd asmrun & $(MAKEREC) clean
|
1997-01-05 06:06:13 -08:00
|
|
|
rm -f stdlib\libasmrun.lib
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
|
|
|
cd asmrun & $(MAKEREC) depend
|
|
|
|
|
|
|
|
# The library
|
|
|
|
|
|
|
|
library:
|
|
|
|
cd stdlib & $(MAKEREC) all
|
|
|
|
library-cross:
|
1996-04-30 07:53:58 -07:00
|
|
|
cd stdlib & $(MAKEREC) RUNTIME=..\byterun\ocamlrun all
|
1996-02-21 02:49:46 -08:00
|
|
|
libraryopt:
|
|
|
|
cd stdlib & $(MAKEREC) allopt
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
cd stdlib & $(MAKEREC) clean
|
|
|
|
alldepend::
|
|
|
|
cd stdlib & $(MAKEREC) depend
|
|
|
|
|
|
|
|
# The lexer and parser generators
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamllex:
|
1996-02-21 02:49:46 -08:00
|
|
|
cd lex & $(MAKEREC) all
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
cd lex & $(MAKEREC) clean
|
|
|
|
alldepend::
|
|
|
|
cd lex & $(MAKEREC) depend
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlyacc:
|
1996-02-21 02:49:46 -08:00
|
|
|
cd yacc & $(MAKEREC) all
|
1997-02-16 05:36:42 -08:00
|
|
|
clean::
|
1996-02-21 02:49:46 -08:00
|
|
|
cd yacc & $(MAKEREC) clean
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamltools:
|
1996-02-21 02:49:46 -08:00
|
|
|
cd tools & $(MAKEREC) all
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
cd tools & $(MAKEREC) clean
|
|
|
|
alldepend::
|
|
|
|
cd tools & $(MAKEREC) depend
|
|
|
|
|
|
|
|
# The extra libraries
|
|
|
|
|
|
|
|
otherlibraries:
|
1996-06-11 07:57:55 -07:00
|
|
|
-for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) all & cd ..\..)
|
1996-02-21 02:49:46 -08:00
|
|
|
otherlibrariesopt:
|
1996-06-11 07:57:55 -07:00
|
|
|
-for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) allopt & cd ..\..)
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
|
|
|
-for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) partialclean & cd ..\..)
|
1996-02-21 02:49:46 -08:00
|
|
|
clean::
|
1996-06-11 07:57:55 -07:00
|
|
|
-for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) clean & cd ..\..)
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
1996-06-11 07:57:55 -07:00
|
|
|
-for %i in ($(OTHERLIBRARIES)) do (cd otherlibs\%i & $(MAKEREC) depend & cd ..\..)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Default rules
|
|
|
|
|
|
|
|
.SUFFIXES: .ml .mli .cmo .cmi .cmx
|
|
|
|
|
|
|
|
.ml.cmo:
|
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
|
|
|
|
|
|
|
.ml.cmx:
|
|
|
|
$(CAMLOPT) $(COMPFLAGS) -c $<
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-26 05:52:15 -08:00
|
|
|
rm -f utils/*.cm* utils/*.obj utils/*.asm
|
|
|
|
rm -f parsing/*.cm* parsing/*.obj parsing/*.asm
|
|
|
|
rm -f typing/*.cm* typing/*.obj typing/*.asm
|
|
|
|
rm -f bytecomp/*.cm* bytecomp/*.obj bytecomp/*.asm
|
|
|
|
rm -f asmcomp/*.cm* asmcomp/*.obj asmcomp/*.asm
|
|
|
|
rm -f driver/*.cm* driver/*.obj driver/*.asm
|
|
|
|
rm -f toplevel/*.cm* toplevel/*.obj toplevel/*.asm
|
|
|
|
rm -f tools/*.cm* tools/*.obj tools/*.asm
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
depend: beforedepend
|
|
|
|
echo > .depend
|
|
|
|
for %d in (utils parsing typing bytecomp asmcomp driver toplevel) do $(CAMLDEP) $(DEPFLAGS) %d\*.mli %d\*.ml >> .depend
|
|
|
|
|
|
|
|
alldepend:: depend
|
|
|
|
|
|
|
|
!include .depend
|
1998-08-14 02:57:43 -07:00
|
|
|
|
|
|
|
FORCE:
|