1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
|
|
|
# Objective Caml #
|
|
|
|
# #
|
|
|
|
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 1999 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
2001-12-07 05:41:02 -08:00
|
|
|
# under the terms of the GNU Library General Public License, with #
|
|
|
|
# the special exception on linking described in file ../LICENSE. #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
!include ..\config\Makefile.nt
|
|
|
|
|
1997-10-16 09:10:53 -07:00
|
|
|
CC=$(BYTECC)
|
2001-08-28 07:47:48 -07:00
|
|
|
CFLAGS=-DIN_OCAMLRUN -DOCAML_STDLIB_DIR="\"$(LIBDIR:\=\\)\""
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-09-04 08:52:56 -07:00
|
|
|
OBJS=interp.obj misc.obj stacks.obj fix_code.obj startup.obj main.obj \
|
|
|
|
fail.obj signals.obj freelist.obj major_gc.obj minor_gc.obj \
|
|
|
|
memory.obj alloc.obj roots.obj compare.obj ints.obj floats.obj \
|
|
|
|
str.obj array.obj io.obj extern.obj intern.obj hash.obj sys.obj \
|
1996-09-06 09:51:56 -07:00
|
|
|
meta.obj parsing.obj gc_ctrl.obj terminfo.obj md5.obj obj.obj lexing.obj \
|
2000-04-04 06:19:12 -07:00
|
|
|
win32.obj printexc.obj callback.obj debugger.obj weak.obj compact.obj \
|
2001-08-28 07:47:48 -07:00
|
|
|
finalise.obj custom.obj backtrace.obj globroots.obj dynlink.obj
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1998-05-11 11:42:59 -07:00
|
|
|
PRIMS=alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c \
|
1996-02-26 05:52:15 -08:00
|
|
|
intern.c interp.c ints.c io.c lexing.c md5.c meta.c obj.c parsing.c \
|
2001-08-28 07:47:48 -07:00
|
|
|
signals.c str.c sys.c terminfo.c callback.c weak.c finalise.c stacks.c \
|
|
|
|
dynlink.c
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2001-12-03 07:45:03 -08:00
|
|
|
PUBLIC_INCLUDES=mlvalues.h alloc.h misc.h callback.h fail.h custom.h intext.h
|
1998-04-20 05:41:00 -07:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
all: ocamlrun.exe libcamlrun.lib
|
2000-03-16 19:46:01 -08:00
|
|
|
if not exist ..\stdlib\caml mkdir ..\stdlib\caml
|
|
|
|
cp $(PUBLIC_INCLUDES) ..\stdlib\caml
|
|
|
|
sed -e "/#include .*\/m.h/r ..\config\m.h" \
|
|
|
|
-e "/#include .*\/s.h/r ..\config\s.h" \
|
|
|
|
-e "/#include /d" config.h > ..\stdlib\caml\config.h
|
|
|
|
sed -e "/#include .*gc\.h/d" \
|
|
|
|
-e "/#define Alloc_small/,/^}/d" \
|
|
|
|
-e "/Modify/,/^}/d" memory.h > ..\stdlib\caml\memory.h
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
ocamlrun.exe: $(OBJS:.obj=.dobj) prims.dobj
|
2002-03-06 08:54:50 -08:00
|
|
|
link /nologo /out:ocamlrun.exe $(OBJS:.obj=.dobj) prims.dobj $(BYTECCLIBS)
|
2001-08-28 07:47:48 -07:00
|
|
|
|
|
|
|
libcamlrun.lib: $(OBJS:.obj=.sobj)
|
|
|
|
$(MKLIB)libcamlrun.lib $(OBJS:.obj=.sobj)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
install:
|
1996-04-30 07:53:58 -07:00
|
|
|
cp ocamlrun.exe $(BINDIR)\ocamlrun.exe
|
2001-08-28 07:47:48 -07:00
|
|
|
cp ocamlrun.lib $(LIBDIR)\ocamlrun.lib
|
1997-01-05 06:06:13 -08:00
|
|
|
cp libcamlrun.lib $(LIBDIR)\libcamlrun.lib
|
1996-02-21 02:49:46 -08:00
|
|
|
if not exist $(LIBDIR)\caml mkdir $(LIBDIR)\caml
|
2002-02-19 06:37:44 -08:00
|
|
|
for %i in ($(PUBLIC_INCLUDES)) do sed -f ../tools/cleanup-header %i > $(LIBDIR)\caml\%i
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
clean:
|
2001-08-28 07:47:48 -07:00
|
|
|
rm -f *.exe *.dobj *.sobj *.lib
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f primitives prims.c opnames.h jumptbl.h
|
|
|
|
|
|
|
|
primitives : $(PRIMS)
|
2001-08-28 07:47:48 -07:00
|
|
|
sed -n -e "s/CAMLprim value \([a-z0-9_][a-z0-9_]*\).*/\1/p" \
|
1996-02-21 02:49:46 -08:00
|
|
|
$(PRIMS) > primitives
|
|
|
|
|
|
|
|
prims.c : primitives
|
|
|
|
echo #include "mlvalues.h" > prims.c
|
|
|
|
echo #include "prims.h" >> prims.c
|
|
|
|
sed -e "s/.*/extern value &();/" primitives >> prims.c
|
2001-08-28 07:47:48 -07:00
|
|
|
echo c_primitive builtin_cprim[] = { >> prims.c
|
1996-02-21 02:49:46 -08:00
|
|
|
sed -e "s/.*/ &,/" primitives >> prims.c
|
|
|
|
echo 0 }; >> prims.c
|
2001-08-28 07:47:48 -07:00
|
|
|
echo char * names_of_builtin_cprim[] = { >> prims.c
|
1996-02-21 02:49:46 -08:00
|
|
|
sed -e "s/.*/ \"^&\",/" primitives >> prims.c
|
|
|
|
echo 0 }; >> prims.c
|
|
|
|
|
|
|
|
opnames.h : instruct.h
|
|
|
|
sed -e "/\/\*/d" \
|
|
|
|
-e "s\enum /char * names_of_/" \
|
|
|
|
-e "s/{$$/[] = {/" \
|
|
|
|
-e "s/\([A-Z][A-Z_0-9]*\)/"\1"/g" instruct.h > opnames.h
|
|
|
|
|
|
|
|
# jumptbl.h is required only if you have GCC 2.0 or later
|
|
|
|
jumptbl.h : instruct.h
|
|
|
|
sed -n -e "/^ /s/ \([A-Z]\)/ \&\&lbl_\1/gp" \
|
|
|
|
-e "/^}/q" instruct.h > jumptbl.h
|
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
.SUFFIXES: .dobj .sobj
|
|
|
|
|
|
|
|
.c.dobj:
|
|
|
|
$(CC) $(CFLAGS) $(DLLCCCOMPOPTS) -c $<
|
|
|
|
mv $*.obj $*.dobj
|
|
|
|
.c.sobj:
|
|
|
|
$(CC) $(CFLAGS) $(BYTECCCOMPOPTS) -c $<
|
|
|
|
mv $*.obj $*.sobj
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
depend:
|
2001-08-28 07:47:48 -07:00
|
|
|
sed -e "s/\.o/.dobj/g" .depend > .depend.nt
|
|
|
|
sed -e "s/\.o/.sobj/g" .depend >> .depend.nt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
!include .depend.nt
|