File: rules

package info (click to toggle)
openzwave 1.6.1545%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 30,444 kB
  • sloc: xml: 75,886; cpp: 64,941; ansic: 5,228; makefile: 712; perl: 596; sh: 168
file content (49 lines) | stat: -rwxr-xr-x 1,874 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

export DH_VERBOSE=1

CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
#XXX: MORECPPFLAGS=-fPIE -pie
# add CFLAGS here as upstream make does not care about them and we need -Wformat
MORECPPFLAGS=$(CFLAGS)
MORELDFLAGS:=-Wl,-z,now

#XXX no need to use this: export CC=gcc-8
#XXX no need to use this: export CXX=g++-8

ifndef DESTDIR
DESTDIR=$(CURDIR)/debian/tmp/
endif

MAJOR := $(shell echo '$(DEB_VERSION_UPSTREAM)' | awk -F . {'print $$1'})
MINOR := $(shell echo '$(DEB_VERSION_UPSTREAM)' | awk -F . {'print $$2'} | awk -F '+' {'print $$1'})
REV := $(shell echo '$(DEB_VERSION_UPSTREAM)' | awk -F . {'print $$3'} | awk -F '+' {'print $$1'})
ifeq ($(strip $(REV)),)
  REV:=0
endif
#XXX not really needed: DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR := /usr/lib/$(DEB_HOST_MULTIARCH)/

%:
	dh $@

override_dh_clean:
	rm -f ozw_config doxygen.log cpp/src/vers.cpp
	dh_clean

override_dh_auto_build:
	echo "Build version: >$(MAJOR).$(MINOR).$(REV)<"
	LDFLAGS="$(LDFLAGS) $(MORELDFLAGS)" CPPFLAGS="$(CPPFLAGS) $(MORECPPFLAGS)" VERSION_MAJ=$(MAJOR) VERSION_MIN=$(MINOR) VERSION_REV=$(REV) PREFIX=/usr sysconfdir=/etc/openzwave instlibdir=$(LIBDIR) make

override_dh_auto_install:
	VERSION_MAJ=$(MAJOR) VERSION_MIN=$(MINOR) VERSION_REV=$(REV) DESTDIR=$(DESTDIR) PREFIX=/usr sysconfdir=/etc/openzwave instlibdir=$(LIBDIR) make install
	# install docs in /usr/share/doc/openzwave/, not openzwave-VERSION
	install -d debian/libopenzwave-doc/usr/share/doc

update_debian_version:
	sed -i '1 s/(.*)/($(shell git describe --long --tags --dirty | sed s/-/./g | sed s/^v// ))/' debian/changelog