119 lines
4.8 KiB
Makefile
119 lines
4.8 KiB
Makefile
#########################################################################
|
||
# #
|
||
# Objective Caml #
|
||
# #
|
||
# Damien Doligez, projet Para, INRIA Rocquencourt #
|
||
# #
|
||
# Copyright 1999 Institut National de Recherche en Informatique et #
|
||
# en Automatique. All rights reserved. This file is distributed #
|
||
# under the terms of the GNU Library General Public License, with #
|
||
# the special exception on linking described in file ../LICENSE. #
|
||
# #
|
||
#########################################################################
|
||
|
||
# $Id$
|
||
|
||
PPCC = mrc
|
||
PPCCOptions = -w 29,30,35 -i ::config: {cdbgflag}
|
||
PPCLinkOptions = -d {ldbgflag}
|
||
PPCLibs = "{sharedlibraries}MathLib" "{ppclibraries}PPCCRuntime.o" ¶
|
||
"{ppclibraries}PPCToolLibs.o" "{sharedlibraries}StdCLib" ¶
|
||
"{ppclibraries}StdCRuntime.o" "{sharedlibraries}InterfaceLib"
|
||
|
||
PPCOBJS = :interp.c.x :misc.c.x :stacks.c.x ¶
|
||
:fix_code.c.x :startup.c.x :main.c.x ¶
|
||
:freelist.c.x :major_gc.c.x :minor_gc.c.x :memory.c.x :alloc.c.x :roots.c.x ¶
|
||
:fail.c.x :signals.c.x ¶
|
||
:compare.c.x :ints.c.x :floats.c.x :str.c.x :array.c.x :io.c.x :extern.c.x ¶
|
||
:intern.c.x ¶
|
||
:hash.c.x :sys.c.x :meta.c.x :parsing.c.x ¶
|
||
:gc_ctrl.c.x :terminfo.c.x :md5.c.x ¶
|
||
:obj.c.x :lexing.c.x :macintosh.c.x ¶
|
||
:rotatecursor.c.x :printexc.c.x :callback.c.x ¶
|
||
:debugger.c.x :weak.c.x :compact.c.x ¶
|
||
:instrtrace.c.x :finalise.c.x :custom.c.x :backtrace.c.x :globroots.c.x
|
||
|
||
PRIMS = alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c ¶
|
||
intern.c interp.c ints.c io.c lexing.c md5.c meta.c obj.c parsing.c ¶
|
||
signals.c str.c sys.c terminfo.c callback.c weak.c finalise.c stacks.c ¶
|
||
dynlink.c
|
||
|
||
PUBLIC_INCLUDES = mlvalues.h alloc.h misc.h callback.h fail.h custom.h
|
||
|
||
all Ä libcamlrun-gui.x libcamlrun.x ocamlrun
|
||
|
||
libcamlrun-gui.x Ä {PPCOBJS}
|
||
ppclink {PPCLinkOptions} -xm library -o libcamlrun-gui.x {PPCOBJS}
|
||
|
||
libcamlrun.x Ä libcamlrun-gui.x mpwtool.c.x
|
||
ppclink {PPCLinkOptions} -xm library -o libcamlrun.x libcamlrun-gui.x mpwtool.c.x
|
||
|
||
ocamlrun Ä libcamlrun.x :prims.c.x
|
||
ppclink -c 'MPS ' -t MPST {PPCLinkOptions} -o ocamlrun prims.c.x ¶
|
||
libcamlrun.x {PPCLibs}
|
||
|
||
install Ä
|
||
duplicate -y ocamlrun "{BINDIR}ocamlrun"
|
||
duplicate -y libcamlrun.x libcamlrun-gui.x "{LIBDIR}"
|
||
if "`exists -d "{LIBDIR}caml:"`" == ""
|
||
newfolder "{LIBDIR}caml:"
|
||
end
|
||
duplicate -y {PUBLIC_INCLUDES} "{LIBDIR}caml:"
|
||
duplicate -y config.h "{LIBDIR}caml:"
|
||
open -t "{LIBDIR}caml:config.h"
|
||
find ¥ "{LIBDIR}caml:config.h"
|
||
find /Å'#include <m.h>'Å°/ "{LIBDIR}caml:config.h"
|
||
catenate ::config:m.h > "{LIBDIR}caml:config.h".¤
|
||
find ¥ "{LIBDIR}caml:config.h"
|
||
find /Å'#include <s.h>'Å°/ "{LIBDIR}caml:config.h"
|
||
catenate ::config:s.h > "{LIBDIR}caml:config.h".¤
|
||
find ¥ "{LIBDIR}caml:config.h"
|
||
clear -c ° /Å'#include "'Å/ "{LIBDIR}caml:config.h"
|
||
close -y "{LIBDIR}caml:config.h"
|
||
duplicate -y memory.h "{LIBDIR}caml:"
|
||
open -t "{LIBDIR}caml:memory.h"
|
||
find ¥ "{LIBDIR}caml:memory.h"
|
||
clear -c ° /Å'#include "'Å'gc.h'Å/ "{LIBDIR}caml:memory.h"
|
||
find ¥ "{LIBDIR}caml:memory.h"
|
||
clear /'#define Alloc_small'/:/¥}/ "{LIBDIR}caml:memory.h"
|
||
find ¥ "{LIBDIR}caml:memory.h"
|
||
clear /'#define Modify'/:/¥}/ "{LIBDIR}caml:memory.h"
|
||
close -y "{LIBDIR}caml:memory.h"
|
||
|
||
clean Ä
|
||
delete -i Å.[ox] || set status 0
|
||
delete -i ocamlrun primitives prims.c opnames.h interp.a.lst
|
||
delete -i ocamlrun.xcoff ocamlrun.dbg
|
||
|
||
primitives Ä {PRIMS}
|
||
streamedit -d -e "/CAMLprim value ([a-z0-9_]+)¨0Å/ print ¨0" {PRIMS} ¶
|
||
> primitives
|
||
|
||
:prims.c Ä primitives
|
||
begin
|
||
echo '#include "mlvalues.h"'
|
||
echo '#include "prims.h"'
|
||
streamedit -e '1,$ change "extern value " . "();"' primitives
|
||
echo 'c_primitive builtin_cprim [] = {'
|
||
streamedit -e '1,$ change " " . ","' primitives
|
||
echo '0 };'
|
||
echo 'char * names_of_builtin_cprim [] = {'
|
||
streamedit -e '1,$ change " ¶"" . "¶","' primitives
|
||
echo '0 };'
|
||
end > prims.c
|
||
|
||
:opnames.h Ä :instruct.h
|
||
streamedit -e "/¶¶/'*'/ delete" ¶
|
||
-e "/enum / replace // 'char * names_of_'" ¶
|
||
-e '/{°/ replace // "[] = {"' ¶
|
||
-e "1,$ replace /<2F>([A-Z][A-Z_0-9]*)¨0/ '¶"' ¨0 '¶"' -c °" ¶
|
||
instruct.h > opnames.h
|
||
|
||
:md5.c.x Ä
|
||
{PPCC} :md5.c -o :md5.c.x -opt off {PPCCOptions} -opt off
|
||
|
||
depend Ä :prims.c :opnames.h
|
||
begin
|
||
makedepend -w -objext .x Å.c
|
||
end | streamedit -e "/¶t/ replace // ' ' -c °" > Makefile.Mac.depend
|