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