File: rules

package info (click to toggle)
postgresql-ocaml 1.7.0-3%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 308 kB
  • ctags: 537
  • sloc: ml: 1,129; ansic: 659; sh: 107; makefile: 98
file content (29 lines) | stat: -rwxr-xr-x 1,064 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/dpatch.mk
include /usr/share/cdbs/1/class/ocaml.mk

PKGNAME = libpostgresql-ocaml-dev

 # The examples patch needs to be patched since it contains hard coded ABI
 # numbers.
OCAML_IN_FILES += debian/patches/examples.dpatch
OCAML_OCAMLDOC_PACKAGES = $(OCAML_LIBDEV_PACKAGES)
DEB_SRCDIR = $(CURDIR)/lib
DEB_MAKE_BUILD_TARGET = byte-code-library
CFLAGS += -I$(shell pg_config --includedir) -fPIC
DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/$(PKGNAME)$(OCAML_STDLIB_DIR)

ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
build/$(PKGNAME)::
	$(MAKE) -C $(DEB_SRCDIR)/ native-code-library
endif

ifneq ($(OCAML_HAVE_OCAMLOPT),yes)
export LIBINSTALL_FILES = libpostgresql_stubs.a postgresql.cma postgresql.cmi postgresql.mli dllpostgresql_stubs.so
endif

binary-install/$(PKGNAME)::
	mv $(CURDIR)/debian/$(PKGNAME)$(OCAML_STDLIB_DIR)/postgresql/*.so \
		$(CURDIR)/debian/$(patsubst %-dev,%,$(PKGNAME))$(OCAML_STDLIB_DIR)/stublibs/