Add versioning of library
[framework/api/sim.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 
34         rm -rf $(CMAKE_BUILD_DIR)
35         rm -f *.pc
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-telephony-sim-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