Initialize Tizen 2.3
[apps/home/settings.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 CFLAGS += -Wall -g
13 CXXFLAGS +=  -Wall -g
14 LDFLAGS ?= 
15 PREFIX ?= /opt/apps/com.samsung.setting
16 RESDIR ?= /opt/apps/com.samsung.setting/res
17 DATADIR ?= /opt/apps/com.samsung.setting/data
18
19 # Reduce relative text symbols in library
20 CFLAGS += -fPIC
21 CXXFLAGS += -fPIC
22
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25         CXXFLAGS += -O0
26 else
27         CFLAGS += -O2
28         CXXFLAGS += -O2
29 endif
30
31 LDFLAGS += -Wl,--rpath,$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed
32
33 CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
34
35
36 configure: configure-stamp
37 configure-stamp:
38         dh_testdir
39         # Add here commands to configure the package.
40         mkdir -p $(CMAKE_TMP_DIR);
41         cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apps/com.samsung.setting
42
43         touch configure-stamp
44
45 build: build-stamp
46
47 build-stamp: configure-stamp 
48         dh_testdir
49
50         # Add here commands to compile the package.
51         cd $(CMAKE_TMP_DIR) && $(MAKE)
52         #docbook-to-man debian/wavplayer.sgml > wavplayer.1
53
54         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
55                 cat $$f > $${f%.in}; \
56                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
57                 sed -i -e "s#@PREFIX@#$(RESDIR)#g" $${f%.in}; \
58                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
59         done
60
61
62         touch $@
63
64 clean:
65         dh_testdir
66         dh_testroot
67         rm -f build-stamp configure-stamp
68
69         # Add here commands to clean up after the build process.
70         -cd $(CMAKE_TMP_DIR) && $(MAKE) clean
71         rm -rf $(CMAKE_TMP_DIR)
72         find . -name CMakeFiles | xargs rm -rf
73         find . -name *.so | xargs rm -rf
74         find . -name *.o | xargs rm -rf
75         find . -name Makefile | xargs rm -rf
76         find . -name cmake_install.cmake | xargs rm -rf
77         find . -name CMakeCache.txt | xargs rm -rf
78         find . -name CMakeFiles.txt | xargs rm -rf
79         rm -rf Makefile
80         rm -rf install_manifest.txt
81         rm -rf com.samsung.setting.desktop
82         rm -rf *.so
83
84         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
85                 rm -f $${f%.in}; \
86         done
87
88         dh_clean 
89
90 install: build
91         dh_testdir
92         dh_testroot
93         dh_clean -k 
94         dh_installdirs
95         
96         # Add here commands to install the package into debian/wavplayer.
97         cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
98
99 # Build architecture-independent files here.
100 binary-indep: build install
101 # We have nothing to do by default.
102
103 # Build architecture-dependent files here.
104 binary-arch: build install
105         dh_testdir
106         dh_testroot
107         dh_installchangelogs 
108 #       dh_installdocs
109         dh_installexamples
110         dh_install --sourcedir=debian/tmp
111 #       dh_installmenu
112 #       dh_installdebconf       
113 #       dh_installlogrotate
114 #       dh_installemacsen
115 #       dh_installpam
116 #       dh_installmime
117 #       dh_python
118 #       dh_installinit
119 #       dh_installcron
120 #       dh_installinfo
121         dh_installman
122         dh_link
123 #       dh_strip
124         dh_strip --dbg-package=com.samsung.setting-dbg
125         dh_compress
126         dh_fixperms
127 #       dh_perl
128         dh_makeshlibs
129         dh_installdeb
130         dh_shlibdeps
131         dh_gencontrol
132         dh_md5sums
133         dh_builddeb
134
135 binary: binary-indep binary-arch
136 .PHONY: build clean binary-indep binary-arch binary install configure