| 1 |
#*********************************************************************** |
| 2 |
#* * |
| 3 |
#* CamlIDL * |
| 4 |
#* * |
| 5 |
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt * |
| 6 |
#* * |
| 7 |
#* Copyright 1999 Institut National de Recherche en Informatique et * |
| 8 |
#* en Automatique. All rights reserved. This file is distributed * |
| 9 |
#* under the terms of the GNU Library General Public License. * |
| 10 |
#* * |
| 11 |
#*********************************************************************** |
| 12 |
|
| 13 |
#* $Id: Makefile,v 1.4 2002-04-22 11:50:47 xleroy Exp $ |
| 14 |
|
| 15 |
include ../config/Makefile |
| 16 |
include $(OCAMLLIB)/Makefile.config |
| 17 |
|
| 18 |
BYTEOBJS=com.cmo |
| 19 |
BYTELIB=com.cma |
| 20 |
NATIVEOBJS=$(BYTEOBJS:.cmo=.cmx) |
| 21 |
NATIVELIB=$(BYTELIB:.cma=.cmxa) |
| 22 |
INTERFACES=$(BYTEOBJS:.cmo=.cmi) |
| 23 |
|
| 24 |
all:: allbyt |
| 25 |
install:: installbyt |
| 26 |
ifneq "${ARCH}" "none" |
| 27 |
ifneq "${NATIVE_COMPILER}" "false" |
| 28 |
all:: allopt |
| 29 |
install:: installopt |
| 30 |
endif |
| 31 |
endif |
| 32 |
|
| 33 |
allbyt: $(BYTELIB) |
| 34 |
allopt: $(NATIVELIB) |
| 35 |
|
| 36 |
$(BYTELIB): $(BYTEOBJS) |
| 37 |
$(OCAMLC) -a -o $(BYTELIB) -dllib -lcamlidl -cclib -lcamlidl $(BYTEOBJS) |
| 38 |
|
| 39 |
$(NATIVELIB): $(NATIVEOBJS) |
| 40 |
$(OCAMLOPT) -a -o $(NATIVELIB) -cclib -lcamlidl $(NATIVEOBJS) |
| 41 |
|
| 42 |
installbyt: |
| 43 |
cp -p $(INTERFACES) $(BYTELIB) $(DESTDIR)$(OCAMLLIB) |
| 44 |
|
| 45 |
installopt: |
| 46 |
cp -p $(NATIVELIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) $(DESTDIR)$(OCAMLLIB) |
| 47 |
|
| 48 |
.SUFFIXES: .mli .ml .cmi .cmo .cmx |
| 49 |
|
| 50 |
.mli.cmi: |
| 51 |
$(OCAMLC) -c $< |
| 52 |
.ml.cmo: |
| 53 |
$(OCAMLC) -c $< |
| 54 |
.ml.cmx: |
| 55 |
$(OCAMLOPT) -c $< |
| 56 |
|
| 57 |
# Clean up |
| 58 |
clean:: |
| 59 |
rm -f *.cm[ioax] *.cmxa *.[ao] *.lib *~ |
| 60 |
|
| 61 |
# Dependencies |
| 62 |
depend: |
| 63 |
$(OCAMLDEP) *.mli *.ml > .depend |
| 64 |
|
| 65 |
include .depend |