Tizen 2.0 Release
[framework/api/usb-accessory.git] / debian / rules
1 #!/usr/bin/make -f
2
3 FULLVER ?= $(shell dpkg-parsechangelog | grep Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
4 MAJORVER ?= $(shell echo $(FULLVER) | cut -d '.' -f 1)
5
6 CFLAGS = -Wall -g
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 -f `find . -name *.desktop`
36         rm -rf $(CMAKE_BUILD_DIR)
37         dh_clean
38         
39 install: build
40         dh_testdir
41         dh_testroot
42         dh_clean -k 
43         dh_installdirs
44
45         cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
46
47 binary-indep: build install
48
49 binary-arch: build install
50         dh_testdir
51         dh_testroot
52         dh_installchangelogs 
53         dh_installdocs
54         dh_installexamples
55         dh_install --sourcedir=debian/tmp
56         dh_installman
57         dh_link
58         dh_strip --dbg-package=capi-system-usb-accessory-dbg
59         dh_fixperms
60         dh_makeshlibs
61         dh_installdeb
62         dh_shlibdeps
63         dh_gencontrol
64         dh_md5sums
65         dh_builddeb
66
67 binary: binary-indep binary-arch
68 .PHONY: build clean binary-indep binary-arch binary install configure
69