3 # Uncomment this to turn on verbose mode.
6 # This has to be exported to make some magic below work.
9 DEB_DESTDIR = $(CURDIR)/debian/tmp
16 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling threadoff"
17 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
18 PROFILE_ARGS= --with-gprof
20 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
21 CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP
22 EXTRA_ARGS = --with-backtrace
27 ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
28 THREAD_ARGS=--without-threaded-client
33 configure: configure-stamp
37 CFLAGS="$(CFLAGS)" ./configure \
38 --with-prefix=/var/lib/citadel \
39 --with-datadir=/var/lib/citadel \
40 --with-staticdatadir=/usr/share/citadel-server \
41 --with-spooldir=/var/spool/citadel \
42 --with-sysconfdir=/etc/citadel \
43 --with-rundir=/var/run/citadel \
44 --with-docdir=/usr/share/doc/citadel-doc/ \
45 --with-ssldir=/etc/ssl/citadel/ \
46 --with-utility-bindir=/usr/lib/citadel-server/ \
53 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) $(THREAD_ARGS)
58 build: build-arch build-indep
60 build-arch: build-arch-stamp
61 build-arch-stamp: configure-stamp
66 build-indep: build-indep-stamp
67 build-indep-stamp: configure-stamp
74 rm -f build-arch-stamp build-indep-stamp configure-stamp
79 rm -f config.status config.log
81 install: install-indep install-arch
88 $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new
90 dh_install -i --sourcedir=debian/tmp
98 $(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new
100 install -D -p -m0755 database_cleanup.sh \
101 $(DEB_DESTDIR)/usr/share/doc/citadel-server/examples/database_cleanup.sh
103 install -D -p -m0644 docs/welcomemail.html \
104 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.html
106 install -D -p -m0644 docs/welcomemail.txt \
107 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.txt
109 dh_install -s --sourcedir=debian/tmp
117 dh_installinit --name=citadel
129 # Build architecture independant packages using the common target.
130 binary-indep: build-indep install-indep
131 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
133 # Build architecture dependant packages using the common target.
134 binary-arch: build-arch install-arch
135 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
137 binary: binary-arch binary-indep
138 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure