+ add C-to-Json serializer
[citadel.git] / libcitadel / debian / rules
1 #!/usr/bin/make -f
2 # -*- mode: makefile; coding: utf-8 -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 export DH_COMPAT = 5
8
9 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11
12 CFLAGS = -Wall -g
13 LDFALGS = 
14 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
16         EXTRA_ARGS =  --with-backtrace
17 else
18         CFLAGS += -O2
19 endif
20
21 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
22         CFLAGS += -pg
23         LDFLAGS += -pg
24 endif
25
26 build: build-stamp
27 build-stamp:
28         dh_testdir
29
30 # ./configure
31         CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)";  ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
32                 $(EXTRA_ARGS) \
33                 --prefix=/usr
34
35 # Build libcitadel
36         $(MAKE)
37
38         touch build-stamp
39
40 clean:
41         dh_testdir
42         dh_testroot
43         rm -f build-stamp install*-stamp
44
45         -$(MAKE) distclean
46
47         dh_clean
48
49 install: install-stamp
50 install-stamp: build-stamp
51         dh_testdir
52         dh_testroot
53         dh_clean -k
54         dh_installdirs
55
56         $(MAKE) DESTDIR=`pwd`/debian/tmp install
57
58         touch install-stamp
59
60 # Build architecture-independent files here.
61 binary-indep: build install
62 #       dh_testdir -i
63         dh_testroot -i
64 #       dh_installdocs -i -A README
65 #       dh_installchangelogs -i debian/no-upstream-changelog
66 #       dh_install -i --sourcedir=debian/tmp
67 #       dh_link -i
68 #       dh_strip -i
69 #       dh_compress -i
70 #       dh_fixperms -i
71 #       dh_installdeb -i
72 #       dh_shlibdeps -i
73 #       dh_gencontrol -i
74 #       dh_md5sums -i
75 #       dh_builddeb -i
76
77 # Build architecture-dependent files here.
78 binary-arch: build install
79         dh_testdir -a
80         dh_testroot -a
81 #       dh_installdocs -plibcitadel1
82         dh_installchangelogs -plibcitadel
83         dh_install -a --sourcedir=debian/tmp
84         dh_link -a
85         dh_strip -a --dbg-package=libcitadel1-dbg
86         dh_compress -a
87         dh_fixperms -a
88         dh_makeshlibs -a -V 'libcitadel1'
89         dh_installdeb -a
90         dh_shlibdeps -a
91         dh_gencontrol -a
92         dh_md5sums -a
93         dh_builddeb -a
94
95 source diff:                                                                  
96         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
97
98 binary: binary-indep binary-arch
99 .PHONY: build clean binary-indep binary-arch binary install