1996-02-13 08:26:14 -08:00
|
|
|
include ../config/Makefile
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-18 01:41:30 -07:00
|
|
|
CC=$(BYTECC)
|
1996-10-29 01:41:07 -08:00
|
|
|
CFLAGS=-O $(BYTECCCOMPOPTS)
|
1995-07-18 01:41:30 -07:00
|
|
|
DFLAGS=-g -DDEBUG $(BYTECCCOMPOPTS)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-07-24 05:58:12 -07:00
|
|
|
OBJS=interp.o misc.o stacks.o fix_code.o startup.o main.o \
|
1995-05-04 03:15:53 -07:00
|
|
|
freelist.o major_gc.o minor_gc.o memory.o alloc.o roots.o \
|
1996-11-07 05:12:33 -08:00
|
|
|
fail.o signals.o printexc.o \
|
1995-05-04 03:15:53 -07:00
|
|
|
compare.o ints.o floats.o str.o array.o io.o extern.o intern.o \
|
1996-02-25 06:45:47 -08:00
|
|
|
hash.o sys.o meta.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o \
|
1997-05-13 07:45:38 -07:00
|
|
|
lexing.o callback.o debugger.o weak.o compact.o
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o
|
|
|
|
|
1998-04-06 02:15:55 -07:00
|
|
|
PRIMS=alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c \
|
1996-02-25 06:45:47 -08:00
|
|
|
intern.c interp.c ints.c io.c lexing.c md5.c meta.c obj.c parsing.c \
|
1997-02-24 11:24:39 -08:00
|
|
|
signals.c str.c sys.c terminfo.c callback.c weak.c
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
all: ocamlrun
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1997-01-05 06:06:13 -08:00
|
|
|
ocamlrun: libcamlrun.a prims.o
|
|
|
|
$(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) -o ocamlrun prims.o libcamlrun.a $(CCLIBS)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1997-01-05 06:06:13 -08:00
|
|
|
ocamlrund: libcamlrund.a prims.o
|
|
|
|
$(BYTECC) -g $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) -o ocamlrund prims.o libcamlrund.a $(CCLIBS)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
install:
|
1996-04-30 07:53:58 -07:00
|
|
|
cp ocamlrun $(BINDIR)/ocamlrun
|
1997-01-05 06:06:13 -08:00
|
|
|
cp libcamlrun.a $(LIBDIR)/libcamlrun.a
|
1995-05-09 02:34:59 -07:00
|
|
|
cd $(LIBDIR); $(RANLIB) libcamlrun.a
|
1995-09-11 07:58:17 -07:00
|
|
|
if test -d $(LIBDIR)/caml; then : ; else mkdir $(LIBDIR)/caml; fi
|
1996-11-08 06:46:01 -08:00
|
|
|
cp mlvalues.h alloc.h misc.h callback.h $(LIBDIR)/caml
|
1995-05-04 03:15:53 -07:00
|
|
|
sed -e '/#include ".*\/m.h/r ../config/m.h' \
|
|
|
|
-e '/#include ".*\/s.h/r ../config/s.h' \
|
|
|
|
-e '/#include "/d' config.h > $(LIBDIR)/caml/config.h
|
|
|
|
sed -e '/#include ".*gc\.h"/d' \
|
|
|
|
-e '/#define Alloc_small/,/^}/d' \
|
|
|
|
-e '/Modify/,/^}/d' memory.h > $(LIBDIR)/caml/memory.h
|
|
|
|
|
1997-01-05 06:06:13 -08:00
|
|
|
libcamlrun.a: $(OBJS)
|
|
|
|
ar rc libcamlrun.a $(OBJS)
|
|
|
|
$(RANLIB) libcamlrun.a
|
|
|
|
|
1996-07-23 01:12:11 -07:00
|
|
|
libcamlrund.a: $(DOBJS)
|
|
|
|
ar rc libcamlrund.a $(DOBJS)
|
1997-01-05 06:06:13 -08:00
|
|
|
$(RANLIB) libcamlrund.a
|
1996-07-23 01:12:11 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
clean:
|
1996-11-02 10:00:46 -08:00
|
|
|
rm -f ocamlrun ocamlrund *.o lib*.a
|
1995-05-04 03:15:53 -07:00
|
|
|
rm -f primitives prims.c opnames.h jumptbl.h
|
|
|
|
|
|
|
|
primitives : $(PRIMS)
|
1997-02-24 11:24:39 -08:00
|
|
|
sed -n -e '/\/\* ML \*\//s/.* \([a-z0-9_][a-z0-9_]*\) *(.*/\1/p' \
|
1995-05-04 03:15:53 -07:00
|
|
|
$(PRIMS) > primitives
|
|
|
|
|
|
|
|
prims.c : primitives
|
|
|
|
(echo '#include "mlvalues.h"'; \
|
|
|
|
echo '#include "prims.h"'; \
|
|
|
|
sed -e 's/.*/extern value &();/' primitives; \
|
|
|
|
echo 'c_primitive cprim[] = {'; \
|
|
|
|
sed -e 's/.*/ &,/' primitives; \
|
|
|
|
echo ' 0 };'; \
|
|
|
|
echo 'char * names_of_cprim[] = {'; \
|
|
|
|
sed -e 's/.*/ "&",/' primitives; \
|
|
|
|
echo ' 0 };') > prims.c
|
|
|
|
|
|
|
|
opnames.h : instruct.h
|
|
|
|
sed -e '/\/\*/d' \
|
1996-11-29 10:36:42 -08:00
|
|
|
-e '/^#/d' \
|
1995-05-04 03:15:53 -07:00
|
|
|
-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
|
|
|
|
|
|
|
|
.SUFFIXES: .d.o
|
|
|
|
|
|
|
|
.c.d.o:
|
1995-07-18 01:41:30 -07:00
|
|
|
@ if test -f $*.o; then mv $*.o $*.f.o; else :; fi
|
|
|
|
$(CC) -c $(DFLAGS) $<
|
|
|
|
mv $*.o $*.d.o
|
|
|
|
@ if test -f $*.f.o; then mv $*.f.o $*.o; else :; fi
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
depend : prims.c opnames.h jumptbl.h
|
1995-07-21 02:03:58 -07:00
|
|
|
gcc -MM *.c > .depend
|
|
|
|
gcc -MM -DDEBUG *.c | sed -e 's/\.o/.d.o/' >> .depend
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
include .depend
|