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.
9 # Uncomment this to turn on verbose mode.
13 # These are used for cross-compiling and for saving the configure script
14 # from having to guess our platform (since we know it already)
15 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
16 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
17 PACKAGE_VERSION ?= $(shell sed -n "1 p" debian/changelog | sed 's/.*(\(.*\)).*/\1/')
18 PACKAGE_API_VERSION ?= $(shell sed -n "1 p" debian/changelog | sed 's/.*([0-9]*.\([0-9]*\).*).*/\1/')
19 PROJECT_NAME ?= wrt-plugins-common
21 CFLAGS ?= -Wall -g -fvisibility=default -fPIC
22 CXXFLAGS ?= -Wall -g -fPIC
25 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
33 ifeq (,$(findstring no,$(DPL_LOG)))
34 DPL_LOGS_STATUS = "ON"
36 DPL_LOGS_STATUS = "OFF"
39 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--hash-style=both -Wl,--version-script=$(CURDIR)/wrt-plugins-common.map
42 CMAKEFLAGS += -DDEVPKG="$(DEVPKG)"
46 CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build
48 #configure: configure-stamp
51 # Add here commands to configure the package.
52 mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
53 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
56 -DBUILD_TYPE="${TARGET}" \
57 -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
58 -DCMAKE_BUILD_TYPE="$(BUILD_TYPE)" \
59 -DCMAKE_PACKAGE_VERSION="$(PACKAGE_API_VERSION)" \
60 -DCMAKE_PROJECT_NAME="$(PROJECT_NAME)" \
61 -DDPL_LOG=$(DPL_LOGS_STATUS) ..
65 build-stamp: configure-stamp
68 # Add here commands to compile the package.
69 cd $(CMAKE_BUILD_DIR) && $(MAKE) -j5
71 #docbook-to-man debian/ncurses.sgml > ncurses.1
73 for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
74 cat $$f > $${f%.in}; \
75 sed -i -e "s#@PREFIX@#$(PREFIX)/lib#g" $${f%.in}; \
76 sed -i -e "s#@PREFIX_INCLUDE@#$(PREFIX)/include#g" $${f%.in}; \
79 for f in `find $(CURDIR)/pkgconfigs/ -name "*.in"`; do \
80 cat $$f > $${f%.in}; \
81 sed -i -e "s#@VERSION@#$(PACKAGE_VERSION)#g" $${f%.in}; \
82 sed -i -e "s#@PROJECT_NAME@#$(PROJECT_NAME)#g" $${f%.in}; \
91 rm -f build-stamp configure-stamp
92 rm -rf $(CMAKE_BUILD_DIR)
96 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
97 cp -f /usr/share/misc/config.sub config.sub
99 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
100 cp -f /usr/share/misc/config.guess config.guess
103 for f in `find $(CURDIR)/ -name "*.pc"`; do \
115 # Add here commands to install the package into debian/ncurses.
116 cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
118 # Build architecture-independent files here.
119 binary-indep: build install
120 # We have nothing to do by default.
122 # Build architecture-dependent files here.
123 binary-arch: build install
129 dh_install --sourcedir=debian/tmp
132 # dh_installlogrotate
142 dh_strip --dbg-package=wrt-plugins-common-dbg
153 binary: binary-indep binary-arch
154 .PHONY: build clean binary-indep binary-arch binary install