4e0ba03ce8823e60c9908f4d4c073f9c806b374b
[platform/core/uifw/stt.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 += /usr
16 DATADIR += /opt
17
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19         CFLAGS += -O0
20         CXXFLAGS += -O0
21 else
22         CFLAGS += -O2
23         CXXFLAGS += -O2
24 endif
25
26 #CFLASGS += -fpie -shared
27 #CFLAGS += -fPIC -shared
28 #CXXFLAGS += -fpie
29 #LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -pie
30 #LDFLAGS += -Wl,--rpath=$(PREFIX)/lib  -pie
31
32 CFLASGS += -fpie
33 CXXFLAGS += -fpie
34 #LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -pie
35 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib  -pie
36
37 configure: configure-stamp
38 configure-stamp:
39         dh_testdir
40         # Add here commands to configure the package.
41         CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=${PREFIX}
42
43         touch configure-stamp
44
45
46 build: build-stamp
47
48 build-stamp: configure-stamp 
49         dh_testdir
50
51         # Add here commands to compile the package.
52         $(MAKE)
53         #docbook-to-man debian/client.sgml > client.1
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#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
58         done    
59
60         touch $@
61
62 clean:
63         dh_testdir
64         dh_testroot
65         rm -f build-stamp configure-stamp
66
67         # Add here commands to clean up after the build process.
68         -$(MAKE) clean
69         rm -rf CMakeCache.txt
70         rm -rf CMakeFiles
71         rm -rf cmake_install.cmake
72         rm -rf Makefile
73         rm -rf install_manifest.txt
74         rm -rf client/CMakeCache.txt
75         rm -rf client/CMakeFiles
76         rm -rf client/cmake_install.cmake
77         rm -rf client/Makefile
78         rm -rf client/install_manifest.txt
79         rm -rf client/*.pc
80         rm -rf server/CMakeCache.txt
81         rm -rf server/CMakeFiles
82         rm -rf server/cmake_install.cmake
83         rm -rf server/Makefile
84         rm -rf server/install_manifest.txt              
85         rm -rf server/*.pc
86         rm -rf *.pc
87         rm -rf *.so
88         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
89                 rm -f $${f%.in}; \
90         done
91
92         dh_clean 
93
94 install: build
95         dh_testdir
96         dh_testroot
97         dh_clean -k 
98         dh_installdirs
99
100         # Add here commands to install the package into debian/client.
101         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
102
103
104 # Build architecture-independent files here.
105 binary-indep: build install
106 # We have nothing to do by default.
107
108 # Build architecture-dependent files here.
109 binary-arch: build install
110         dh_testdir
111         dh_testroot
112         dh_installchangelogs 
113         dh_installdocs
114         dh_installexamples
115         dh_install --sourcedir=debian/tmp
116 #       dh_installmenu
117 #       dh_installdebconf       
118 #       dh_installlogrotate
119 #       dh_installemacsen
120 #       dh_installpam
121 #       dh_installmime
122 #       dh_python
123 #       dh_installinit
124 #       dh_installcron
125 #       dh_installinfo
126         dh_installman
127         dh_link
128         dh_strip --dbg-package=libstt-dbg
129         dh_compress
130         dh_fixperms
131 #       dh_perl
132 #       dh_makeshlibs
133         dh_installdeb
134         dh_shlibdeps
135         dh_gencontrol
136         dh_md5sums
137         dh_builddeb
138
139 binary: binary-indep binary-arch
140 .PHONY: build clean binary-indep binary-arch binary install configure