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"
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
31 ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
32 THREAD_ARGS=--without-threaded-client
37 configure: configure-stamp
41 CFLAGS="$(CFLAGS)" ./configure \
42 --with-prefix=/var/lib/citadel \
43 --with-datadir=/var/lib/citadel \
44 --with-staticdatadir=/usr/share/citadel-server \
45 --with-spooldir=/var/spool/citadel \
46 --with-sysconfdir=/etc/citadel \
47 --with-rundir=/var/run/citadel \
48 --with-docdir=/usr/share/doc/citadel-doc/ \
49 --with-ssldir=/etc/ssl/citadel/ \
50 --with-utility-bindir=/usr/lib/citadel-server/ \
57 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) $(THREAD_ARGS)
62 build: build-arch build-indep
64 build-arch: build-arch-stamp
65 build-arch-stamp: configure-stamp
70 build-indep: build-indep-stamp
71 build-indep-stamp: configure-stamp
78 rm -f build-arch-stamp build-indep-stamp configure-stamp
80 [ ! -f Makefile ] || $(MAKE) distclean
83 rm -f config.status config.log
85 install: install-indep install-arch
92 $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new
94 dh_install -i --sourcedir=debian/tmp
102 $(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new
104 install -D -p -m0755 database_cleanup.sh \
105 $(DEB_DESTDIR)/usr/share/doc/citadel-server/examples/database_cleanup.sh
107 install -D -p -m0644 docs/welcomemail.html \
108 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.html
110 install -D -p -m0644 docs/welcomemail.txt \
111 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.txt
113 dh_install -s --sourcedir=debian/tmp
121 dh_installinit --name=citadel
133 # Build architecture independant packages using the common target.
134 binary-indep: build-indep install-indep
135 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
137 # Build architecture dependant packages using the common target.
138 binary-arch: build-arch install-arch
139 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
141 binary: binary-arch binary-indep
142 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure