Unused code 3
[platform/framework/web/wrt.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 PACKAGE_VERSION ?= $(shell dpkg-parsechangelog | sed -n 's/^Version: // p')
10
11 PREFIX ?= /usr
12 LDFLAGS = -Wl,--rpath=$(PREFIX)/lib
13 CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
14
15 ifeq (,$(findstring no,$(DPL_LOGS)))
16         DPL_LOGS_STATUS = "ON"
17 else
18         DPL_LOGS_STATUS = "OFF"
19 endif
20
21 # Please set CFLAGS only in CMakeLists.txt, as they are dependent on CMake build type.
22 #for building with:
23 #config.status: configure
24 config.status:
25         dh_testdir
26         # Add here commands to configure the package.
27         mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
28         cmake ${SRCDIR}                                                                 \
29                 -DCMAKE_INSTALL_PREFIX="${PREFIX}"                                      \
30                 -DDPL_LOG=$(DPL_LOGS_STATUS)                                            \
31                 -DPROJECT_VERSION="${PACKAGE_VERSION}" ..
32
33 build: build-stamp
34
35 build-stamp:  config.status
36         dh_testdir
37         # Add here commands to compile the package.
38         cd $(CMAKE_BUILD_DIR) && $(MAKE) -j 4
39         #docbook-to-man debian/ncurses.sgml > ncurses.1
40
41         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
42                 cat $$f > $${f%.in}; \
43                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
44         done
45
46         touch $@
47
48 clean:
49         dh_testdir
50         dh_testroot
51         rm -f build-stamp
52
53         # Add here commands to clean up after the build process.
54         -find . -name CMakeFiles -exec rm -rf {} \;
55         -find . -name cmake_install.cmake -exec rm {} \;
56         #-find . -name Makefile -exec rm {} \;
57         rm CMakeCache.txt -rf
58         #-$(MAKE) distclean
59         rm -rf $(CMAKE_BUILD_DIR)
60         rm -rf autotools
61         rm -rf aclocal.m4
62         rm -rf configure
63         rm -rf Makefile
64         rm -rf Makefile.in
65         rm -rf m4
66         rm -rf libtool
67         rm -rf build/config.*
68         rm -rf build/depcomp
69         rm -rf build/install-sh
70         rm -rf build/ltmain.sh
71         rm -rf build/missing
72
73 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
74         cp -f /usr/share/misc/config.sub config.sub
75 endif
76 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
77         cp -f /usr/share/misc/config.guess config.guess
78 endif
79
80         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
81                 rm -f $${f%.in}; \
82         done
83
84         rm -rf config.*
85         dh_clean
86
87 install: build
88         dh_testdir
89         dh_testroot
90         dh_clean -k
91         dh_installdirs
92
93         # Add here commands to install the package into debian/ncurses.
94         cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
95
96
97 # Build architecture-independent files here.
98 binary-indep: build install
99 # We have nothing to do by default.
100
101 # Build architecture-dependent files here.
102 binary-arch: build install
103         dh_testdir
104         dh_testroot
105         dh_installchangelogs
106         dh_installdocs
107         dh_installexamples
108         dh_install --sourcedir=debian/tmp
109 #       dh_installmenu
110 #       dh_installdebconf
111 #       dh_installlogrotate
112 #       dh_installemacsen
113 #       dh_installpam
114 #       dh_installmime
115 #       dh_python
116 #       dh_installinit
117 #       dh_installcron
118 #       dh_installinfo
119         dh_installman
120         dh_link
121         dh_strip --dbg-package=wrt-dbg
122         dh_compress
123         dh_fixperms
124 #       dh_perl
125         dh_makeshlibs
126         dh_installdeb
127         dh_shlibdeps
128         dh_gencontrol
129         dh_md5sums
130         dh_builddeb
131
132 binary: binary-indep binary-arch
133 .PHONY: build clean binary-indep binary-arch binary install