aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--META.glibivy2
-rw-r--r--Makefile72
-rw-r--r--debian/control4
-rwxr-xr-xdebian/rules16
4 files changed, 58 insertions, 36 deletions
diff --git a/META.glibivy b/META.glibivy
index 50818cb..61eb52c 100644
--- a/META.glibivy
+++ b/META.glibivy
@@ -1,4 +1,4 @@
version="1.2"
-directory="+ivy"
+directory="+glibivy"
archive(byte)="glibivy-ocaml.cma"
archive(native)="glibivy-ocaml.cmxa"
diff --git a/Makefile b/Makefile
index 84d8bd4..4e4438d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,10 @@
-# $Id$
+# Makefile for building and installing the ivy ocaml bindings
-DESTDIR = /
+DESTDIR ?=
+
+#ifneq ($(DESTDIR),)
+#OCAMLFINDFLAGS += -destdir $(DESTDIR)
+#endif
DEBUG = n
@@ -27,7 +31,10 @@ ifeq ($(LBITS),64)
FPIC=-fPIC
endif
-OUTDIR = ivy
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ifeq ($(uname_S),Darwin)
+ LIBRARYS = -L/opt/local/lib
+endif
IVY = ivy.ml ivyLoop.ml
@@ -49,48 +56,54 @@ TKIVYCMO= $(TKIVY:.ml=.cmo)
TKIVYCMI= $(TKIVY:.ml=.cmi)
TKIVYCMX= $(TKIVY:.ml=.cmx)
-UNAME = $(shell uname -s)
-ifeq ("$(UNAME)","Darwin")
- LIBRARYS = -L/opt/local/lib
-endif
+IVYLIBS = ivy-ocaml.cma ivy-ocaml.cmxa
+GLIBIVYLIBS = glibivy-ocaml.cma glibivy-ocaml.cmxa
+TKLIBS = tkivy.cma tkivy.cmxa
+IVYSTATIC = libivy-ocaml.a ivy-ocaml.a
+GLIBIVYSTATIC = libglibivy-ocaml.a glibivy-ocaml.a
LIBS = ivy-ocaml.cma glibivy-ocaml.cma
XLIBS = ivy-ocaml.cmxa glibivy-ocaml.cmxa
-TKLIBS = tkivy.cma tkivy.cmxa
-STATIC = libivy-ocaml.a libglibivy-ocaml.a ivy-ocaml.a glibivy-ocaml.a
+
GLIBIVYCMI = glibIvy.cmi
-METAFILES = META.ivy META.glibivy
+
all : $(LIBS) $(XLIBS)
deb :
dpkg-buildpackage -rfakeroot
-ivy : ivy-ocaml.cma ivy-ocaml.cmxa
-glibivy : glibivy-ocaml.cma glibivy-ocaml.cma
+ivy : $(IVYLIBS)
+glibivy : $(GLIBIVYLIBS)
tkivy : $(TKLIBS)
-INST_FILES = $(IVYCMI) $(IVYMLI) $(GLIBIVYCMI) $(LIBS) $(XLIBS) $(STATIC)
-# tkIvy.cmi libtkivy.a dlltkivy.so tkivy.a
-STUBLIBS = dllivy-ocaml.so dllglibivy-ocaml.so
+IVY_ALL_LIBS = ivy-ocaml.cma ivy-ocaml.cmxa libivy-ocaml.a ivy-ocaml.a dllivy-ocaml.so
+GLIBIVY_ALL_LIBS = glibivy-ocaml.cma glibivy-ocaml.cmxa libglibivy-ocaml.a glibivy-ocaml.a dllglibivy-ocaml.so
+
+IVY_INST_FILES = $(IVYCMI) $(IVYMLI) $(IVYCMX) $(IVY_ALL_LIBS)
+GLIBIVY_INST_FILES = glibIvy.mli glibIvy.cmi glibIvy.cmx $(GLIBIVY_ALL_LIBS)
install : $(LIBS)
- mkdir -p $(DESTDIR)/`ocamlc -where`/$(OUTDIR)
- cp $(INST_FILES) $(DESTDIR)/`ocamlc -where`/$(OUTDIR)
- mkdir -p $(DESTDIR)/`ocamlc -where`/stublibs
- cp $(STUBLIBS) $(DESTDIR)/`ocamlc -where`/stublibs
- mkdir -p $(DESTDIR)/`ocamlc -where`/METAS
- cp $(METAFILES) $(DESTDIR)/`ocamlc -where`/METAS
- mkdir -p $(DESTDIR)/`ocamlc -where`
- $(foreach file,$(LIBS) $(XLIBS) $(STATIC) $(IVYCMI) $(IVYMLI) $(GLIBIVYCMI), \
+ mv META.ivy META
+ ocamlfind install $(OCAMLFINDFLAGS) ivy META $(IVY_INST_FILES)
+ mv META META.ivy
+ mv META.glibivy META
+ ocamlfind install $(OCAMLFINDFLAGS) glibivy META $(GLIBIVY_INST_FILES)
+ mv META META.glibivy
+# make some symlinks for backwards compatibility
+ $(foreach file,$(IVYLIBS) $(IVYSTATIC) $(IVYCMI) $(IVYMLI), \
cd $(DESTDIR)/`ocamlc -where`; ln -s ivy/$(file) $(file);)
+ $(foreach file,$(GLIBIVYLIBS) $(GLIBIVYSTATIC) $(GLIBIVYCMI), \
+ cd $(DESTDIR)/`ocamlc -where`; ln -s glibivy/$(file) $(file);)
-desinstall :
- cd `ocamlc -where`; rm -f $(INST_FILES); rm -f METAS/$(METAFILES)
+uninstall :
+ ocamlfind remove ivy
+ ocamlfind remove glibivy
+# cd `ocamlc -where`; rm -f $(SYMLINKS)
ivy-ocaml.cma : $(IVYCMO) civy.o civyloop.o
- $(OCAMLMKLIB) -o ivy-ocaml $^ $(LIBRARYS) -livy
+ $(OCAMLMKLIB) -o ivy-ocaml $^ $(LIBRARYS) -livy
ivy-ocaml.cmxa : $(IVYCMX) civy.o civyloop.o
$(OCAMLMKLIB) -o ivy-ocaml $^ $(LIBRARYS) -livy
@@ -131,7 +144,12 @@ tkivy-ocaml.cmxa : $(TKIVYCMX) civy.o ctkivy.o
clean:
\rm -fr *.cm* *.o *.a .depend *~ *.out *.opt .depend *.so *-stamp debian/ivy-ocaml debian/files debian/ivy-ocaml.debhelper.log debian/ivy-ocaml.substvars debian/*~
+.PHONY: all dev ivy glibivy tkivy install uninstall clean
+
.depend:
$(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend
-include .depend
+ifneq ($(MAKECMDGOALS),clean)
+-include .depend
+endif
+
diff --git a/debian/control b/debian/control
index 4bba10f..48267c3 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,8 @@
Source: ivy-ocaml
-Section: net
+Section: libs
Priority: optional
Maintainer: Gautier Hattenberger <gautier.hattenberger@enac.fr>
-Build-Depends: debhelper (>= 7.0.50~), dh-ocaml (>= 0.9.0), ocaml-nox, libglib2.0-dev, libpcre3-dev, ivy-c-dev (>=3.11)
+Build-Depends: debhelper (>= 7.0.50~), dh-ocaml (>= 0.9.0), ocaml-nox, ocaml-findlib, libglib2.0-dev, libpcre3-dev, ivy-c-dev (>=3.11)
Standards-Version: 3.9.2
Homepage: http://www2.tls.cena.fr/products/ivy/
Vcs-Svn: http://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk
diff --git a/debian/rules b/debian/rules
index 6827cc6..f09e0b2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,10 +1,11 @@
#!/usr/bin/make -f
# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+include /usr/share/ocaml/ocamlvars.mk
+
+DEB_DESTDIR = $(CURDIR)/debian/ivy-ocaml
+DEB_OCAML_DESTDIR = $(DEB_DESTDIR)$(OCAML_STDLIB_DIR)
+export OCAMLFIND_DESTDIR = $(DEB_OCAML_DESTDIR)
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
@@ -13,5 +14,8 @@
dh $@ --with ocaml
override_dh_auto_install :
- $(MAKE) install DESTDIR=$(CURDIR)/debian/ivy-ocaml
+ mkdir -p $(DEB_OCAML_DESTDIR)
+ mkdir -p $(DEB_OCAML_DESTDIR)/stublibs
+ $(MAKE) DESTDIR=$(DEB_DESTDIR) install
+.PHONY: override_dh_auto_install