3 # Uncomment this to turn on verbose mode.
6 # This has to be exported to make some magic below work.
7 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12 DEB_DESTDIR = $(CURDIR)/debian/tmp
19 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling threadoff rss"
20 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
21 PROFILE_ARGS= --with-gprof
23 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
24 CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP -D TECH_PREVIEW
25 LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
26 EXTRA_ARGS = --with-backtrace
28 LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
32 ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
33 THREAD_ARGS=--without-threaded-client
39 ifneq (,$(findstring rss,$(DEB_BUILD_OPTIONS)))
40 CFLAGS += -D DEBUG_RSS
43 ifneq (,$(findstring iodbg,$(DEB_BUILD_OPTIONS)))
44 CFLAGS += -D BIGBAD_IODBG
47 configure: configure-stamp
51 LDFLAGS="$(LDFLAGS)"; CFLAGS="$(CFLAGS)" ./configure \
52 --prefix=/var/lib/citadel/ \
53 --with-datadir=/var/lib/citadel/ \
54 --with-helpdir=/usr/share/citadel-server/ \
55 --with-staticdatadir=/etc/citadel/ \
56 --with-spooldir=/var/spool/citadel/ \
57 --with-sysconfdir=/etc/citadel/ \
58 --with-rundir=/var/run/citadel/ \
59 --with-docdir=/usr/share/doc/citadel-doc/ \
60 --with-ssldir=/etc/ssl/citadel/ \
61 --with-utility-bindir=/usr/lib/citadel-server/ \
62 --with-autosysconfdir=/var/lib/citadel/data/ \
63 --with-localedir=/usr/share/ \
66 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) $(THREAD_ARGS)
71 build: build-arch build-indep
73 build-arch: build-arch-stamp
74 build-arch-stamp: configure-stamp
79 build-indep: build-indep-stamp
80 build-indep-stamp: configure-stamp
87 rm -f build-arch-stamp build-indep-stamp configure-stamp
91 rm -f config.status config.log
92 #[ ! -f Makefile ] || $(MAKE) distclean
94 install: install-indep install-arch
95 install-indep: build-indep
101 $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new
103 dh_install -i --sourcedir=debian/tmp
105 install-arch: build-arch
111 $(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new
113 install -D -p -m0755 database_cleanup.sh \
114 $(DEB_DESTDIR)/usr/share/doc/citadel-server/examples/database_cleanup.sh
116 install -D -p -m0644 docs/welcomemail.html \
117 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.html
119 install -D -p -m0644 docs/welcomemail.txt \
120 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.txt
122 dh_install -s --sourcedir=debian/tmp
130 dh_installinit --name=citadel
132 dh_strip --dbg-package=citadel-dbg
143 # Build architecture independant packages using the common target.
144 binary-indep: build-indep install-indep
145 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
147 # Build architecture dependant packages using the common target.
148 binary-arch: build-arch install-arch
149 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
151 binary: binary-arch binary-indep
152 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure