2016-02-18 07:11:59 -08:00
|
|
|
#**************************************************************************
|
|
|
|
#* *
|
|
|
|
#* OCaml *
|
|
|
|
#* *
|
|
|
|
#* Xavier Leroy, projet Cristal, 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 Lesser General Public License version 2.1, with the *
|
|
|
|
#* special exception on linking described in the file LICENSE. *
|
|
|
|
#* *
|
|
|
|
#**************************************************************************
|
1999-11-17 10:59:06 -08:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
include Makefile.common
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2015-07-17 07:31:05 -07:00
|
|
|
CFLAGS=-DCAML_NAME_SPACE $(BYTECCCOMPOPTS) $(IFLEXDIR)
|
2010-08-02 07:37:22 -07:00
|
|
|
DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS) $(IFLEXDIR)
|
2015-11-20 08:54:26 -08:00
|
|
|
IFLAGS=$(CFLAGS) -DCAML_INSTR
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2013-07-01 05:12:33 -07:00
|
|
|
OBJS=$(COMMONOBJS) $(UNIX_OR_WIN32).o main.o
|
1995-05-04 03:15:53 -07:00
|
|
|
DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o
|
2015-11-20 08:54:26 -08:00
|
|
|
IOBJS=$(OBJS:.o=.i.o)
|
2008-08-06 01:56:32 -07:00
|
|
|
PICOBJS=$(OBJS:.o=.pic.o)
|
|
|
|
|
2015-05-02 08:30:41 -07:00
|
|
|
all:: all-$(SHARED)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2000-08-10 02:58:08 -07:00
|
|
|
ocamlrun$(EXE): libcamlrun.a prims.o
|
2007-11-15 05:21:15 -08:00
|
|
|
$(MKEXE) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \
|
2008-09-09 22:51:11 -07:00
|
|
|
prims.o libcamlrun.a $(BYTECCLIBS)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2000-08-10 02:58:08 -07:00
|
|
|
ocamlrund$(EXE): libcamlrund.a prims.o
|
2012-07-26 12:21:54 -07:00
|
|
|
$(MKEXE) $(MKEXEDEBUGFLAG) $(BYTECCLINKOPTS) -o ocamlrund$(EXE) \
|
2008-09-09 22:51:11 -07:00
|
|
|
prims.o libcamlrund.a $(BYTECCLIBS)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2015-11-20 08:54:26 -08:00
|
|
|
ocamlruni$(EXE): prims.o libcamlruni.a
|
|
|
|
$(MKEXE) $(BYTECCLINKOPTS) -o $@ $^ $(BYTECCLIBS)
|
|
|
|
|
2007-11-08 00:54:30 -08:00
|
|
|
libcamlrun.a: $(OBJS)
|
2015-04-26 13:50:20 -07:00
|
|
|
$(ARCMD) rc libcamlrun.a $(OBJS)
|
2013-03-28 09:10:24 -07:00
|
|
|
$(RANLIB) libcamlrun.a
|
1997-01-05 06:06:13 -08:00
|
|
|
|
1996-07-23 01:12:11 -07:00
|
|
|
libcamlrund.a: $(DOBJS)
|
2015-04-26 13:50:20 -07:00
|
|
|
$(ARCMD) rc libcamlrund.a $(DOBJS)
|
2013-03-28 09:10:24 -07:00
|
|
|
$(RANLIB) libcamlrund.a
|
1996-07-23 01:12:11 -07:00
|
|
|
|
2015-11-20 08:54:26 -08:00
|
|
|
libcamlruni.a: $(IOBJS)
|
|
|
|
$(ARCMD) rc $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
2015-05-02 08:30:41 -07:00
|
|
|
all-noshared:
|
|
|
|
.PHONY: all-noshared
|
|
|
|
|
|
|
|
all-shared: libcamlrun_pic.a libcamlrun_shared.so
|
|
|
|
.PHONY: all-shared
|
|
|
|
|
|
|
|
libcamlrun_pic.a: $(PICOBJS)
|
2015-10-09 13:41:57 -07:00
|
|
|
$(ARCMD) rc libcamlrun_pic.a $(PICOBJS)
|
2015-05-02 08:30:41 -07:00
|
|
|
$(RANLIB) libcamlrun_pic.a
|
|
|
|
|
2008-08-06 01:56:32 -07:00
|
|
|
libcamlrun_shared.so: $(PICOBJS)
|
2008-12-03 10:09:09 -08:00
|
|
|
$(MKDLL) -o libcamlrun_shared.so $(PICOBJS) $(BYTECCLIBS)
|
2008-08-06 01:56:32 -07:00
|
|
|
|
2015-05-02 08:30:41 -07:00
|
|
|
install:: install-$(SHARED)
|
|
|
|
|
|
|
|
install-noshared:
|
|
|
|
.PHONY: install-noshared
|
|
|
|
|
|
|
|
install-shared:
|
2015-11-27 13:30:41 -08:00
|
|
|
cp libcamlrun_shared.so "$(INSTALL_LIBDIR)/libcamlrun_shared.so"
|
|
|
|
cp libcamlrun_pic.a "$(INSTALL_LIBDIR)/libcamlrun_pic.a"
|
|
|
|
cd "$(INSTALL_LIBDIR)"; $(RANLIB) libcamlrun_pic.a
|
2015-05-02 08:30:41 -07:00
|
|
|
.PHONY: install-shared
|
2009-07-20 04:51:50 -07:00
|
|
|
|
|
|
|
clean::
|
2015-05-02 08:30:41 -07:00
|
|
|
rm -f libcamlrun_shared.so libcamlrun_pic.a
|
2009-07-20 04:51:50 -07:00
|
|
|
|
2014-12-27 00:44:48 -08:00
|
|
|
%.d.o: %.c
|
|
|
|
$(CC) -c $(DFLAGS) $< -o $@
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2015-11-20 08:54:26 -08:00
|
|
|
%.i.o: %.c
|
|
|
|
$(CC) -c $(IFLAGS) -o $@ $<
|
|
|
|
|
2014-12-27 00:44:48 -08:00
|
|
|
%.pic.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS) $(SHAREDCCCOMPOPTS) $< -o $@
|
2008-08-06 01:56:32 -07:00
|
|
|
|
2014-12-27 06:41:49 -08:00
|
|
|
depend : prims.c caml/opnames.h caml/jumptbl.h caml/version.h
|
2015-01-20 09:02:26 -08:00
|
|
|
-$(CC) -MM $(BYTECCCOMPOPTS) *.c > .depend
|
2015-11-20 08:54:26 -08:00
|
|
|
-$(CC) -MM $(BYTECCCOMPOPTS) -DDEBUG *.c | sed -e 's/\.o/.d.o/' \
|
|
|
|
>> .depend
|
|
|
|
-$(CC) -MM $(BYTECCCOMPOPTS) -DCAML_INSTR *.c | sed -e 's/\.o/.i.o/' \
|
|
|
|
>> .depend
|
2015-01-20 09:02:26 -08:00
|
|
|
-$(CC) -MM $(BYTECCCOMPOPTS) *.c | sed -e 's/\.o/.pic.o/' >> .depend
|
2007-11-22 11:01:50 -08:00
|
|
|
.PHONY: depend
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
include .depend
|