#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 include /usr/share/ocaml/ocamlvars.mk DESTDIR = $(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR) # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif %: dh $@ --with ocaml override_dh_auto_configure: CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info override_dh_auto_build: $(MAKE) depend $(MAKE) OCAMLPP= unixodbc -mkdir html ocamldoc -html -d html ocamlodbc.mli override_dh_auto_clean: [ ! -f master.Makefile ] || $(MAKE) distclean -rm .depend -rm -rf unixodbc html override_dh_auto_install: mkdir -p $(DESTDIR) $(MAKE) findlib_install prefix=$(CURDIR)/debian/tmp/usr OCAMLFIND_DESTDIR=$(DESTDIR) OCAMLFIND_LDCONF=ignore mv $(DESTDIR)/ocamlodbc_unixodbc $(DESTDIR)/ocamlodbc sed -e 's/ocamlodbc_unixodbc/ocamlodbc/g' $(DESTDIR)/ocamlodbc/META > $(DESTDIR)/ocamlodbc/META