55 lines
2.0 KiB
Makefile
Executable File
55 lines
2.0 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
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
|
|
|
|
export CC=gcc-8
|
|
export CXX=g++-8
|
|
|
|
ifndef DESTDIR
|
|
DESTDIR=$(CURDIR)/debian/tmp/
|
|
endif
|
|
|
|
DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
|
|
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[\[:digit:]]*://' -e 's/[-].*//')
|
|
MAJOR := $(shell echo '$(VERSION)' | awk -F . {'print $$1'})
|
|
MINOR := $(shell echo '$(VERSION)' | awk -F . {'print $$2'} | awk -F '+' {'print $$1'})
|
|
REV := $(shell echo '$(VERSION)' | awk -F . {'print $$3'})
|
|
ifeq ($(strip $(REV)),)
|
|
REV:=0
|
|
endif
|
|
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
|
|
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
|
|
###mv debian/tmp/usr/share/doc/openzwave-1* debian/libopenzwave-doc/usr/share/doc/openzwave
|
|
# install config files in /etc/
|
|
install -d debian/libopenzwave1.4/etc
|
|
mv debian/tmp/usr/etc/openzwave debian/libopenzwave1.4/etc/
|
|
|
|
update_debian_version:
|
|
sed -i '1 s/(.*)/($(shell git describe --long --tags --dirty | sed s/-/./g | sed s/^v// ))/' debian/changelog
|