Increase the version to 9.0
[platform/adaptation/bluetooth-firmware-bcm.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 CFLAGS ?= -Wall -g
7 LDFLAGS ?=
8 PREFIX ?= /usr
9 DATADIR ?= /opt
10 PLUGIN_PREFIX ?= /usr
11
12 CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
13
14 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O0
16 else
17         CFLAGS += -O2
18 endif
19
20 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs
21
22 configure: configure-stamp
23 configure-stamp:
24         dh_testdir
25         # Add here commands to configure the package.
26         mkdir -p $(CMAKE_BUILD_DIR) && \
27         cd $(CMAKE_BUILD_DIR) && \
28         CFLAGS="$(CFLAGS) -fpie" LDFLAGS="$(LDFLAGS) -pie" \
29         cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DPLUGIN_INSTALL_PREFIX=$(PLUGIN_PREFIX)
30
31         touch configure-stamp
32
33 build: build-stamp
34
35 build-stamp: configure-stamp
36         dh_testdir
37
38         # Add here commands to compile the package.
39         cd $(CMAKE_BUILD_DIR) && $(MAKE)
40
41         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
42                 cat $$f > $${f%.in}; \
43                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
44                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
45                 sed -i -e "s#@PLUGIN_PREFIX@#$(PLUGIN_PREFIX)#g" $${f%.in}; \
46         done
47
48         touch $@
49
50 clean:
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp configure-stamp
54
55         # Add here commands to clean up after the build process.
56         -rm -rf $(CMAKE_BUILD_DIR)
57         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
58                 rm -f $${f%.in}; \
59         done
60
61         dh_clean
62
63 install: build
64         dh_testdir
65         dh_testroot
66         dh_clean -k
67         dh_installdirs
68
69         # Add here commands to install the package into debian/wavplayer.
70         cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
71
72
73
74         # Booting script
75
76 # Build architecture-independent files here.
77 binary-indep: build install
78 # We have nothing to do by default.
79
80 # Build architecture-dependent files here.
81 binary-arch: build install
82         dh_testdir
83         dh_testroot
84         dh_installchangelogs
85         dh_installdocs
86         dh_installexamples
87         dh_install --sourcedir=debian/tmp
88 #       dh_installmenu
89 #       dh_installdebconf
90 #       dh_installlogrotate
91 #       dh_installemacsen
92 #       dh_installpam
93 #       dh_installmime
94 #       dh_python
95 #       dh_installinit
96 #       dh_installcron
97 #       dh_installinfo
98         dh_installman
99         dh_link
100         dh_strip --dbg-package=bluetooth-firmware-bcm-dbg
101         dh_compress
102         dh_fixperms
103 #       dh_perl
104         dh_makeshlibs
105         dh_installdeb
106         dh_shlibdeps
107         dh_gencontrol
108         dh_md5sums
109         dh_builddeb
110
111 binary: binary-indep binary-arch
112 .PHONY: build clean binary-indep binary-arch binary install configure