[linux-tools] 02/02: Move makefile hierarchy to debian/rules.d; use debian/build for output only

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Feb 19 20:26:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux-tools.

commit 00337468627cb9042d6f87524c66ccd19869e75a
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Fri Feb 19 20:05:58 2016 +0000

    Move makefile hierarchy to debian/rules.d; use debian/build for output only
    
    By passing both -C and -f options to make, we can separate makefiles
    from the output directory without adding prefixes to all targets.
    
    We can also reduce the 'clean' commands to little more than 'rm -rf'.
---
 debian/.gitignore                                  |  1 +
 debian/build/.gitignore                            |  3 ---
 debian/build/scripts/.gitignore                    |  7 -------
 debian/build/scripts/basic/.gitignore              |  2 --
 debian/build/scripts/basic/Makefile                |  5 -----
 debian/build/scripts/genksyms/.gitignore           |  1 -
 debian/build/scripts/kconfig/.gitignore            |  1 -
 debian/build/scripts/mod/.gitignore                |  4 ----
 debian/build/scripts/mod/Makefile                  | 22 ----------------------
 debian/build/tools/hv/.gitignore                   |  1 -
 debian/rules                                       |  5 +++--
 debian/{build => rules.d}/Makefile                 |  7 ++-----
 debian/{build => rules.d}/Makefile.inc             | 11 +++--------
 debian/{build => rules.d}/scripts/Makefile         |  2 +-
 debian/rules.d/scripts/basic/Makefile              |  5 +++++
 .../{build => rules.d}/scripts/genksyms/Makefile   |  5 +----
 debian/{build => rules.d}/scripts/kconfig/Makefile |  5 +----
 debian/rules.d/scripts/mod/Makefile                | 22 ++++++++++++++++++++++
 .../{build => rules.d}/scripts/mod/Makefile.real   | 10 ++++++----
 debian/{build => rules.d}/scripts/mod/elfconfig.h  |  0
 debian/{build => rules.d}/scripts/mod/gendef.py    |  0
 debian/{build => rules.d}/scripts/mod/modpost.c    |  2 +-
 .../scripts/mod/real-lsb-32/elfconfig.h            |  0
 .../scripts/mod/real-lsb-32/types.h                |  0
 .../scripts/mod/real-lsb-64/elfconfig.h            |  0
 .../scripts/mod/real-lsb-64/types.h                |  0
 .../scripts/mod/real-msb-32/elfconfig.h            |  0
 .../scripts/mod/real-msb-32/types.h                |  0
 .../scripts/mod/real-msb-64/elfconfig.h            |  0
 .../scripts/mod/real-msb-64/types.h                |  0
 debian/{build => rules.d}/scripts/mod/types.h      |  0
 debian/{build => rules.d}/tools/Makefile           |  2 +-
 debian/{build => rules.d}/tools/hv/Makefile        |  2 +-
 .../{build => rules.d}/tools/lib/lockdep/Makefile  |  8 ++------
 .../tools/lib/lockdep/lockdep.in                   |  0
 debian/{build => rules.d}/tools/perf/Makefile      | 22 +++++++---------------
 debian/{build => rules.d}/tools/usb/usbip/Makefile |  7 ++-----
 debian/rules.real                                  |  6 +++---
 38 files changed, 62 insertions(+), 106 deletions(-)

