2.0 beta init
[framework/api/radio.git] / debian / rules
1 #!/usr/bin/make -f
2
3 CFLAGS = -Wall -g
4
5 FULLVER ?= $(shell dpkg-parsechangelog | grep Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
6 MAJORVER ?= $(shell echo $(FULLVER) | cut -d '.' -f 1)
7
8 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
9         CFLAGS += -O0
10 else
11         CFLAGS += -O2
12 endif
13 CMAKE_ROOT_DIR ?= $(CURDIR)
14 CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
15
16 configure: configure-stamp
17 configure-stamp:
18         dh_testdir
19         mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && cmake .. -DFULLVER=${FULLVER} -DMAJORVER=${MAJORVER}
20         touch configure-stamp
21
22
23 build: build-stamp
24 build-stamp: configure-stamp 
25         dh_testdir
26         cd $(CMAKE_BUILD_DIR) && $(MAKE)
27         touch $@
28
29 clean:
30         cd $(CMAKE_ROOT_DIR)
31         dh_testdir
32         dh_testroot
33         rm -f build-stamp configure-stamp
34         rm -f `find . -name *.pc`
35         rm -rf $(CMAKE_BUILD_DIR)
36         dh_clean
37         
38 install: build
39         dh_testdir
40         dh_testroot
41         dh_clean -k 
42         dh_installdirs
43
44         cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
45
46 binary-indep: build install
47
48 binary-arch: build install
49         dh_testdir
50         dh_testroot
51         dh_installchangelogs 
52         dh_installdocs
53         dh_installexamples
54         dh_install --sourcedir=debian/tmp
55         dh_installman
56         dh_link
57         dh_strip --dbg-package=capi-media-radio-dbg
58         dh_fixperms
59         dh_makeshlibs
60         dh_installdeb
61         dh_shlibdeps
62         dh_gencontrol
63         dh_md5sums
64         dh_builddeb
65
66 binary: binary-indep binary-arch
67 .PHONY: build clean binary-indep binary-arch binary install configure
68