apply FSL(Flora Software License)
[apps/native/ug-wifi-direct.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 LDFLAGS ?= -pie
14 PREFIX ?= /opt/ug
15 DATADIR ?= /opt
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22
23 LDFLAGS += -Wl,--rpath=/usr/lib -Wl,--hash-style=both -Wl,--as-needed
24
25
26 configure: configure-stamp
27 configure-stamp:
28         dh_testdir
29         # Add here commands to configure the package.
30         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .
31         touch configure-stamp
32
33 build: build-stamp
34 build-stamp: configure-stamp 
35         dh_testdir
36
37         # Add here commands to compile the package.
38         $(MAKE)
39
40         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
41                 cat $$f > $${f%.in}; \
42                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
43         done
44
45 clean:
46         dh_testdir
47         dh_testroot
48         rm -f build-stamp configure-stamp
49
50         # Add here commands to clean up after the build process.
51         -$(MAKE) clean
52
53         rm -rf CMakeCache.txt
54         rm -rf cmake_install.cmake
55         rm -rf Makefile
56         rm -rf install_manifest.txt
57         rm -rf CMakeFiles
58
59         rm -rf popup-wifidirect/CMakeCache.txt
60         rm -rf popup-wifidirect/CMakeFiles
61         rm -rf popup-wifidirect/cmake_install.cmake
62         rm -rf popup-wifidirect/Makefile
63         rm -rf popup-wifidirect/install_manifest.txt
64         rm -rf popup-wifidirect/*.so
65
66         rm -rf ug-wifidirect/CMakeCache.txt
67         rm -rf ug-wifidirect/CMakeFiles
68         rm -rf ug-wifidirect/cmake_install.cmake
69         rm -rf ug-wifidirect/Makefile
70         rm -rf ug-wifidirect/install_manifest.txt
71         rm -rf ug-wifidirect/*.so
72
73         rm -rf popup-wifidirect/po/CMakeCache.txt
74         rm -rf popup-wifidirect/po/CMakeFiles
75         rm -rf popup-wifidirect/po/cmake_install.cmake
76         rm -rf popup-wifidirect/po/Makefile
77         rm -rf popup-wifidirect/po/install_manifest.txt
78         rm -fr popup-wifidirect/po/*.mo
79
80         rm -rf ug-wifidirect/po/CMakeCache.txt
81         rm -rf ug-wifidirect/po/CMakeFiles
82         rm -rf ug-wifidirect/po/cmake_install.cmake
83         rm -rf ug-wifidirect/po/Makefile
84         rm -rf ug-wifidirect/po/install_manifest.txt
85         rm -fr ug-wifidirect/po/*.mo
86
87         rm -rf *.so
88         rm -rf *.desktop
89         rm -rf *.edj
90         rm -rf *.pc
91
92         rm -rf debian/*.install
93         rm -fr debian/temp
94         
95         dh_clean 
96
97 dev_clean:
98         dh_testdir
99         dh_testroot
100         rm -f build-stamp configure-stamp
101
102         dh_clean 
103
104 install: build
105         dh_testdir
106         dh_testroot
107         dh_clean -k 
108         dh_installdirs
109
110         # Add here commands to install the package into debian/tmp.
111         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
112
113
114 # Build architecture-independent files here.
115 binary-indep: build install
116 # We have nothing to do by default.
117
118 # Build architecture-dependent files here.
119 binary-arch: build install
120         dh_testdir
121         dh_testroot
122         dh_installchangelogs 
123         dh_installdocs
124         dh_installexamples
125         dh_install --sourcedir=debian/tmp
126         dh_installman
127         dh_link
128 #       dh_strip
129         dh_strip --dbg-package=libug-setting-wifidirect-efl-dbg
130         dh_compress
131         dh_fixperms
132 #       dh_perl
133         dh_makeshlibs
134         dh_installdeb
135 #       dh_shlibdeps
136         dh_gencontrol
137         dh_md5sums
138         dh_builddeb
139
140 binary: binary-indep binary-arch
141 .PHONY: build clean binary-indep binary-arch binary install configure