diff --git a/debian/.gitignore b/debian/.gitignore
index 78c2912..6c99239 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -8,6 +8,7 @@
 .#*
 /*.substvars
 /*-tmp/
+/build/
 /control
 /control.md5sum
 /files
diff --git a/debian/build/.gitignore b/debian/build/.gitignore
deleted file mode 100644
index 8180498..0000000
--- a/debian/build/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.o
-/include/
-out/
diff --git a/debian/build/scripts/.gitignore b/debian/build/scripts/.gitignore
deleted file mode 100644
index 663e607..0000000
--- a/debian/build/scripts/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.hash.c
-*.lex.c
-*.tab.[ch]
-/conmakehash
-/kallsyms
-/pnmtologo
-/recordmcount
diff --git a/debian/build/scripts/basic/.gitignore b/debian/build/scripts/basic/.gitignore
deleted file mode 100644
index e717ebb..0000000
--- a/debian/build/scripts/basic/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/bin2c
-/fixdep
diff --git a/debian/build/scripts/basic/Makefile b/debian/build/scripts/basic/Makefile
deleted file mode 100644
index 6a801c3..0000000
--- a/debian/build/scripts/basic/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-PROGS = \
-	bin2c \
-	fixdep
-
-include ../../Makefile.inc
diff --git a/debian/build/scripts/genksyms/.gitignore b/debian/build/scripts/genksyms/.gitignore
deleted file mode 100644
index 34a2a05..0000000
--- a/debian/build/scripts/genksyms/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/genksyms
diff --git a/debian/build/scripts/kconfig/.gitignore b/debian/build/scripts/kconfig/.gitignore
deleted file mode 100644
index c9a5c23..0000000
--- a/debian/build/scripts/kconfig/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/conf
diff --git a/debian/build/scripts/mod/.gitignore b/debian/build/scripts/mod/.gitignore
deleted file mode 100644
index c0602d2..0000000
--- a/debian/build/scripts/mod/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/modpost
-/modpost.h
-/modpost.real-*
-devicetable-offsets.[hs]
diff --git a/debian/build/scripts/mod/Makefile b/debian/build/scripts/mod/Makefile
deleted file mode 100644
index be0e2aa..0000000
--- a/debian/build/scripts/mod/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-PROGS = \
-	modpost \
-	modpost.real-lsb-32 \
-	modpost.real-lsb-64 \
-	modpost.real-msb-32 \
-	modpost.real-msb-64
-
-include ../../Makefile.inc
-
-modpost.real-%:
-	$(MAKE) -f Makefile.real TYPE=$* SOURCEDIR=$(top_srcdir)/scripts/mod
-
-%: %.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
-
-modpost.h: $(top_srcdir)/scripts/mod/modpost.c
-	python ./gendef.py $< > $@
-
-modpost.o: modpost.c modpost.h
-
-clean:
-	rm -f modpost.h real-*/devicetable-offsets.*
diff --git a/debian/build/tools/hv/.gitignore b/debian/build/tools/hv/.gitignore
deleted file mode 100644
index b6961eb..0000000
--- a/debian/build/tools/hv/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/hv_*_daemon
diff --git a/debian/rules b/debian/rules
index f6e5233..44e36f4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -40,8 +40,9 @@ maintainerclean:
 
 clean: debian/control
 	dh_testdir
