OBJECTS_OPT = gtkMathView.cmx gtk_mathview.cmx gMathView.cmx
INST = META gMathView.mli gMathView.cmi gtkMathView.cmi gtk_mathview.cmi
DIST_FILES = \
- AUTHORS COPYING ChangeLog LICENSE Makefile.in NEWS README \
- configure.in gMathView.ml gMathView.mli gtkMathView.ml \
+ Makefile.in configure.in gMathView.ml gMathView.mli gtkMathView.ml \
gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \
configure lablgtkmathview.spec lablgtkmathview.spec.in
-DOC_FILES = AUTHORS COPYING ChangeLog NEWS README
+DIST_DIR = $(PACKAGE)-$(VERSION)
+DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE
REQUIRES = gdome2 lablgtk
PREDICATES =
-MLFLAGS = -labels
+SHARED_LIBS = \
+ `gdome-config --libs` \
+ $(shell gtkmathview-config --libs | sed 's/-rdynamic//g') \
+ -lmlgdome
-OCAMLC = ocamlfind ocamlc $(MLFLAGS)
-OCAMLOPT = ocamlfind ocamlopt $(MLFLAGS)
+OCAMLC = ocamlfind ocamlc
+OCAMLOPT = ocamlfind ocamlopt
OCAMLDEP = ocamldep
+OCAMLMKLIB = ocamlmklib
+OCAML_STUB_DIR = @OCAML_STUB_DIR@
-ARCHIVE = $(PACKAGE).cma
-ARCHIVE_A = $(PACKAGE).a
-ARCHIVE_SO = dll$(PACKAGE).so
-ARCHIVE_OPT = $(PACKAGE).cmxa
+ARCHIVE = $(PACKAGE)
+DLL = dll$(ARCHIVE).so
TESTDIR = ./test
TMPDIR = .test
TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
-all: $(ARCHIVE) $(ARCHIVE_SO) $(TESTDIR)/test
-
-opt: $(OBJECTS_C) $(ARCHIVE_OPT) $(ARCHIVE_A) $(ARCHIVE_SO) #$(TESTDIR)/test.opt
+all: $(ARCHIVE).cma $(TESTDIR)/test
+opt: $(ARCHIVE).cmxa $(TESTDIR)/test.opt
+world: all opt
dist:
- rm -rf $(PACKAGE)-$(VERSION)
- mkdir $(PACKAGE)-$(VERSION)
- cp -a $(DIST_FILES) $(DOC_FILES) $(PACKAGE)-$(VERSION)
- tar cvfz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
- rm -rf $(PACKAGE)-$(VERSION)
+ rm -rf $(DIST_DIR)/
+ mkdir $(DIST_DIR)/
+ cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/
+ -find $(DIST_DIR) -name CVS -type d -exec rm -rf {} \;
+ -find $(DIST_DIR) -name .cvsignore -type f -exec rm {} \;
+ tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/
+ rm -rf $(DIST_DIR)/
ml_gtk_mathview.o: ml_gtk_mathview.c
gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk` `glib-config --cflags` `gtk-config --cflags` `gtkmathview-config --cflags` `gdome-config --cflags` `ocamlfind query -i-format gdome2` $<
.SUFFIXES: .cmo .cmi .cmx .ml .mli
.ml.cmo:
- $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
- -c $<
+ $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
.mli.cmi:
- $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
- -c $<
+ $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
.ml.cmx:
- $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
- -c $<
+ $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
depend: *.ml *.mli
$(OCAMLDEP) *.ml *.mli >.depend
include .depend
-$(ARCHIVE): $(OBJECTS) $(ARCHIVE_SO)
- $(OCAMLC) -a -package "$(REQUIRES)" \
- -predicates "$(PREDICATES)" -o $@ $^ \
- -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" -dllib -l$(PACKAGE)
-$(ARCHIVE_OPT) $(ARCHIVE_A): $(OBJECTS_OPT)
- $(OCAMLOPT) -a -package "$(REQUIRES)" \
- -predicates "$(PREDICATES)" -o $@ $^ \
- -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" \
- -cclib "@OCAML_LIB_DIR@/stublibs/$(ARCHIVE_SO)"
-
-$(ARCHIVE_SO): $(OBJECTS_C)
- gcc -shared -o $@ $< `gtkmathview-config --libs` -lmlgdome -L `ocamlfind query gdome2` -Xlinker -rpath -Xlinker `ocamlfind query gdome2`
-
-
+$(ARCHIVE).cma $(DLL): $(OBJECTS) $(OBJECTS_C)
+ $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(SHARED_LIBS)
+$(ARCHIVE).cmxa $(ARCHIVE).a: $(OBJECTS_OPT)
+ $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(OBJECTS_C) $(SHARED_LIBS)
-$(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE) $(TESTDIR)/test.ml
+$(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
mkdir -p $(TMPPKGDIR)
- cp $(OBJECTS_C) $(ARCHIVE_SO) $(ARCHIVE) $(INST) $(TMPPKGDIR)
+ cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
rm -r $(TMPDIR)
-$(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE_A) $(ARCHIVE_OPT) $(TESTDIR)/test.ml
+$(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
mkdir -p $(TMPPKGDIR)
- cp $(OBJECTS_C) $(ARCHIVE_A) $(ARCHIVE_OPT) $(INST) $(TMPPKGDIR)
+ cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
rm -r $(TMPDIR)
install:
- test ! -f $(ARCHIVE_OPT) || extra="$(ARCHIVE_A) $(ARCHIVE_OPT)" ; \
+ test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; \
if [ "$(PREFIX)" = "" ]; then \
- ocamlfind install $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(ARCHIVE_SO) $(INST) $$extra; \
+ ocamlfind install $(PACKAGE) $(OBJECTS_C) $(ARCHIVE).cma $(DLL) $(INST) $$extra; \
else \
- ocamlfind install -destdir $(PREFIX) $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(ARCHIVE_SO) $(INST) $$extra; \
+ ocamlfind install -destdir $(PREFIX) $(PACKAGE) $(OBJECTS_C) $(ARCHIVE).cma $(DLL) $(INST) $$extra; \
fi
uninstall:
ocamlfind remove $(PACKAGE)
clean:
- rm -f *.o *.cm? $(ARCHIVE) $(ARCHIVE_A) $(ARCHIVE_SO) $(ARCHIVE_OPT)
+ rm -f *.[ao] *.cm[iaxo] *.cmxa *.so
cd $(TESTDIR) ; make clean
rm -rf $(TMPDIR)
Section: devel
Priority: optional
Maintainer: Stefano Zacchiroli <zack@debian.org>
-Build-Depends: debhelper (>> 4.0.0), ocaml-3.06, ocaml-findlib (>= 0.7.1), liblablgtk-ocaml-dev (>= 1.2.3), libgdome2-ocaml-dev (>= 0.0.3-4), libgtkmathview-dev (>= 0.3.0-2), libxml2-dev, libgdome2-dev, libgdome2-cpp-smart-dev, t1lib-dev (>= 1.3)
-Standards-Version: 3.5.6
+Build-Depends: debhelper (>> 4.0.0), ocaml-3.06-1, ocaml-findlib, liblablgtk-ocaml-dev, libgdome2-ocaml-dev-0.1.4, libgtkmathview-dev (>= 0.3.1), libxml2-dev, libgdome2-dev, libgdome2-cpp-smart-dev, t1lib-dev (>= 1.3)
+Standards-Version: 3.5.8
Package: liblablgtkmathview-ocaml
Architecture: any
Section: libs
-Depends: ocaml-base-3.06, liblablgtk-ocaml, libgdome2-ocaml, ${shlibs:Depends}
+Depends: ocaml-base-3.06-1, liblablgtk-ocaml, libgdome2-ocaml, ${shlibs:Depends}
Description: OCaml binding for libgtkmathview
This is the Ocaml binding for the GtkMathView widget, that is
currently available in the libgtkmathview0 package.
Package: liblablgtkmathview-ocaml-dev
Architecture: any
Section: devel
-Depends: ocaml-3.06, liblablgtk-ocaml-dev, libgtkmathview0 (>= 0.3.0), liblablgtkmathview-ocaml (= ${Source-Version}), ocaml-findlib
+Depends: ocaml-3.06-1, liblablgtk-ocaml-dev, libgtkmathview0 (>= 0.3.1), liblablgtkmathview-ocaml (= ${Source-Version}), ocaml-findlib
Description: OCaml binding for libgtkmathview
These are the Ocaml bindings for the GtkMathView widget, that is
currently available in the libgtkmathview0 package.