Tizen 2.0 Release
[profile/ivi/bluez.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6
7 # These are used for cross-compiling and for saving the configure script
8 # from having to guess our platform (since we know it already)
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 LDFLAGS ?=
14 PREFIX ?= /usr
15 DATADIR ?= /opt
16
17 LDFLAGS += -Wl,--as-needed
18
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20         CFLAGS += -O0
21 else
22         CFLAGS += -O2
23 endif
24
25 MACHINE="aquila"
26 BT_CHIP_CFLAGS=-D__BROADCOM_PATCH__
27 CHIP_OPTIONS=--disable-bccmd
28
29 configure: configure.ac
30         aclocal
31         autoheader
32         libtoolize
33         automake --add-missing
34         autoconf
35
36 config.status: configure
37         dh_testdir
38
39         # Add here commands to configure the package.
40         CFLAGS="$(CFLAGS) -D__TIZEN_PATCH__ -D__BROADCOM_PATCH__ $(BT_CHIP_CFLAGS)" \
41         LDFLAGS="$(LDFLAGS) -Wl,--warn-unresolved-symbols" \
42         ./configure     --prefix=$(PREFIX) \
43                         --sysconfdir=$(PREFIX)/etc \
44                         --localstatedir=$(DATADIR)/var \
45                         --enable-pie \
46                         --enable-network \
47                         --enable-serial \
48                         --enable-input \
49                         --enable-usb=no \
50                         --enable-tools \
51                         $(CHIP_OPTIONS) \
52                         --enable-pcmcia=no \
53                         --enable-hid2hci=no \
54                         --enable-alsa=no \
55                         --enable-gstreamer=no \
56                         --disable-dfutool \
57                         --disable-cups \
58                         --disable-test \
59                         --enable-health \
60                         --enable-dbusoob \
61                         --with-telephony=tizen
62
63 build: build-stamp
64
65 build-stamp:  config.status
66         dh_testdir
67
68         # Add here commands to compile the package.
69         $(MAKE)
70         #docbook-to-man debian/ncurses.sgml > ncurses.1
71
72         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
73                 cat $$f > $${f%.in}; \
74                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
75                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
76         done
77
78         touch $@
79
80 clean:
81         dh_testdir
82         dh_testroot
83         rm -f build-stamp
84
85         # Add here commands to clean up after the build process.
86         -$(MAKE) distclean
87
88         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
89                 rm -f $${f%.in}; \
90         done
91
92         dh_clean 
93
94 install: build
95         dh_testdir
96         dh_testroot
97         dh_clean -k
98         dh_installdirs
99
100         # Add here commands to install the package into debian/tmp.
101         install -D -m 0644 $(CURDIR)/audio/audio.conf $(CURDIR)/debian/tmp/usr/etc/bluetooth/audio.conf
102         install -D -m 0644 $(CURDIR)/network/network.conf $(CURDIR)/debian/tmp/usr/etc/bluetooth/network.conf
103
104         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
105
106
107 # Build architecture-independent files here.
108 binary-indep: build install
109 # We have nothing to do by default.
110
111 # Build architecture-dependent files here.
112 binary-arch: build install
113         dh_testdir
114         dh_testroot
115         dh_installchangelogs
116         dh_installdocs
117         dh_installexamples
118         dh_install --sourcedir=debian/tmp
119         dh_installman
120         dh_link
121         dh_strip --dbg-package=bluez-dbg
122         dh_compress
123         dh_fixperms
124 #       dh_perl
125         dh_makeshlibs
126         dh_installdeb
127         dh_shlibdeps
128         dh_gencontrol
129         dh_md5sums
130         dh_builddeb
131
132 binary: binary-indep binary-arch
133 .PHONY: build clean binary-indep binary-arch binary install