-	$(MAKE) -C $(BUILD_DIR) clean top_srcdir=$(CURDIR) OUTDIR=.
-	rm -rf $(STAMPS_DIR) debian/lib/python/debian_linux/__pycache__ debian/*-tmp
+	mkdir -p $(BUILD_DIR)
+	$(MAKE) -C $(BUILD_DIR) -f $(CURDIR)/debian/rules.d/Makefile top_srcdir=$(CURDIR) top_rulesdir=$(CURDIR)/debian/rules.d OUTDIR=. clean
+	rm -rf $(STAMPS_DIR) $(BUILD_DIR) debian/lib/python/debian_linux/__pycache__ debian/*-tmp
 	dh_clean
 
 binary-indep:
diff --git a/debian/build/Makefile b/debian/rules.d/Makefile
similarity index 63%
rename from debian/build/Makefile
rename to debian/rules.d/Makefile
index a83996d..b03a795 100644
--- a/debian/build/Makefile
+++ b/debian/rules.d/Makefile
@@ -6,14 +6,11 @@ SUBDIRS = \
 	scripts \
 	tools
 
-include Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 # Build userland headers first
 unexport VERSION
 all-local:
-	$(MAKE) -C $(top_srcdir) O=$(CURDIR)/out \
+	$(MAKE) -C $(top_srcdir) O=$(CURDIR) \
 		INSTALL_HDR_PATH=$(CURDIR) headers_install
 all-recursive: all-local
-
-clean-local::
-	rm -rf generated include out
diff --git a/debian/build/Makefile.inc b/debian/rules.d/Makefile.inc
similarity index 88%
rename from debian/build/Makefile.inc
rename to debian/rules.d/Makefile.inc
index f7ca4d1..acdcf71 100644
--- a/debian/build/Makefile.inc
+++ b/debian/rules.d/Makefile.inc
@@ -1,5 +1,3 @@
-top_srcdir = $(dir $(lastword $(MAKEFILE_LIST)))/../..
-
 # Normalise OUTDIR to avoid triggering rebuilds
 override OUTDIR := $(patsubst ./%,%,$(OUTDIR))
 
@@ -17,22 +15,19 @@ CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -Wall
 LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
 
 all: all-local all-recursive
-clean: clean-local clean-recursive
+clean: clean-recursive
 install: install-local install-recursive
 
 %-recursive:
 	+ at list='$(SUBDIRS)'; \
 	for subdir in $$list; do \
 	  echo "Making $* in $$subdir"; \
-	  $(MAKE) -C $$subdir OUTDIR=$(OUTDIR)/$$subdir $* \
-	  || exit 1; \
+	  mkdir -p $$subdir; \
+	  $(MAKE) -C $$subdir -f $(top_rulesdir)/$(OUTDIR)/$$subdir/Makefile OUTDIR=$(OUTDIR)/$$subdir $*; \
 	done
 
 all-local: $(PROGS)
 
-clean-local::
-	rm -f $(PROGS) *.o
-
 install-local: install-local-progs install-local-scripts install-local-data
 
 install-local-progs: $(PROGS)
diff --git a/debian/build/scripts/Makefile b/debian/rules.d/scripts/Makefile
similarity index 95%
rename from debian/build/scripts/Makefile
rename to debian/rules.d/scripts/Makefile
index d62a40f..8d97087 100644
--- a/debian/build/scripts/Makefile
+++ b/debian/rules.d/scripts/Makefile
@@ -44,6 +44,6 @@ SUBDIRS = \
 	kconfig \
 	mod
 
-include ..//Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
diff --git a/debian/rules.d/scripts/basic/Makefile b/debian/rules.d/scripts/basic/Makefile
new file mode 100644
index 0000000..86b86a8
--- /dev/null
+++ b/debian/rules.d/scripts/basic/Makefile
@@ -0,0 +1,5 @@
+PROGS = \
+	bin2c \
+	fixdep
+
+include $(top_rulesdir)/Makefile.inc
diff --git a/debian/build/scripts/genksyms/Makefile b/debian/rules.d/scripts/genksyms/Makefile
similarity index 66%
rename from debian/build/scripts/genksyms/Makefile
rename to debian/rules.d/scripts/genksyms/Makefile
index 22e3163..8e416da 100644
--- a/debian/build/scripts/genksyms/Makefile
+++ b/debian/rules.d/scripts/genksyms/Makefile
@@ -1,6 +1,6 @@
 PROGS = genksyms
 
-include ../../Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 genksyms: genksyms.o parse.tab.o lex.lex.o
 
@@ -11,6 +11,3 @@ lex.lex.o: keywords.hash.c parse.tab.h
 
 %.h: %.h_shipped
 	ln -s $< $@
-
-clean:
-	rm -f keywords.hash.c parse.tab.c parse.tab.h
diff --git a/debian/build/scripts/kconfig/Makefile b/debian/rules.d/scripts/kconfig/Makefile
similarity index 64%
rename from debian/build/scripts/kconfig/Makefile
rename to debian/rules.d/scripts/kconfig/Makefile
index 52e4366..b6e2521 100644
--- a/debian/build/scripts/kconfig/Makefile
+++ b/debian/rules.d/scripts/kconfig/Makefile
@@ -1,6 +1,6 @@
 PROGS = conf
 
-include ../../Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 conf: conf.o zconf.tab.o
 
@@ -11,6 +11,3 @@ zconf.tab.c: zconf.hash.c zconf.lex.c
 
 %.h: %.h_shipped
 	ln -sf $< $@
-
-clean:
-	rm -f zconf.tab.c zconf.hash.c zconf.lex.c
diff --git a/debian/rules.d/scripts/mod/Makefile b/debian/rules.d/scripts/mod/Makefile
new file mode 100644
index 0000000..728afaa
--- /dev/null
+++ b/debian/rules.d/scripts/mod/Makefile
@@ -0,0 +1,22 @@
+PROGS = \
+	modpost \
+	modpost.real-lsb-32 \
+	modpost.real-lsb-64 \
+	modpost.real-msb-32 \
+	modpost.real-msb-64
+
+include $(top_rulesdir)/Makefile.inc
+
+wrapperdir = $(top_rulesdir)/$(OUTDIR)
+
+modpost.real-%:
+	$(MAKE) -f $(wrapperdir)/Makefile.real TYPE=$* SOURCEDIR=$(top_srcdir)/scripts/mod
+
+%: %.o
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+modpost-opts.h: $(top_srcdir)/scripts/mod/modpost.c
+	python $(wrapperdir)/gendef.py $< > $@
+
+modpost.o: $(wrapperdir)/modpost.c modpost-opts.h
+	$(CC) $(CFLAGS) -I $(CURDIR) -c -o $@ $<
diff --git a/debian/build/scripts/mod/Makefile.real b/debian/rules.d/scripts/mod/Makefile.real
similarity index 67%
rename from debian/build/scripts/mod/Makefile.real
rename to debian/rules.d/scripts/mod/Makefile.real
index 790dbf2..489ea4f 100644
--- a/debian/build/scripts/mod/Makefile.real
+++ b/debian/rules.d/scripts/mod/Makefile.real
@@ -1,17 +1,19 @@
 PROGS = modpost.real-$(TYPE)
 
-top_srcdir = ../..
+include $(top_rulesdir)/Makefile.inc
 
-include $(top_srcdir)/debian/build/Makefile.inc
+wrapperdir = $(top_rulesdir)/$(OUTDIR)
+CFLAGS += -I $(CURDIR)/real-$(TYPE) -I $(wrapperdir)/real-$(TYPE)
 
 modpost.real-$(TYPE): file2alias.real-$(TYPE).o modpost.real-$(TYPE).o sumversion.real-$(TYPE).o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
 %.real-$(TYPE).o: $(SOURCEDIR)/%.c real-$(TYPE)/devicetable-offsets.h
-	$(CC) -I real-$(TYPE) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) -c -o $@ $<
 
 real-$(TYPE)/devicetable-offsets.s: $(SOURCEDIR)/devicetable-offsets.c
-	$(CC) -include real-$(TYPE)/types.h $(CFLAGS) -nostdinc -I$(top_srcdir)/include -S -o $@ $<
+	mkdir -p real-$(TYPE)
+	$(CC) -include $(wrapperdir)/real-$(TYPE)/types.h $(CFLAGS) -nostdinc -I$(top_srcdir)/include -S -o $@ $<
 
 real-$(TYPE)/devicetable-offsets.h: real-$(TYPE)/devicetable-offsets.s
 	echo >$@ "#define __DEVICEVTABLE_OFFSETS_H__"
diff --git a/debian/build/scripts/mod/elfconfig.h b/debian/rules.d/scripts/mod/elfconfig.h
similarity index 100%
rename from debian/build/scripts/mod/elfconfig.h
rename to debian/rules.d/scripts/mod/elfconfig.h
diff --git a/debian/build/scripts/mod/gendef.py b/debian/rules.d/scripts/mod/gendef.py
similarity index 100%
rename from debian/build/scripts/mod/gendef.py
rename to debian/rules.d/scripts/mod/gendef.py
diff --git a/debian/build/scripts/mod/modpost.c b/debian/rules.d/scripts/mod/modpost.c
similarity index 99%
rename from debian/build/scripts/mod/modpost.c
rename to debian/rules.d/scripts/mod/modpost.c
index 8747c0c..d574957 100644
--- a/debian/build/scripts/mod/modpost.c
+++ b/debian/rules.d/scripts/mod/modpost.c
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "modpost.h"
+#include "modpost-opts.h"
 
 int main (int argc, char *argv[])
 {
diff --git a/debian/build/scripts/mod/real-lsb-32/elfconfig.h b/debian/rules.d/scripts/mod/real-lsb-32/elfconfig.h
similarity index 100%
rename from debian/build/scripts/mod/real-lsb-32/elfconfig.h
rename to debian/rules.d/scripts/mod/real-lsb-32/elfconfig.h
diff --git a/debian/build/scripts/mod/real-lsb-32/types.h b/debian/rules.d/scripts/mod/real-lsb-32/types.h
similarity index 100%
rename from debian/build/scripts/mod/real-lsb-32/types.h
rename to debian/rules.d/scripts/mod/real-lsb-32/types.h
diff --git a/debian/build/scripts/mod/real-lsb-64/elfconfig.h b/debian/rules.d/scripts/mod/real-lsb-64/elfconfig.h
similarity index 100%
rename from debian/build/scripts/mod/real-lsb-64/elfconfig.h
rename to debian/rules.d/scripts/mod/real-lsb-64/elfconfig.h
diff --git a/debian/build/scripts/mod/real-lsb-64/types.h b/debian/rules.d/scripts/mod/real-lsb-64/types.h
similarity index 100%
rename from debian/build/scripts/mod/real-lsb-64/types.h
rename to debian/rules.d/scripts/mod/real-lsb-64/types.h
diff --git a/debian/build/scripts/mod/real-msb-32/elfconfig.h b/debian/rules.d/scripts/mod/real-msb-32/elfconfig.h
similarity index 100%
rename from debian/build/scripts/mod/real-msb-32/elfconfig.h
rename to debian/rules.d/scripts/mod/real-msb-32/elfconfig.h
diff --git a/debian/build/scripts/mod/real-msb-32/types.h b/debian/rules.d/scripts/mod/real-msb-32/types.h
similarity index 100%
rename from debian/build/scripts/mod/real-msb-32/types.h
rename to debian/rules.d/scripts/mod/real-msb-32/types.h
diff --git a/debian/build/scripts/mod/real-msb-64/elfconfig.h b/debian/rules.d/scripts/mod/real-msb-64/elfconfig.h
similarity index 100%
rename from debian/build/scripts/mod/real-msb-64/elfconfig.h
rename to debian/rules.d/scripts/mod/real-msb-64/elfconfig.h
diff --git a/debian/build/scripts/mod/real-msb-64/types.h b/debian/rules.d/scripts/mod/real-msb-64/types.h
similarity index 100%
rename from debian/build/scripts/mod/real-msb-64/types.h
rename to debian/rules.d/scripts/mod/real-msb-64/types.h
diff --git a/debian/build/scripts/mod/types.h b/debian/rules.d/scripts/mod/types.h
similarity index 100%
rename from debian/build/scripts/mod/types.h
rename to debian/rules.d/scripts/mod/types.h
diff --git a/debian/build/tools/Makefile b/debian/rules.d/tools/Makefile
similarity index 58%
rename from debian/build/tools/Makefile
rename to debian/rules.d/tools/Makefile
index a3cdd87..e99cdca 100644
--- a/debian/build/tools/Makefile
+++ b/debian/rules.d/tools/Makefile
@@ -4,4 +4,4 @@ SUBDIRS = \
 	perf \
 	usb/usbip
 
-include ../Makefile.inc
+include $(top_rulesdir)/Makefile.inc
diff --git a/debian/build/tools/hv/Makefile b/debian/rules.d/tools/hv/Makefile
similarity index 87%
rename from debian/build/tools/hv/Makefile
rename to debian/rules.d/tools/hv/Makefile
index 7f89bbb..25af786 100644
--- a/debian/build/tools/hv/Makefile
+++ b/debian/rules.d/tools/hv/Makefile
@@ -5,7 +5,7 @@ PROGS = \
 
 prefix = /usr/sbin
 
-include ../../Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 install-local-progs: $(PROGS)
 	@for p in $^; do \
diff --git a/debian/build/tools/lib/lockdep/Makefile b/debian/rules.d/tools/lib/lockdep/Makefile
similarity index 78%
rename from debian/build/tools/lib/lockdep/Makefile
rename to debian/rules.d/tools/lib/lockdep/Makefile
index 7e2534e..c398020 100644
--- a/debian/build/tools/lib/lockdep/Makefile
+++ b/debian/rules.d/tools/lib/lockdep/Makefile
@@ -1,8 +1,8 @@
-include ../../../Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-MAKE_LOCKDEP := $(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR)/out V=1 \
+MAKE_LOCKDEP := $(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR) V=1 \
 	prefix=/usr libdir_relative=lib/$(DEB_HOST_MULTIARCH) \
 	LIBLOCKDEP_VERSION=$(VERSION) \
 	CONFIG_FLAGS='$(CFLAGS) $(filter -D%,$(CPPFLAGS))' LDFLAGS='$(LDFLAGS)'
@@ -10,7 +10,6 @@ MAKE_LOCKDEP := $(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR)/out V=1 \
 unexport CFLAGS
 
 all:
-	mkdir -p out
 	$(MAKE_LOCKDEP)
 
 install:
@@ -19,6 +18,3 @@ install:
 	cp -R $(top_srcdir)/$(OUTDIR)/include/liblockdep $(DESTDIR)/usr/include/
 	ln -s liblockdep.so.$(VERSION) \
 		$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/liblockdep.so
-
-clean:
-	rm -rf out
diff --git a/debian/build/tools/lib/lockdep/lockdep.in b/debian/rules.d/tools/lib/lockdep/lockdep.in
similarity index 100%
rename from debian/build/tools/lib/lockdep/lockdep.in
rename to debian/rules.d/tools/lib/lockdep/lockdep.in
diff --git a/debian/build/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile
similarity index 75%
rename from debian/build/tools/perf/Makefile
rename to debian/rules.d/tools/perf/Makefile
index e20b6b3..0d97497 100644
--- a/debian/build/tools/perf/Makefile
+++ b/debian/rules.d/tools/perf/Makefile
@@ -1,4 +1,4 @@
-include ../../Makefile.inc
+include $(top_rulesdir)/Makefile.inc
 
 DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 
@@ -27,7 +27,7 @@ else ifneq ($(filter amd64 i386,$(DEB_HOST_ARCH_CPU)),)
   endif
 endif
 
-MAKE_PERF := $(MAKE) prefix=/usr V=1 ARCH=$(KERNEL_ARCH_PERF) EXTRA_WARNINGS=-Wno-error EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
+MAKE_PERF := $(MAKE) O=$(CURDIR) prefix=/usr V=1 ARCH=$(KERNEL_ARCH_PERF) EXTRA_WARNINGS=-Wno-error EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
 
 # Disable Gtk UI until it's more usable
 MAKE_PERF += NO_GTK2=1
@@ -43,22 +43,21 @@ MAKE_PERF += feature-libbfd=0 HAVE_CPLUS_DEMANGLE_SUPPORT=1
 
 all:
 ifdef KERNEL_ARCH_PERF
-	-mkdir out
 # perf changes some default directories depending on whether DESTDIR is
 # set.  We must define it even when building to avoid a rebuild when we
 # run 'make install'.
-	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf O=$(CURDIR)/out all VERSION=$(VERSION) DESTDIR=dummy
-	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf/Documentation O=$(CURDIR)/out man VERSION=$(VERSION)
+	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf all VERSION=$(VERSION) DESTDIR=dummy
+	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf/Documentation man VERSION=$(VERSION)
 # Check that perf didn't get linked against libbfd
 	type ldd
-	! ldd $(CURDIR)/out/perf | grep '\blibbfd'
+	! ldd $(CURDIR)/perf | grep '\blibbfd'
 # Check that it includes cplus_demangle from libiberty
-	grep cplus_demangle $(CURDIR)/out/perf
+	grep cplus_demangle $(CURDIR)/perf
 endif
 
 install:
 ifdef KERNEL_ARCH_PERF
-	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf O=$(CURDIR)/out install VERSION=$(VERSION)
+	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf install VERSION=$(VERSION)
 # Don't install a 'trace' alias yet:
 # - We need a wrapper for it anyway, so there's little point adding a
 #   versioned link
@@ -71,10 +70,3 @@ endif
 	mv $(DESTDIR)/etc/bash_completion.d \
 		$(DESTDIR)/usr/share/bash-completion/completions
 	rmdir --ignore-fail-on-non-empty $(DESTDIR)/etc
-
-clean:
-ifdef KERNEL_ARCH_PERF
-	mkdir -p out
-	+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf O=$(CURDIR)/out clean
-	rm -rf out
-endif
diff --git a/debian/build/tools/usb/usbip/Makefile b/debian/rules.d/tools/usb/usbip/Makefile
similarity index 88%
rename from debian/build/tools/usb/usbip/Makefile
rename to debian/rules.d/tools/usb/usbip/Makefile
index 75e5705..11d1db4 100644
--- a/debian/build/tools/usb/usbip/Makefile
+++ b/debian/rules.d/tools/usb/usbip/Makefile
@@ -7,19 +7,16 @@ unexport MAKEFLAGS
 
 all:
 	cd $(srcdir) && ./autogen.sh
-	mkdir -p out
-	cd out && \
 	$(shell dpkg-buildflags --export=cmdline) $(srcdir)/configure \
 		--prefix=/usr \
 		--with-tcp-wrappers \
 		--with-usbids-dir=/usr/share/misc \
 		--disable-shared
-	$(MAKE) -C out
+	$(MAKE)
 
 install:
-	$(MAKE) -C out install
+	$(MAKE) install
 
 clean:
 	rm -rf $(addprefix $(srcdir)/,autom4te.cache aclocal.m4 compile config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh missing)
 	find $(srcdir)/ -name Makefile.in -delete
-	rm -rf out
diff --git a/debian/rules.real b/debian/rules.real
index 4294a84..34b0ebc 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -4,7 +4,7 @@ export KBUILD_BUILD_TIMESTAMP := $(shell dpkg-parsechangelog | sed -ne 's,^Date:
 include debian/rules.defs
 
 define submake
-+$(MAKE) -C $(BUILD_DIR)/$(1) top_srcdir=$(CURDIR) OUTDIR=$(1)
++mkdir -p $(BUILD_DIR)/$(1) && $(MAKE) -C $(BUILD_DIR)/$(1) -f $(CURDIR)/debian/rules.d/$(1)/Makefile top_srcdir=$(CURDIR) top_rulesdir=$(CURDIR)/debian/rules.d OUTDIR=$(1)
 endef
 
 binary-arch: install-kbuild install-usbip install-liblockdep
@@ -70,7 +70,7 @@ 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/out/config.h)
+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
 	dh_testdir
 	dh_testroot
@@ -145,7 +145,7 @@ install-lockdep:
 	dh_prep
 	dh_installdirs
 # Upstream lockdep preload script is not suitable for installation
-	sed 's/@VERSION@/$(VERSION)/' $(BUILD_DIR)/tools/lib/lockdep/lockdep.in \
+	sed 's/@VERSION@/$(VERSION)/' debian/rules.d/tools/lib/lockdep/lockdep.in \
 		> $(DIR)/usr/bin/lockdep
 	chmod 755 $(DIR)/usr/bin/lockdep
 	dh_installchangelogs

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux-tools.git



More information about the Kernel-svn-changes mailing list