Clean up tools build rules

* Rename the make macro from submake to make-tools
* Rename debian/stamps/build to debian/stamps/build-tools
* Build them all under debian/build/build-tools/
This commit is contained in:
Ben Hutchings 2016-03-21 01:42:24 +00:00
parent a5f7516c0c
commit 1138bda5ff
2 changed files with 19 additions and 18 deletions

View File

@ -9,8 +9,9 @@ CC = gcc
CXX = g++
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) \
-I$(top_srcdir)/$(OUTDIR) -I$(top_srcdir)/debian/build/$(OUTDIR) \
-isystem $(top_srcdir)/debian/build/include
-I$(top_srcdir)/$(OUTDIR) \
-I$(top_srcdir)/debian/build/build-tools/$(OUTDIR) \
-isystem $(top_srcdir)/debian/build/build-tools/include
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -Wall
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

32
debian/rules.real vendored
View File

@ -479,23 +479,23 @@ install-source: $(BUILD_DIR)/$(SOURCE_PACKAGE_NAME)-source-$(UPSTREAMVERSION).ta
# other things (#725492). So use the fastest real gzip mode.
+$(MAKE_SELF) install-base BUILDDEB_ARGS='-Zgzip -z1'
define submake
+mkdir -p $(BUILD_DIR)/$(1) && $(MAKE_CLEAN) -C $(BUILD_DIR)/$(1) -f $(CURDIR)/debian/rules.d/$(1)/Makefile top_srcdir=$(CURDIR) top_rulesdir=$(CURDIR)/debian/rules.d OUTDIR=$(1)
define make-tools
+mkdir -p $(BUILD_DIR)/build-tools/$(1) && $(MAKE_CLEAN) -C $(BUILD_DIR)/build-tools/$(1) -f $(CURDIR)/debian/rules.d/$(1)/Makefile top_srcdir=$(CURDIR) top_rulesdir=$(CURDIR)/debian/rules.d OUTDIR=$(1)
endef
$(STAMPS_DIR)/build-tools:
$(call submake,.)
$(call make-tools,.)
@$(stamp)
install-kbuild: PACKAGE_NAME = linux-kbuild-$(VERSION)
install-kbuild: DH_OPTIONS = -p$(PACKAGE_NAME)
install-kbuild: PREFIX_DIR = /usr/lib/$(PACKAGE_NAME)
install-kbuild: DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
install-kbuild: $(STAMPS_DIR)/build
install-kbuild: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call submake,scripts) install DESTDIR=$(DIR) prefix=$(PREFIX_DIR)
$(call make-tools,scripts) install DESTDIR=$(DIR) prefix=$(PREFIX_DIR)
dh_link $(PREFIX_DIR) /usr/src/$(PACKAGE_NAME)
dh_installchangelogs
dh_installdocs
@ -510,11 +510,11 @@ install-kbuild: $(STAMPS_DIR)/build
install-cpupower: DH_OPTIONS = -plinux-cpupower -plibcpupower0 -plibcpupower-dev
install-cpupower: DIR = $(CURDIR)/debian/cpupower-tmp
install-cpupower: $(STAMPS_DIR)/build
install-cpupower: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call submake,tools/power/cpupower) install DESTDIR=$(DIR)
$(call make-tools,tools/power/cpupower) install DESTDIR=$(DIR)
dh_install --sourcedir=$(DIR)
dh_installchangelogs
dh_installdocs
@ -531,11 +531,11 @@ install-cpupower: $(STAMPS_DIR)/build
install-perf: PACKAGE_NAME = linux-perf-$(VERSION)
install-perf: DH_OPTIONS = -p$(PACKAGE_NAME)
install-perf: DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
install-perf: $(STAMPS_DIR)/build
install-perf: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call submake,tools/perf) install DESTDIR=$(DIR)
$(call make-tools,tools/perf) install DESTDIR=$(DIR)
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_installchangelogs
@ -552,12 +552,12 @@ install-perf: $(STAMPS_DIR)/build
install-usbip: DH_OPTIONS = -plibusbip-dev -pusbip
install-usbip: DIR = $(CURDIR)/debian/usbip-tmp
install-usbip: override VERSION := $(shell sed -ne 's,^#define PACKAGE_VERSION "\(.*\)"$$,\1,p' $(BUILD_DIR)/tools/usb/usbip/config.h)
install-usbip: $(STAMPS_DIR)/build
install-usbip: override VERSION := $(shell sed -ne 's,^#define PACKAGE_VERSION "\(.*\)"$$,\1,p' $(BUILD_DIR)/build-tools/tools/usb/usbip/config.h)
install-usbip: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call submake,tools/usb/usbip) install DESTDIR=$(DIR)
$(call make-tools,tools/usb/usbip) install DESTDIR=$(DIR)
dh_install --sourcedir=$(DIR)
dh_installchangelogs
dh_installdocs
@ -575,11 +575,11 @@ install-usbip: $(STAMPS_DIR)/build
install-hyperv-daemons: PACKAGE_NAME = hyperv-daemons
install-hyperv-daemons: DH_OPTIONS = -p$(PACKAGE_NAME)
install-hyperv-daemons: DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
install-hyperv-daemons: $(STAMPS_DIR)/build
install-hyperv-daemons: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call submake,tools/hv) install DESTDIR=$(DIR)
$(call make-tools,tools/hv) install DESTDIR=$(DIR)
dh_install
for service in fcopy kvp vss; do \
install -D -m755 debian/hyperv-daemons.hv-$$service-daemon.init \
@ -607,11 +607,11 @@ install-hyperv-daemons: $(STAMPS_DIR)/build
install-liblockdep: DH_OPTIONS = -pliblockdep$(VERSION) -pliblockdep-dev
install-liblockdep: DIR = $(CURDIR)/debian/liblockdep-tmp
install-liblockdep: $(STAMPS_DIR)/build
install-liblockdep: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call submake,tools/lib/lockdep) install DESTDIR=$(DIR)
$(call make-tools,tools/lib/lockdep) install DESTDIR=$(DIR)
env -u DH_OPTIONS dh_install -pliblockdep$(VERSION) --sourcedir=$(DIR) \
'usr/lib/*/liblockdep.so.*'
dh_install --sourcedir=$(DIR)