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$
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include ../config/Makefile
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-10-16 09:10:53 -07:00
|
|
|
CC=$(BYTECC)
|
2002-06-07 02:49:45 -07:00
|
|
|
CFLAGS=-DIN_OCAMLRUN -DOCAML_STDLIB_DIR='"$(LIBDIR)"'
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
COMMONOBJS=interp.o misc.o stacks.o fix_code.o startup.o \
|
2007-02-23 01:29:45 -08:00
|
|
|
fail.o signals.o signals_byt.o freelist.o major_gc.o minor_gc.o \
|
2002-06-07 02:49:45 -07:00
|
|
|
memory.o alloc.o roots.o compare.o ints.o floats.o \
|
|
|
|
str.o array.o io.o extern.o intern.o hash.o sys.o \
|
|
|
|
meta.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o lexing.o \
|
|
|
|
win32.o printexc.o callback.o debugger.o weak.o compact.o \
|
|
|
|
finalise.o custom.o backtrace.o globroots.o dynlink.o
|
|
|
|
|
|
|
|
DOBJS=$(COMMONOBJS:.o=.$(DO)) prims.$(DO)
|
|
|
|
SOBJS=$(COMMONOBJS:.o=.$(SO)) main.$(SO)
|
2006-05-09 09:04:49 -07:00
|
|
|
DBGOBJS=$(COMMONOBJS:.o=.$(DBGO)) prims.$(DBGO) main.$(DBGO) instrtrace.$(DBGO)
|
|
|
|
|
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
|
|
|
|
2002-06-17 05:24:42 -07:00
|
|
|
PUBLIC_INCLUDES=alloc.h callback.h config.h custom.h fail.h intext.h \
|
2004-11-24 16:06:06 -08:00
|
|
|
memory.h misc.h mlvalues.h printexc.h signals.h compatibility.h
|
1998-04-20 05:41:00 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
all: ocamlrun.exe libcamlrun.$(A)
|
|
|
|
|
|
|
|
ocamlrun.exe: ocamlrun.dll main.$(DO)
|
2006-09-26 02:37:50 -07:00
|
|
|
$(call MKEXE,ocamlrun.exe,main.$(DO) ocamlrun.$(A))
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
ocamlrun.dll: $(DOBJS)
|
|
|
|
$(call MKDLL,ocamlrun.dll,ocamlrun.$(A),$(DOBJS) $(BYTECCLIBS))
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
libcamlrun.$(A): $(SOBJS)
|
|
|
|
$(call MKLIB,libcamlrun.$(A),$(SOBJS))
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2006-05-09 09:04:49 -07:00
|
|
|
ocamlrund.exe: opnames.h $(DBGOBJS)
|
2006-09-28 13:38:05 -07:00
|
|
|
$(call MKEXE,ocamlrund.exe,$(BYTECCDBGCOMPOPTS) $(DBGOBJS))
|
2006-05-09 09:04:49 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
install:
|
2002-06-07 02:49:45 -07:00
|
|
|
cp ocamlrun.exe $(BINDIR)/ocamlrun.exe
|
|
|
|
cp ocamlrun.dll $(BINDIR)/ocamlrun.dll
|
|
|
|
cp ocamlrun.$(A) $(LIBDIR)/ocamlrun.$(A)
|
|
|
|
cp libcamlrun.$(A) $(LIBDIR)/libcamlrun.$(A)
|
|
|
|
test -d $(LIBDIR)/caml || mkdir -p $(LIBDIR)/caml
|
|
|
|
for i in $(PUBLIC_INCLUDES); do sed -f ../tools/cleanup-header $$i > $(LIBDIR)/caml/$$i; done
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
clean:
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f *.exe *.dll *.$(O) *.$(A)
|
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
|
2002-06-07 02:49:45 -07:00
|
|
|
(echo '#include "mlvalues.h"'; \
|
|
|
|
echo '#include "prims.h"'; \
|
|
|
|
sed -e 's/.*/extern value &();/' primitives; \
|
2004-04-01 05:09:21 -08:00
|
|
|
echo 'c_primitive caml_builtin_cprim[] = {'; \
|
2002-06-07 02:49:45 -07:00
|
|
|
sed -e 's/.*/ &,/' primitives; \
|
|
|
|
echo ' 0 };'; \
|
2004-04-01 05:09:21 -08:00
|
|
|
echo 'char * caml_names_of_builtin_cprim[] = {'; \
|
2002-06-07 02:49:45 -07:00
|
|
|
sed -e 's/.*/ "&",/' primitives; \
|
|
|
|
echo ' 0 };') > prims.c
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
opnames.h : instruct.h
|
2006-05-09 09:04:49 -07:00
|
|
|
sed -e '/\/\*/d' \
|
|
|
|
-e '/^#/d' \
|
|
|
|
-e 's/enum /char * names_of_/' \
|
|
|
|
-e 's/{$$/[] = {/' \
|
|
|
|
-e 's/\([[:upper:]][[:upper:]_0-9]*\)/"\1"/g' instruct.h > opnames.h
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2007-02-07 06:49:42 -08:00
|
|
|
version.h : ../VERSION
|
|
|
|
echo "#define OCAML_VERSION \"`head -1 ../VERSION`\"" >version.h
|
2005-02-02 07:51:24 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
main.$(DO): main.c
|
|
|
|
$(CC) $(DLLCCCOMPOPTS) -c main.c
|
|
|
|
mv main.$(O) main.$(DO)
|
|
|
|
|
2006-05-09 09:04:49 -07:00
|
|
|
.SUFFIXES: .$(DO) .$(SO) .$(DBGO)
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
.c.$(DO):
|
2001-08-28 07:47:48 -07:00
|
|
|
$(CC) $(CFLAGS) $(DLLCCCOMPOPTS) -c $<
|
2002-06-07 02:49:45 -07:00
|
|
|
mv $*.$(O) $*.$(DO)
|
|
|
|
.c.$(SO):
|
2001-08-28 07:47:48 -07:00
|
|
|
$(CC) $(CFLAGS) $(BYTECCCOMPOPTS) -c $<
|
2002-06-07 02:49:45 -07:00
|
|
|
mv $*.$(O) $*.$(SO)
|
2006-05-09 09:04:49 -07:00
|
|
|
.c.$(DBGO):
|
|
|
|
$(CC) $(CFLAGS) $(BYTECCDBGCOMPOPTS) -c $<
|
|
|
|
mv $*.$(O) $*.$(DBGO)
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2006-01-04 08:55:50 -08:00
|
|
|
.depend.nt: .depend
|
2006-05-09 09:04:49 -07:00
|
|
|
sed -e '/\.d\.o/q' -e 's/^\(.*\)\.o:/\1.$$(DO) \1.$$(SO) \1.$$(DBGO):/' .depend > .depend.nt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include .depend.nt
|