1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
# 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
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
include ../config/Makefile
|
1995-07-02 09:42:16 -07:00
|
|
|
|
1995-07-18 01:41:12 -07:00
|
|
|
CC=$(NATIVECC)
|
2003-12-29 14:15:02 -08:00
|
|
|
FLAGS=-I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE \
|
2007-11-15 05:21:15 -08:00
|
|
|
-DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(IFLEXDIR)
|
1995-10-10 05:44:52 -07:00
|
|
|
CFLAGS=$(FLAGS) -O $(NATIVECCCOMPOPTS)
|
|
|
|
DFLAGS=$(FLAGS) -g -DDEBUG $(NATIVECCCOMPOPTS)
|
2002-03-11 02:12:43 -08:00
|
|
|
PFLAGS=$(FLAGS) -pg -O -DPROFILING $(NATIVECCPROFOPTS)
|
1995-07-18 01:41:12 -07:00
|
|
|
|
2007-02-23 01:29:45 -08:00
|
|
|
COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \
|
1995-07-18 01:41:12 -07:00
|
|
|
misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \
|
|
|
|
floats.o str.o array.o io.o extern.o intern.o hash.o sys.o parsing.o \
|
1997-05-13 07:45:38 -07:00
|
|
|
gc_ctrl.o terminfo.o md5.o obj.o lexing.o printexc.o callback.o weak.o \
|
2012-05-17 09:04:13 -07:00
|
|
|
compact.o finalise.o custom.o unix.o backtrace.o natdynlink.o debugger.o \
|
|
|
|
meta.o dynlink.o
|
1996-02-25 09:53:56 -08:00
|
|
|
|
1995-07-10 02:48:27 -07:00
|
|
|
ASMOBJS=$(ARCH).o
|
1995-07-12 07:27:10 -07:00
|
|
|
|
1995-07-18 01:41:12 -07:00
|
|
|
OBJS=$(COBJS) $(ASMOBJS)
|
|
|
|
DOBJS=$(COBJS:.o=.d.o) $(ASMOBJS)
|
1998-08-06 06:27:38 -07:00
|
|
|
POBJS=$(COBJS:.o=.p.o) $(ASMOBJS:.o=.p.o)
|
1995-07-10 02:48:27 -07:00
|
|
|
|
2011-03-17 09:18:05 -07:00
|
|
|
all: libasmrun.a all-$(RUNTIMED) all-$(PROFILING)
|
1995-07-10 02:48:27 -07:00
|
|
|
|
|
|
|
libasmrun.a: $(OBJS)
|
|
|
|
rm -f libasmrun.a
|
|
|
|
ar rc libasmrun.a $(OBJS)
|
|
|
|
$(RANLIB) libasmrun.a
|
|
|
|
|
2011-03-17 09:18:05 -07:00
|
|
|
all-noruntimed:
|
|
|
|
.PHONY: all-noruntimed
|
|
|
|
|
|
|
|
all-runtimed: libasmrund.a
|
|
|
|
.PHONY: all-runtimed
|
|
|
|
|
1995-07-10 02:48:27 -07:00
|
|
|
libasmrund.a: $(DOBJS)
|
|
|
|
rm -f libasmrund.a
|
|
|
|
ar rc libasmrund.a $(DOBJS)
|
|
|
|
$(RANLIB) libasmrund.a
|
|
|
|
|
1998-11-06 07:39:18 -08:00
|
|
|
all-noprof:
|
|
|
|
|
|
|
|
all-prof: libasmrunp.a
|
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
libasmrunp.a: $(POBJS)
|
|
|
|
rm -f libasmrunp.a
|
|
|
|
ar rc libasmrunp.a $(POBJS)
|
|
|
|
$(RANLIB) libasmrunp.a
|
|
|
|
|
2011-03-17 09:18:05 -07:00
|
|
|
install: install-default install-$(RUNTIMED) install-$(PROFILING)
|
1998-11-06 07:39:18 -08:00
|
|
|
|
|
|
|
install-default:
|
|
|
|
cp libasmrun.a $(LIBDIR)/libasmrun.a
|
|
|
|
cd $(LIBDIR); $(RANLIB) libasmrun.a
|
|
|
|
|
2011-03-17 09:18:05 -07:00
|
|
|
install-noruntimed:
|
|
|
|
.PHONY: install-noruntimed
|
|
|
|
|
|
|
|
install-runtimed:
|
|
|
|
cp libasmrund.a $(LIBDIR)/libasmrund.a
|
|
|
|
cd $(LIBDIR); $(RANLIB) libasmrund.a
|
|
|
|
.PHONY: install-runtimed
|
|
|
|
|
1998-11-06 07:39:18 -08:00
|
|
|
install-noprof:
|
1999-01-27 02:52:54 -08:00
|
|
|
rm -f $(LIBDIR)/libasmrunp.a; ln -s libasmrun.a $(LIBDIR)/libasmrunp.a
|
1998-11-06 07:39:18 -08:00
|
|
|
|
|
|
|
install-prof:
|
|
|
|
cp libasmrunp.a $(LIBDIR)/libasmrunp.a
|
|
|
|
cd $(LIBDIR); $(RANLIB) libasmrunp.a
|
1995-07-21 02:03:58 -07:00
|
|
|
|
1996-07-03 11:39:36 -07:00
|
|
|
power.o: power-$(SYSTEM).o
|
|
|
|
cp power-$(SYSTEM).o power.o
|
1996-07-03 09:14:11 -07:00
|
|
|
|
1998-08-17 03:01:56 -07:00
|
|
|
power.p.o: power-$(SYSTEM).o
|
|
|
|
cp power-$(SYSTEM).o power.p.o
|
1998-08-17 02:34:50 -07:00
|
|
|
|
1996-07-24 05:58:12 -07:00
|
|
|
main.c: ../byterun/main.c
|
|
|
|
ln -s ../byterun/main.c main.c
|
1995-07-18 02:45:16 -07:00
|
|
|
misc.c: ../byterun/misc.c
|
|
|
|
ln -s ../byterun/misc.c misc.c
|
|
|
|
freelist.c: ../byterun/freelist.c
|
|
|
|
ln -s ../byterun/freelist.c freelist.c
|
|
|
|
major_gc.c: ../byterun/major_gc.c
|
|
|
|
ln -s ../byterun/major_gc.c major_gc.c
|
|
|
|
minor_gc.c: ../byterun/minor_gc.c
|
|
|
|
ln -s ../byterun/minor_gc.c minor_gc.c
|
|
|
|
memory.c: ../byterun/memory.c
|
|
|
|
ln -s ../byterun/memory.c memory.c
|
|
|
|
alloc.c: ../byterun/alloc.c
|
|
|
|
ln -s ../byterun/alloc.c alloc.c
|
1998-04-06 02:09:22 -07:00
|
|
|
array.c: ../byterun/array.c
|
|
|
|
ln -s ../byterun/array.c array.c
|
1995-07-18 02:45:16 -07:00
|
|
|
compare.c: ../byterun/compare.c
|
|
|
|
ln -s ../byterun/compare.c compare.c
|
|
|
|
ints.c: ../byterun/ints.c
|
|
|
|
ln -s ../byterun/ints.c ints.c
|
|
|
|
floats.c: ../byterun/floats.c
|
|
|
|
ln -s ../byterun/floats.c floats.c
|
|
|
|
str.c: ../byterun/str.c
|
|
|
|
ln -s ../byterun/str.c str.c
|
|
|
|
io.c: ../byterun/io.c
|
|
|
|
ln -s ../byterun/io.c io.c
|
|
|
|
extern.c: ../byterun/extern.c
|
|
|
|
ln -s ../byterun/extern.c extern.c
|
|
|
|
intern.c: ../byterun/intern.c
|
|
|
|
ln -s ../byterun/intern.c intern.c
|
|
|
|
hash.c: ../byterun/hash.c
|
|
|
|
ln -s ../byterun/hash.c hash.c
|
|
|
|
sys.c: ../byterun/sys.c
|
|
|
|
ln -s ../byterun/sys.c sys.c
|
|
|
|
parsing.c: ../byterun/parsing.c
|
|
|
|
ln -s ../byterun/parsing.c parsing.c
|
|
|
|
gc_ctrl.c: ../byterun/gc_ctrl.c
|
|
|
|
ln -s ../byterun/gc_ctrl.c gc_ctrl.c
|
|
|
|
terminfo.c: ../byterun/terminfo.c
|
|
|
|
ln -s ../byterun/terminfo.c terminfo.c
|
1995-10-10 05:44:52 -07:00
|
|
|
md5.c: ../byterun/md5.c
|
|
|
|
ln -s ../byterun/md5.c md5.c
|
1995-07-18 02:45:16 -07:00
|
|
|
obj.c: ../byterun/obj.c
|
|
|
|
ln -s ../byterun/obj.c obj.c
|
1996-02-25 09:53:56 -08:00
|
|
|
lexing.c: ../byterun/lexing.c
|
|
|
|
ln -s ../byterun/lexing.c lexing.c
|
1996-11-07 05:12:16 -08:00
|
|
|
printexc.c: ../byterun/printexc.c
|
|
|
|
ln -s ../byterun/printexc.c printexc.c
|
1996-11-08 06:44:00 -08:00
|
|
|
callback.c: ../byterun/callback.c
|
|
|
|
ln -s ../byterun/callback.c callback.c
|
1997-02-24 11:55:55 -08:00
|
|
|
weak.c: ../byterun/weak.c
|
|
|
|
ln -s ../byterun/weak.c weak.c
|
1997-05-13 07:45:38 -07:00
|
|
|
compact.c: ../byterun/compact.c
|
|
|
|
ln -s ../byterun/compact.c compact.c
|
2000-01-07 08:51:58 -08:00
|
|
|
finalise.c: ../byterun/finalise.c
|
|
|
|
ln -s ../byterun/finalise.c finalise.c
|
2000-02-10 06:04:59 -08:00
|
|
|
custom.c: ../byterun/custom.c
|
|
|
|
ln -s ../byterun/custom.c custom.c
|
1997-11-17 02:39:01 -08:00
|
|
|
meta.c: ../byterun/meta.c
|
|
|
|
ln -s ../byterun/meta.c meta.c
|
2001-08-11 10:36:38 -07:00
|
|
|
globroots.c: ../byterun/globroots.c
|
|
|
|
ln -s ../byterun/globroots.c globroots.c
|
2001-08-30 02:01:33 -07:00
|
|
|
unix.c: ../byterun/unix.c
|
|
|
|
ln -s ../byterun/unix.c unix.c
|
|
|
|
dynlink.c: ../byterun/dynlink.c
|
|
|
|
ln -s ../byterun/dynlink.c dynlink.c
|
2007-02-23 01:29:45 -08:00
|
|
|
signals.c: ../byterun/signals.c
|
|
|
|
ln -s ../byterun/signals.c signals.c
|
2010-04-20 08:47:15 -07:00
|
|
|
debugger.c: ../byterun/debugger.c
|
|
|
|
ln -s ../byterun/debugger.c debugger.c
|
1995-07-18 02:45:16 -07:00
|
|
|
|
1998-04-06 02:09:22 -07:00
|
|
|
LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \
|
1996-04-30 07:53:58 -07:00
|
|
|
compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \
|
1997-02-24 11:55:55 -08:00
|
|
|
parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \
|
2001-08-30 02:01:33 -07:00
|
|
|
weak.c compact.c finalise.c meta.c custom.c main.c globroots.c unix.c \
|
2010-04-20 08:47:15 -07:00
|
|
|
dynlink.c signals.c debugger.c
|
1996-04-30 07:53:58 -07:00
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f $(LINKEDFILES)
|
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
.SUFFIXES: .S .d.o .p.o
|
1995-07-02 09:42:16 -07:00
|
|
|
|
1995-10-31 01:27:04 -08:00
|
|
|
.S.o:
|
2012-10-23 23:20:45 -07:00
|
|
|
$(ASPP) -DSYS_$(SYSTEM) -DMODEL_$(MODEL) -o $*.o $*.S || \
|
2013-03-09 14:38:52 -08:00
|
|
|
{ echo "If your assembler produced syntax errors, it is probably";\
|
|
|
|
echo "unhappy with the preprocessor. Check your assembler, or";\
|
|
|
|
echo "try producing $*.o by hand.";\
|
|
|
|
exit 2; }
|
1995-10-31 01:27:04 -08:00
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
.S.p.o:
|
2007-10-30 05:37:16 -07:00
|
|
|
$(ASPP) -DSYS_$(SYSTEM) $(ASPPPROFFLAGS) -o $*.p.o $*.S
|
1998-08-06 06:27:38 -07:00
|
|
|
|
1995-07-10 02:48:27 -07:00
|
|
|
.c.d.o:
|
2011-01-06 06:23:20 -08:00
|
|
|
ln -s -f $*.c $*.d.c
|
|
|
|
$(CC) -c $(DFLAGS) $*.d.c
|
2011-04-26 05:16:50 -07:00
|
|
|
rm -f $*.d.c
|
1995-07-10 02:48:27 -07:00
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
.c.p.o:
|
2011-01-06 06:23:20 -08:00
|
|
|
ln -s -f $*.c $*.p.c
|
|
|
|
$(CC) -c $(PFLAGS) $*.p.c
|
2011-04-26 05:16:50 -07:00
|
|
|
rm -f $*.p.c
|
1998-08-06 06:27:38 -07:00
|
|
|
|
1998-11-18 10:10:53 -08:00
|
|
|
.s.o:
|
2007-10-30 05:37:16 -07:00
|
|
|
$(ASPP) -DSYS_$(SYSTEM) -o $*.o $*.s
|
1998-11-18 10:10:53 -08:00
|
|
|
|
|
|
|
.s.p.o:
|
2007-10-30 05:37:16 -07:00
|
|
|
$(ASPP) -DSYS_$(SYSTEM) $(ASPPPROFFLAGS) -o $*.p.o $*.s
|
1998-11-18 10:10:53 -08:00
|
|
|
|
1995-07-02 09:42:16 -07:00
|
|
|
clean::
|
1998-12-09 02:17:28 -08:00
|
|
|
rm -f *.o *.a *~
|
1995-07-07 05:07:32 -07:00
|
|
|
|
1999-11-09 06:00:59 -08:00
|
|
|
depend: $(COBJS:.o=.c) ${LINKEDFILES}
|
2006-09-20 04:14:37 -07:00
|
|
|
-gcc -MM $(FLAGS) *.c > .depend
|
1995-10-10 05:44:52 -07:00
|
|
|
gcc -MM $(FLAGS) -DDEBUG *.c | sed -e 's/\.o/.d.o/' >> .depend
|
1998-11-06 07:39:18 -08:00
|
|
|
gcc -MM $(FLAGS) -DDEBUG *.c | sed -e 's/\.o/.p.o/' >> .depend
|
1995-07-10 02:48:27 -07:00
|
|
|
|
|
|
|
include .depend
|