Move definition of OUTDIR from debian/build/**/Makefile to outer rules
Simplify things by making debian/rules.real, debian/rules and debian/build/Makefile.inc (for the recursive case) set OUTDIR.
This commit is contained in:
parent
32be752344
commit
e1fd4b6f1e
|
@ -6,8 +6,6 @@ SUBDIRS = \
|
||||||
scripts \
|
scripts \
|
||||||
tools
|
tools
|
||||||
|
|
||||||
OUTDIR = .
|
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
# Build userland headers first
|
# Build userland headers first
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
top_srcdir = $(dir $(lastword $(MAKEFILE_LIST)))/../..
|
top_srcdir = $(dir $(lastword $(MAKEFILE_LIST)))/../..
|
||||||
|
|
||||||
|
# Normalise OUTDIR to avoid triggering rebuilds
|
||||||
|
override OUTDIR := $(patsubst ./%,%,$(OUTDIR))
|
||||||
|
|
||||||
VPATH = $(top_srcdir)/$(OUTDIR)
|
VPATH = $(top_srcdir)/$(OUTDIR)
|
||||||
|
|
||||||
SHELL = /bin/sh -e
|
SHELL = /bin/sh -e
|
||||||
|
@ -21,7 +24,7 @@ install: install-local install-recursive
|
||||||
+@list='$(SUBDIRS)'; \
|
+@list='$(SUBDIRS)'; \
|
||||||
for subdir in $$list; do \
|
for subdir in $$list; do \
|
||||||
echo "Making $* in $$subdir"; \
|
echo "Making $* in $$subdir"; \
|
||||||
$(MAKE) -C $$subdir $* \
|
$(MAKE) -C $$subdir OUTDIR=$(OUTDIR)/$$subdir $* \
|
||||||
|| exit 1; \
|
|| exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,6 @@ SUBDIRS = \
|
||||||
kconfig \
|
kconfig \
|
||||||
mod
|
mod
|
||||||
|
|
||||||
OUTDIR = scripts
|
|
||||||
|
|
||||||
include ..//Makefile.inc
|
include ..//Makefile.inc
|
||||||
|
|
||||||
CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||||
|
|
|
@ -2,6 +2,4 @@ PROGS = \
|
||||||
bin2c \
|
bin2c \
|
||||||
fixdep
|
fixdep
|
||||||
|
|
||||||
OUTDIR = scripts/basic
|
|
||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
PROGS = genksyms
|
PROGS = genksyms
|
||||||
|
|
||||||
OUTDIR = scripts/genksyms
|
|
||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
|
|
||||||
genksyms: genksyms.o parse.tab.o lex.lex.o
|
genksyms: genksyms.o parse.tab.o lex.lex.o
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
PROGS = conf
|
PROGS = conf
|
||||||
|
|
||||||
OUTDIR = scripts/kconfig
|
|
||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
|
|
||||||
conf: conf.o zconf.tab.o
|
conf: conf.o zconf.tab.o
|
||||||
|
|
|
@ -5,8 +5,6 @@ PROGS = \
|
||||||
modpost.real-msb-32 \
|
modpost.real-msb-32 \
|
||||||
modpost.real-msb-64
|
modpost.real-msb-64
|
||||||
|
|
||||||
OUTDIR = scripts/mod
|
|
||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
|
|
||||||
modpost.real-%:
|
modpost.real-%:
|
||||||
|
|
|
@ -3,7 +3,6 @@ PROGS = \
|
||||||
hv_kvp_daemon \
|
hv_kvp_daemon \
|
||||||
hv_vss_daemon
|
hv_vss_daemon
|
||||||
|
|
||||||
OUTDIR = tools/hv
|
|
||||||
prefix = /usr/sbin
|
prefix = /usr/sbin
|
||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
OUTDIR = tools/lib/lockdep
|
|
||||||
|
|
||||||
include ../../../Makefile.inc
|
include ../../../Makefile.inc
|
||||||
|
|
||||||
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
OUTDIR = tools/perf
|
|
||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
|
|
||||||
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
|
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
|
||||||
|
|
|
@ -40,7 +40,7 @@ maintainerclean:
|
||||||
|
|
||||||
clean: debian/control
|
clean: debian/control
|
||||||
dh_testdir
|
dh_testdir
|
||||||
make -C $(BUILD_DIR) clean top_srcdir=$(CURDIR)
|
$(MAKE) -C $(BUILD_DIR) clean top_srcdir=$(CURDIR) OUTDIR=.
|
||||||
rm -rf $(STAMPS_DIR) debian/lib/python/debian_linux/__pycache__ debian/*-tmp
|
rm -rf $(STAMPS_DIR) debian/lib/python/debian_linux/__pycache__ debian/*-tmp
|
||||||
dh_clean
|
dh_clean
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@ export KBUILD_BUILD_TIMESTAMP := $(shell dpkg-parsechangelog | sed -ne 's,^Date:
|
||||||
|
|
||||||
include debian/rules.defs
|
include debian/rules.defs
|
||||||
|
|
||||||
|
define submake
|
||||||
|
+$(MAKE) -C $(BUILD_DIR)/$(1) top_srcdir=$(CURDIR) OUTDIR=$(1)
|
||||||
|
endef
|
||||||
|
|
||||||
binary-arch: install-kbuild install-usbip install-liblockdep
|
binary-arch: install-kbuild install-usbip install-liblockdep
|
||||||
ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),)
|
ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),)
|
||||||
binary-arch: install-perf
|
binary-arch: install-perf
|
||||||
|
@ -18,7 +22,7 @@ build-arch: $(STAMPS_DIR)/build
|
||||||
build-indep:
|
build-indep:
|
||||||
|
|
||||||
$(STAMPS_DIR)/build:
|
$(STAMPS_DIR)/build:
|
||||||
$(MAKE) -C $(BUILD_DIR) top_srcdir=$(CURDIR)
|
$(call submake,.)
|
||||||
mkdir -p $(STAMPS_DIR)
|
mkdir -p $(STAMPS_DIR)
|
||||||
touch '$@'
|
touch '$@'
|
||||||
|
|
||||||
|
@ -30,7 +34,7 @@ install-kbuild: $(STAMPS_DIR)/build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
$(MAKE) -C $(BUILD_DIR)/scripts install prefix=$(DIR) top_srcdir=$(CURDIR)
|
$(call submake,scripts) install prefix=$(DIR)
|
||||||
dh_link $(BASE_DIR) /usr/src/$(PACKAGE_NAME)
|
dh_link $(BASE_DIR) /usr/src/$(PACKAGE_NAME)
|
||||||
dh_installchangelogs
|
dh_installchangelogs
|
||||||
dh_installdocs
|
dh_installdocs
|
||||||
|
@ -50,7 +54,7 @@ install-perf: $(STAMPS_DIR)/build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
$(MAKE) -C $(BUILD_DIR)/tools/perf install top_srcdir=$(CURDIR) DESTDIR=$(DIR)
|
$(call submake,tools/perf) install DESTDIR=$(DIR)
|
||||||
dh_perl /usr/share/perf_$(VERSION)-core/scripts/perl/Perf-Trace-Util/lib/
|
dh_perl /usr/share/perf_$(VERSION)-core/scripts/perl/Perf-Trace-Util/lib/
|
||||||
dh_python2 /usr/share/perf_$(VERSION)-core/scripts/python/Perf-Trace-Util/lib/
|
dh_python2 /usr/share/perf_$(VERSION)-core/scripts/python/Perf-Trace-Util/lib/
|
||||||
dh_installchangelogs
|
dh_installchangelogs
|
||||||
|
@ -71,7 +75,7 @@ install-usbip: $(STAMPS_DIR)/build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
$(MAKE) -C $(BUILD_DIR)/tools/usb/usbip install top_srcdir=$(CURDIR) DESTDIR=$(DIR)
|
$(call submake,tools/usb/usbip) install DESTDIR=$(DIR)
|
||||||
dh_install --sourcedir=$(DIR)
|
dh_install --sourcedir=$(DIR)
|
||||||
dh_installchangelogs
|
dh_installchangelogs
|
||||||
dh_installdocs
|
dh_installdocs
|
||||||
|
@ -93,7 +97,7 @@ install-hyperv-daemons: $(STAMPS_DIR)/build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
$(MAKE) -C $(BUILD_DIR)/tools/hv install top_srcdir=$(CURDIR) DESTDIR=$(DIR)
|
$(call submake,tools/hv) install DESTDIR=$(DIR)
|
||||||
dh_install
|
dh_install
|
||||||
dh_installchangelogs
|
dh_installchangelogs
|
||||||
dh_installdocs
|
dh_installdocs
|
||||||
|
@ -115,8 +119,7 @@ install-liblockdep: $(STAMPS_DIR)/build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
$(MAKE) -C $(BUILD_DIR)/tools/lib/lockdep install top_srcdir=$(CURDIR) \
|
$(call submake,tools/lib/lockdep) install DESTDIR=$(DIR)
|
||||||
DESTDIR=$(DIR)
|
|
||||||
env -u DH_OPTIONS dh_install -pliblockdep$(VERSION) --sourcedir=$(DIR) \
|
env -u DH_OPTIONS dh_install -pliblockdep$(VERSION) --sourcedir=$(DIR) \
|
||||||
'usr/lib/*/liblockdep.so.*'
|
'usr/lib/*/liblockdep.so.*'
|
||||||
dh_install --sourcedir=$(DIR)
|
dh_install --sourcedir=$(DIR)
|
||||||
|
|
Loading…
Reference in New Issue