From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752528AbbLNPiS (ORCPT ); Mon, 14 Dec 2015 10:38:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbbLNPiR (ORCPT ); Mon, 14 Dec 2015 10:38:17 -0500 Date: Mon, 14 Dec 2015 09:38:15 -0600 From: Josh Poimboeuf To: Jiri Olsa Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Namhyung Kim Subject: Re: [PATCH v3.1 02/17] tools build: Fix feature Makefile dependencies for 'O=' Message-ID: <20151214153815.GC11552@treble.redhat.com> References: <20151214100851.GD27640@krava.brq.redhat.com> <20151214140250.GA30746@treble.redhat.com> <20151214142907.GE30746@treble.redhat.com> <20151214152939.GC21388@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151214152939.GC21388@krava.brq.redhat.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2015 at 04:29:39PM +0100, Jiri Olsa wrote: > On Mon, Dec 14, 2015 at 08:29:07AM -0600, Josh Poimboeuf wrote: > > Signed-off-by: Josh Poimboeuf > > you might want to work on your changelogs > a little.. aaand actually include some ;-) Well, I thought the subject said it all :-) > did you update your branch with this change? Sure, see branch 'perf-subcmd-v3.1': https://github.com/jpoimboe/linux > > jirka > > > --- > > tools/build/Makefile.feature | 2 +- > > tools/build/feature/Makefile | 93 ++++++++++++++++++++++---------------------- > > 2 files changed, 48 insertions(+), 47 deletions(-) > > > > diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature > > index b8c31ec..6c0519d 100644 > > --- a/tools/build/Makefile.feature > > +++ b/tools/build/Makefile.feature > > @@ -7,7 +7,7 @@ endif > > > > feature_check = $(eval $(feature_check_code)) > > define feature_check_code > > - feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0) > > + feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0) > > endef > > > > feature_set = $(eval $(feature_set_code)) > > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile > > index cea04ce9..bf8f035 100644 > > --- a/tools/build/feature/Makefile > > +++ b/tools/build/feature/Makefile > > @@ -1,4 +1,3 @@ > > - > > FILES= \ > > test-all.bin \ > > test-backtrace.bin \ > > @@ -38,38 +37,40 @@ FILES= \ > > test-bpf.bin \ > > test-get_cpuid.bin > > > > +FILES := $(addprefix $(OUTPUT),$(FILES)) > > + > > CC := $(CROSS_COMPILE)gcc -MD > > PKG_CONFIG := $(CROSS_COMPILE)pkg-config > > > > all: $(FILES) > > > > -__BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS) > > - BUILD = $(__BUILD) > $(OUTPUT)$(@:.bin=.make.output) 2>&1 > > +__BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS) > > + BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1 > > > > ############################### > > > > -test-all.bin: > > +$(OUTPUT)test-all.bin: > > $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma > > > > -test-hello.bin: > > +$(OUTPUT)test-hello.bin: > > $(BUILD) > > > > -test-pthread-attr-setaffinity-np.bin: > > +$(OUTPUT)test-pthread-attr-setaffinity-np.bin: > > $(BUILD) -D_GNU_SOURCE -lpthread > > > > -test-stackprotector-all.bin: > > +$(OUTPUT)test-stackprotector-all.bin: > > $(BUILD) -fstack-protector-all > > > > -test-fortify-source.bin: > > +$(OUTPUT)test-fortify-source.bin: > > $(BUILD) -O2 -D_FORTIFY_SOURCE=2 > > > > -test-bionic.bin: > > +$(OUTPUT)test-bionic.bin: > > $(BUILD) > > > > -test-libelf.bin: > > +$(OUTPUT)test-libelf.bin: > > $(BUILD) -lelf > > > > -test-glibc.bin: > > +$(OUTPUT)test-glibc.bin: > > $(BUILD) > > > > DWARFLIBS := -ldw > > @@ -77,37 +78,37 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) > > DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 > > endif > > > > -test-dwarf.bin: > > +$(OUTPUT)test-dwarf.bin: > > $(BUILD) $(DWARFLIBS) > > > > -test-libelf-mmap.bin: > > +$(OUTPUT)test-libelf-mmap.bin: > > $(BUILD) -lelf > > > > -test-libelf-getphdrnum.bin: > > +$(OUTPUT)test-libelf-getphdrnum.bin: > > $(BUILD) -lelf > > > > -test-libnuma.bin: > > +$(OUTPUT)test-libnuma.bin: > > $(BUILD) -lnuma > > > > -test-numa_num_possible_cpus.bin: > > +$(OUTPUT)test-numa_num_possible_cpus.bin: > > $(BUILD) -lnuma > > > > -test-libunwind.bin: > > +$(OUTPUT)test-libunwind.bin: > > $(BUILD) -lelf > > > > -test-libunwind-debug-frame.bin: > > +$(OUTPUT)test-libunwind-debug-frame.bin: > > $(BUILD) -lelf > > > > -test-libaudit.bin: > > +$(OUTPUT)test-libaudit.bin: > > $(BUILD) -laudit > > > > -test-libslang.bin: > > +$(OUTPUT)test-libslang.bin: > > $(BUILD) -I/usr/include/slang -lslang > > > > -test-gtk2.bin: > > +$(OUTPUT)test-gtk2.bin: > > $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) > > > > -test-gtk2-infobar.bin: > > +$(OUTPUT)test-gtk2-infobar.bin: > > $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) > > > > grep-libs = $(filter -l%,$(1)) > > @@ -119,63 +120,63 @@ PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) > > PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` > > FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) > > > > -test-libperl.bin: > > +$(OUTPUT)test-libperl.bin: > > $(BUILD) $(FLAGS_PERL_EMBED) > > > > -test-libpython.bin: > > +$(OUTPUT)test-libpython.bin: > > $(BUILD) > > > > -test-libpython-version.bin: > > +$(OUTPUT)test-libpython-version.bin: > > $(BUILD) > > > > -test-libbfd.bin: > > +$(OUTPUT)test-libbfd.bin: > > $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl > > > > -test-liberty.bin: > > - $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty > > +$(OUTPUT)test-liberty.bin: > > + $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty > > > > -test-liberty-z.bin: > > - $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz > > +$(OUTPUT)test-liberty-z.bin: > > + $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz > > > > -test-cplus-demangle.bin: > > +$(OUTPUT)test-cplus-demangle.bin: > > $(BUILD) -liberty > > > > -test-backtrace.bin: > > +$(OUTPUT)test-backtrace.bin: > > $(BUILD) > > > > -test-timerfd.bin: > > +$(OUTPUT)test-timerfd.bin: > > $(BUILD) > > > > -test-libdw-dwarf-unwind.bin: > > +$(OUTPUT)test-libdw-dwarf-unwind.bin: > > $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind) > > > > -test-libbabeltrace.bin: > > +$(OUTPUT)test-libbabeltrace.bin: > > $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace) > > > > -test-sync-compare-and-swap.bin: > > +$(OUTPUT)test-sync-compare-and-swap.bin: > > $(BUILD) > > > > -test-compile-32.bin: > > - $(CC) -m32 -o $(OUTPUT)$@ test-compile.c > > +$(OUTPUT)test-compile-32.bin: > > + $(CC) -m32 -o $@ test-compile.c > > > > -test-compile-x32.bin: > > - $(CC) -mx32 -o $(OUTPUT)$@ test-compile.c > > +$(OUTPUT)test-compile-x32.bin: > > + $(CC) -mx32 -o $@ test-compile.c > > > > -test-zlib.bin: > > +$(OUTPUT)test-zlib.bin: > > $(BUILD) -lz > > > > -test-lzma.bin: > > +$(OUTPUT)test-lzma.bin: > > $(BUILD) -llzma > > > > -test-get_cpuid.bin: > > +$(OUTPUT)test-get_cpuid.bin: > > $(BUILD) > > > > -test-bpf.bin: > > +$(OUTPUT)test-bpf.bin: > > $(BUILD) > > > > --include *.d > > +-include $(OUTPUT)*.d > > > > ############################### > > > > clean: > > - rm -f $(FILES) *.d $(FILES:.bin=.make.output) > > + rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output) > > -- > > 2.4.3 > > -- Josh