linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] tools build: Fix header removal build issue
@ 2015-09-23 10:33 Jiri Olsa
  2015-09-23 10:33 ` [PATCH 1/7] tools build: Add Makefile.include Jiri Olsa
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Kai Germaschewski, lkml, David Ahern, Ingo Molnar, Namhyung Kim,
	Peter Zijlstra

hi,
for dependency tracking we currently use targets that fall out
of the gcc -MD command. We store this info in the .cmd file and
include as makefile during the build.

This format put object as target and all the c and header files
as dependencies, like:

  util/abspath.o: util/abspath.c /usr/include/stdc-predef.h util/cache.h \
   /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
   ...

If any of those dependency header files (krava.h below) is removed
the build fails on:

  make[1]: *** No rule to make target 'krava.h', needed by 'inc.o'.  Stop.

This patch adds fixdep helper, that is used by kbuild
to alter the shape of the object dependencies like:

  source_util/abspath.o := util/abspath.c

  deps_util/abspath.o := \
    /usr/include/stdc-predef.h \
    util/cache.h \
    ...

  util/abspath.o: $(deps_util/abspath.o)

  $(deps_util/abspath.o):

With this format the header removal won't make the build fail, because
it'll be picked up by the last empty target defined for each header.


thanks,
jirka


Cc: Kai Germaschewski <kai.germaschewski@gmx.de>
---
Jiri Olsa (7):
      tools build: Add Makefile.include
      tools build: Add test for missing include
      tools build: Add fixdep dependency helper
      tools build: Move dependency copy into function
      tools build: Make fixdep helper part of the build process
      perf tools: Rename single_dep target to prepare
      tools build: Build fixdep helper from perf and basic libs

 tools/build/Build                   |   1 +
 tools/build/Build.include           |  17 +++++++++---
 tools/build/Documentation/Build.txt |  52 +++++++++++++++++++++++++++---------
 tools/build/Makefile                |  43 ++++++++++++++++++++++++++++++
 tools/build/Makefile.build          |   7 +++++
 tools/build/Makefile.include        |   6 +++++
 tools/build/fixdep.c                | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/build/tests/ex/Build          |   1 +
 tools/build/tests/ex/Makefile       |  13 +++++----
 tools/build/tests/ex/ex.c           |   2 ++
 tools/build/tests/ex/inc.c          |   8 ++++++
 tools/build/tests/run.sh            |  27 +++++++++++++++++++
 tools/lib/api/Makefile              |   6 +++--
 tools/lib/bpf/Makefile              |   6 +++--
 tools/lib/lockdep/Makefile          |   6 +++--
 tools/perf/Makefile.perf            |  32 +++++++++++-----------
 16 files changed, 352 insertions(+), 43 deletions(-)
 create mode 100644 tools/build/Build
 create mode 100644 tools/build/Makefile
 create mode 100644 tools/build/Makefile.include
 create mode 100644 tools/build/fixdep.c
 create mode 100644 tools/build/tests/ex/inc.c

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/7] tools build: Add Makefile.include
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
@ 2015-09-23 10:33 ` Jiri Olsa
  2015-09-29  8:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-09-23 10:33 ` [PATCH 2/7] tools build: Add test for missing include Jiri Olsa
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

To ease up build framework code setup for users. More
shared code will be added in following patches.

Link: http://lkml.kernel.org/n/tip-p4hlxa0qh5ffkidq5e8jfne7@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Documentation/Build.txt | 45 ++++++++++++++++++++++++++-----------
 tools/build/Makefile.include        |  1 +
 tools/build/tests/ex/Makefile       |  3 ++-
 tools/lib/api/Makefile              |  2 +-
 tools/lib/bpf/Makefile              |  2 +-
 tools/lib/lockdep/Makefile          |  2 +-
 tools/perf/Makefile.perf            |  2 +-
 7 files changed, 39 insertions(+), 18 deletions(-)
 create mode 100644 tools/build/Makefile.include

diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index aa5e092c4352..88824359d595 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -11,8 +11,9 @@ Unlike the kernel we don't have a single build object 'obj-y' list that where
 we setup source objects, but we support more. This allows one 'Build' file to
 carry a sources list for multiple build objects.
 
-a) Build framework makefiles
-----------------------------
+
+Build framework makefiles
+-------------------------
 
 The build framework consists of 2 Makefiles:
 
@@ -23,7 +24,7 @@ While the 'Build.include' file contains just some generic definitions, the
 'Makefile.build' file is the makefile used from the outside. It's
 interface/usage is following:
 
-  $ make -f tools/build/Makefile srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
+  $ make -f tools/build/Makefile.build srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
 
 where:
 
@@ -38,8 +39,9 @@ called $(OBJECT)-in.o:
 
 which includes all compiled sources described in 'Build' makefiles.
 
-a) Build makefiles
-------------------
+
+Build makefiles
+---------------
 
 The user supplies 'Build' makefiles that contains a objects list, and connects
 the build to nested directories.
@@ -95,8 +97,24 @@ It's only a matter of 2 single commands to create the final binaries:
 
 You can check the 'ex' example in 'tools/build/tests/ex' for more details.
 
-b) Rules
---------
+
+Makefile.include
+----------------
+
+The tools/build/Makefile.include makefile could be included
+via user makefiles to get usefull definitions.
+
+It defines following interface:
+
+  - build macro definition:
+      build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+    to make it easier to invoke build like:
+      make $(build)=ex
+
+
+Rules
+-----
 
 The build framework provides standard compilation rules to handle .S and .c
 compilation.
@@ -104,8 +122,9 @@ compilation.
 It's possible to include special rule if needed (like we do for flex or bison
 code generation).
 
-c) CFLAGS
----------
+
+CFLAGS
+------
 
 It's possible to alter the standard object C flags in the following way:
 
@@ -115,8 +134,8 @@ It's possible to alter the standard object C flags in the following way:
 This C flags changes has the scope of the Build makefile they are defined in.
 
 
-d) Dependencies
----------------
+Dependencies
+------------
 
 For each built object file 'a.o' the '.a.cmd' is created and holds:
 
@@ -130,8 +149,8 @@ All existing '.cmd' files are included in the Build process to follow properly
 the dependencies and trigger a rebuild when necessary.
 
 
-e) Single rules
----------------
+Single rules
+------------
 
 It's possible to build single object file by choice, like:
 
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
new file mode 100644
index 000000000000..91bc60616de5
--- /dev/null
+++ b/tools/build/Makefile.include
@@ -0,0 +1 @@
+build := -f $(srctree)/tools/build/Makefile.build dir=. obj
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index 52d2476073a3..a8f596e37fd2 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -3,7 +3,8 @@ export CC      := gcc
 export LD      := ld
 export AR      := ar
 
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
+
 ex: ex-in.o libex-in.o
 	gcc -o $@ $^
 
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index fe1b02c2c95b..8806ea7c2f99 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -21,10 +21,10 @@ CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 
 RM = rm -f
 
-build  := -f $(srctree)/tools/build/Makefile.build dir=. obj
 API_IN := $(OUTPUT)libapi-in.o
 
 export srctree OUTPUT CC LD CFLAGS V
+include $(srctree)/tools/build/Makefile.include
 
 all: $(LIBFILE)
 
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index e630f9fc4fb6..c66ade68d4a1 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -124,7 +124,7 @@ endif
 MAKEOVERRIDES=
 
 export srctree OUTPUT CC LD CFLAGS V
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
 
 BPF_IN    := $(OUTPUT)libbpf-in.o
 LIB_FILE := $(addprefix $(OUTPUT),$(LIB_FILE))
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index 18ffccf00426..d12081da383b 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -94,7 +94,7 @@ else
 endif
 
 export srctree OUTPUT CC LD CFLAGS V
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
 
 do_compile_shared_library =			\
 	($(print_shared_lib_compile)		\
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 6c5c699002cb..6dec86665acc 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -297,7 +297,7 @@ strip: $(PROGRAMS) $(OUTPUT)perf
 PERF_IN := $(OUTPUT)perf-in.o
 
 export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
 
 $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
 	$(Q)$(MAKE) $(build)=perf
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/7] tools build: Add test for missing include
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
  2015-09-23 10:33 ` [PATCH 1/7] tools build: Add Makefile.include Jiri Olsa
@ 2015-09-23 10:33 ` Jiri Olsa
  2015-09-25 17:43   ` Arnaldo Carvalho de Melo
  2015-09-29  8:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-09-23 10:33 ` [PATCH 3/7] tools build: Add fixdep dependency helper Jiri Olsa
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

The current build framework fails to cope with header file
removal. The reason is the removed header file stays in the
.cmd file target rule and force the build to fail.

This issue is fixed and explained in following patches.

Adding new build test that simulates header removal.

Link: http://lkml.kernel.org/n/tip-580lv21jts6t9j15cosxggdc@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/tests/ex/Build    |  1 +
 tools/build/tests/ex/Makefile |  2 +-
 tools/build/tests/ex/ex.c     |  2 ++
 tools/build/tests/ex/inc.c    |  8 ++++++++
 tools/build/tests/run.sh      | 27 +++++++++++++++++++++++++++
 5 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 tools/build/tests/ex/inc.c

diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
index 429c7d452101..4d502f9b1a50 100644
--- a/tools/build/tests/ex/Build
+++ b/tools/build/tests/ex/Build
@@ -4,6 +4,7 @@ ex-y += b.o
 ex-y += b.o
 ex-y += empty/
 ex-y += empty2/
+ex-y += inc.o
 
 libex-y += c.o
 libex-y += d.o
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index a8f596e37fd2..f279b84cb859 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -1,4 +1,4 @@
-export srctree := ../../../..
+export srctree := $(abspath ../../../..)
 export CC      := gcc
 export LD      := ld
 export AR      := ar
diff --git a/tools/build/tests/ex/ex.c b/tools/build/tests/ex/ex.c
index dc42eb2e1a67..57de6074d252 100644
--- a/tools/build/tests/ex/ex.c
+++ b/tools/build/tests/ex/ex.c
@@ -5,6 +5,7 @@ int c(void);
 int d(void);
 int e(void);
 int f(void);
+int inc(void);
 
 int main(void)
 {
@@ -14,6 +15,7 @@ int main(void)
 	d();
 	e();
 	f();
+	inc();
 
 	return 0;
 }
diff --git a/tools/build/tests/ex/inc.c b/tools/build/tests/ex/inc.c
new file mode 100644
index 000000000000..c20f1e9033a3
--- /dev/null
+++ b/tools/build/tests/ex/inc.c
@@ -0,0 +1,8 @@
+#ifdef INCLUDE
+#include "krava.h"
+#endif
+
+int inc(void)
+{
+	return 0;
+}
diff --git a/tools/build/tests/run.sh b/tools/build/tests/run.sh
index 5494f8ea7567..44d2a0fade67 100755
--- a/tools/build/tests/run.sh
+++ b/tools/build/tests/run.sh
@@ -34,9 +34,36 @@ function test_ex_suffix {
 	make -C ex V=1 clean > /dev/null 2>&1
 	rm -f ex.out
 }
+
+function test_ex_include {
+	make -C ex V=1 clean > ex.out 2>&1
+
+	# build with krava.h include
+	touch ex/krava.h
+	make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1
+
+	if [ ! -x ./ex/ex ]; then
+	  echo FAILED
+	  exit -1
+	fi
+
+	# build without the include
+	rm -f ex/krava.h ex/ex
+	make -C ex V=1 >> ex.out 2>&1
+
+	if [ ! -x ./ex/ex ]; then
+	  echo FAILED
+	  exit -1
+	fi
+
+	make -C ex V=1 clean > /dev/null 2>&1
+	rm -f ex.out
+}
+
 echo -n Testing..
 
 test_ex
 test_ex_suffix
+test_ex_include
 
 echo OK
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/7] tools build: Add fixdep dependency helper
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
  2015-09-23 10:33 ` [PATCH 1/7] tools build: Add Makefile.include Jiri Olsa
  2015-09-23 10:33 ` [PATCH 2/7] tools build: Add test for missing include Jiri Olsa
@ 2015-09-23 10:33 ` Jiri Olsa
  2015-09-29  8:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-09-23 10:33 ` [PATCH 4/7] tools build: Move dependency copy into function Jiri Olsa
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Kai Germaschewski, lkml, David Ahern, Ingo Molnar, Namhyung Kim,
	Peter Zijlstra

For dependency tracking we currently use targets that fall out
of the gcc -MD command. We store this info in the .cmd file and
include as makefile during the build.

This format put object as target and all the c and header files
as dependencies, like:

  util/abspath.o: util/abspath.c /usr/include/stdc-predef.h util/cache.h \
   /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
   ...

If any of those dependency header files (krava.h below) is removed
the build fails on:

  make[1]: *** No rule to make target 'krava.h', needed by 'inc.o'.  Stop.

This patch adds fixdep helper, that is used by kbuild
to alter the shape of the object dependencies like:

  source_util/abspath.o := util/abspath.c

  deps_util/abspath.o := \
    /usr/include/stdc-predef.h \
    util/cache.h \
    ...

  util/abspath.o: $(deps_util/abspath.o)

  $(deps_util/abspath.o):

With this format the header removal won't make the build fail, because
it'll be picked up by the last empty target defined for each header.

As previously mentioned the fixdep tool is taken from kbuild. It's not
complete backport, only the part that alters the standard dependency
info was taken, the part that adds the CONFIG_* dependency logic will
be probably taken later on.

Cc: Kai Germaschewski <kai.germaschewski@gmx.de>
Link: http://lkml.kernel.org/n/tip-jxkd1k305kchf3pajvwz2pd1@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Build    |   1 +
 tools/build/Makefile |  43 +++++++++++++
 tools/build/fixdep.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 212 insertions(+)
 create mode 100644 tools/build/Build
 create mode 100644 tools/build/Makefile
 create mode 100644 tools/build/fixdep.c

diff --git a/tools/build/Build b/tools/build/Build
new file mode 100644
index 000000000000..63a6c34c0c88
--- /dev/null
+++ b/tools/build/Build
@@ -0,0 +1 @@
+fixdep-y := fixdep.o
diff --git a/tools/build/Makefile b/tools/build/Makefile
new file mode 100644
index 000000000000..a93036272d43
--- /dev/null
+++ b/tools/build/Makefile
@@ -0,0 +1,43 @@
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(shell pwd)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+endif
+
+include $(srctree)/tools//scripts/Makefile.include
+
+define allow-override
+  $(if $(or $(findstring environment,$(origin $(1))),\
+            $(findstring command line,$(origin $(1)))),,\
+    $(eval $(1) = $(2)))
+endef
+
+$(call allow-override,CC,$(CROSS_COMPILE)gcc)
+$(call allow-override,LD,$(CROSS_COMPILE)ld)
+
+ifeq ($(V),1)
+  Q =
+else
+  Q = @
+endif
+
+export Q srctree CC LD
+
+MAKEFLAGS := --no-print-directory
+build     := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+all: fixdep
+
+clean:
+	$(call QUIET_CLEAN, fixdep)
+	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
+	$(Q)rm -f fixdep
+
+$(OUTPUT)fixdep-in.o: FORCE
+	$(Q)$(MAKE) $(build)=fixdep
+
+$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $<
+
+FORCE:
+
+.PHONY: FORCE
diff --git a/tools/build/fixdep.c b/tools/build/fixdep.c
new file mode 100644
index 000000000000..1521d36cef0d
--- /dev/null
+++ b/tools/build/fixdep.c
@@ -0,0 +1,168 @@
+/*
+ * "Optimize" a list of dependencies as spit out by gcc -MD
+ * for the build framework.
+ *
+ * Original author:
+ *   Copyright    2002 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ *
+ * This code has been borrowed from kbuild's fixdep (scripts/basic/fixdep.c),
+ * Please check it for detailed explanation. This fixdep borow only the
+ * base transformation of dependecies without the CONFIG mangle.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+
+char *target;
+char *depfile;
+char *cmdline;
+
+static void usage(void)
+{
+	fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
+	exit(1);
+}
+
+/*
+ * Print out the commandline prefixed with cmd_<target filename> :=
+ */
+static void print_cmdline(void)
+{
+	printf("cmd_%s := %s\n\n", target, cmdline);
+}
+
+/*
+ * Important: The below generated source_foo.o and deps_foo.o variable
+ * assignments are parsed not only by make, but also by the rather simple
+ * parser in scripts/mod/sumversion.c.
+ */
+static void parse_dep_file(void *map, size_t len)
+{
+	char *m = map;
+	char *end = m + len;
+	char *p;
+	char s[PATH_MAX];
+	int is_target;
+	int saw_any_target = 0;
+	int is_first_dep = 0;
+
+	while (m < end) {
+		/* Skip any "white space" */
+		while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
+			m++;
+		/* Find next "white space" */
+		p = m;
+		while (p < end && *p != ' ' && *p != '\\' && *p != '\n')
+			p++;
+		/* Is the token we found a target name? */
+		is_target = (*(p-1) == ':');
+		/* Don't write any target names into the dependency file */
+		if (is_target) {
+			/* The /next/ file is the first dependency */
+			is_first_dep = 1;
+		} else {
+			/* Save this token/filename */
+			memcpy(s, m, p-m);
+			s[p - m] = 0;
+
+			/*
+			 * Do not list the source file as dependency,
+			 * so that kbuild is not confused if a .c file
+			 * is rewritten into .S or vice versa. Storing
+			 * it in source_* is needed for modpost to
+			 * compute srcversions.
+			 */
+			if (is_first_dep) {
+				/*
+				 * If processing the concatenation of
+				 * multiple dependency files, only
+				 * process the first target name, which
+				 * will be the original source name,
+				 * and ignore any other target names,
+				 * which will be intermediate temporary
+				 * files.
+				 */
+				if (!saw_any_target) {
+					saw_any_target = 1;
+					printf("source_%s := %s\n\n",
+						target, s);
+					printf("deps_%s := \\\n",
+						target);
+				}
+				is_first_dep = 0;
+			} else
+				printf("  %s \\\n", s);
+		}
+		/*
+		 * Start searching for next token immediately after the first
+		 * "whitespace" character that follows this token.
+		 */
+		m = p + 1;
+	}
+
+	if (!saw_any_target) {
+		fprintf(stderr, "fixdep: parse error; no targets found\n");
+		exit(1);
+	}
+
+	printf("\n%s: $(deps_%s)\n\n", target, target);
+	printf("$(deps_%s):\n", target);
+}
+
+static void print_deps(void)
+{
+	struct stat st;
+	int fd;
+	void *map;
+
+	fd = open(depfile, O_RDONLY);
+	if (fd < 0) {
+		fprintf(stderr, "fixdep: error opening depfile: ");
+		perror(depfile);
+		exit(2);
+	}
+	if (fstat(fd, &st) < 0) {
+		fprintf(stderr, "fixdep: error fstat'ing depfile: ");
+		perror(depfile);
+		exit(2);
+	}
+	if (st.st_size == 0) {
+		fprintf(stderr, "fixdep: %s is empty\n", depfile);
+		close(fd);
+		return;
+	}
+	map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+	if ((long) map == -1) {
+		perror("fixdep: mmap");
+		close(fd);
+		return;
+	}
+
+	parse_dep_file(map, st.st_size);
+
+	munmap(map, st.st_size);
+
+	close(fd);
+}
+
+int main(int argc, char **argv)
+{
+	if (argc != 4)
+		usage();
+
+	depfile = argv[1];
+	target  = argv[2];
+	cmdline = argv[3];
+
+	print_cmdline();
+	print_deps();
+
+	return 0;
+}
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/7] tools build: Move dependency copy into function
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
                   ` (2 preceding siblings ...)
  2015-09-23 10:33 ` [PATCH 3/7] tools build: Add fixdep dependency helper Jiri Olsa
@ 2015-09-23 10:33 ` Jiri Olsa
  2015-09-29  8:40   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-09-23 10:34 ` [PATCH 5/7] tools build: Make fixdep helper part of the build process Jiri Olsa
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

So it's easier to add more functionality in following commit.

Link: http://lkml.kernel.org/n/tip-zyle91hokwgwjpm6tjpx27k3@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Build.include | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/build/Build.include b/tools/build/Build.include
index 4c8daaccb82a..851c420098e7 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -55,14 +55,19 @@ make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1)))))
 any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
 
 ###
+# Copy dependency data into .cmd file
+#  - gcc -M dependency info
+#  - command line to create object 'cmd_object :='
+dep-cmd = cat $(depfile) >  $(dot-target).cmd; \
+          printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd
+
+###
 # if_changed_dep  - execute command if any prerequisite is newer than
 #                   target, or command line has changed and update
 #                   dependencies in the cmd file
 if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)),         \
 	@set -e;                                                   \
-	$(echo-cmd) $(cmd_$(1));                                   \
-	cat $(depfile) > $(dot-target).cmd;                        \
-	printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
+	$(echo-cmd) $(cmd_$(1)) && $(dep-cmd))
 
 # if_changed      - execute command if any prerequisite is newer than
 #                   target, or command line has changed
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/7] tools build: Make fixdep helper part of the build process
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
                   ` (3 preceding siblings ...)
  2015-09-23 10:33 ` [PATCH 4/7] tools build: Move dependency copy into function Jiri Olsa
@ 2015-09-23 10:34 ` Jiri Olsa
  2015-09-29  8:40   ` [tip:perf/core] tools build: Make the " tip-bot for Jiri Olsa
  2015-09-23 10:34 ` [PATCH 6/7] perf tools: Rename single_dep target to prepare Jiri Olsa
  2015-09-23 10:34 ` [PATCH 7/7] tools build: Build fixdep helper from perf and basic libs Jiri Olsa
  6 siblings, 1 reply; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Making fixdep helper to be invoked within the dep-cmd.

Each user of the build framework needs to make sure
fixdep exists before executing the build itself.

If the build won't find fixdep, it falls back to the
old style dependency tracking.

Link: http://lkml.kernel.org/n/tip-iaegu48r5t9k2lttjrvozmb1@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Build.include  | 10 ++++++++--
 tools/build/Makefile.build |  7 +++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/build/Build.include b/tools/build/Build.include
index 851c420098e7..4d000bc959b4 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -58,8 +58,14 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
 # Copy dependency data into .cmd file
 #  - gcc -M dependency info
 #  - command line to create object 'cmd_object :='
-dep-cmd = cat $(depfile) >  $(dot-target).cmd; \
-          printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd
+dep-cmd = $(if $(wildcard $(fixdep)),                                           \
+           $(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;           \
+           rm -f $(depfile);                                                    \
+           mv -f $(dot-target).tmp $(dot-target).cmd,                           \
+           printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
+           printf '\# using basic dep data\n\n' >> $(dot-target).cmd;           \
+           cat $(depfile) >> $(dot-target).cmd;                                 \
+           printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
 
 ###
 # if_changed_dep  - execute command if any prerequisite is newer than
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 0c5f485521d6..4a96473b180f 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -21,6 +21,13 @@ endif
 
 build-dir := $(srctree)/tools/build
 
+# Define $(fixdep) for dep-cmd function
+ifeq ($(OUTPUT),)
+  fixdep := $(build-dir)/fixdep
+else
+  fixdep := $(OUTPUT)/fixdep
+endif
+
 # Generic definitions
 include $(build-dir)/Build.include
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/7] perf tools: Rename single_dep target to prepare
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
                   ` (4 preceding siblings ...)
  2015-09-23 10:34 ` [PATCH 5/7] tools build: Make fixdep helper part of the build process Jiri Olsa
@ 2015-09-23 10:34 ` Jiri Olsa
  2015-09-29  8:40   ` [tip:perf/core] perf tools: Rename the 'single_dep' target to ' prepare' tip-bot for Jiri Olsa
  2015-09-23 10:34 ` [PATCH 7/7] tools build: Build fixdep helper from perf and basic libs Jiri Olsa
  6 siblings, 1 reply; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

And use the new 'prepare' target for $(PERF_IN) target.

Link: http://lkml.kernel.org/n/tip-00vhcjq782qzisxdjjcjgwpo@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/Makefile.perf | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 6dec86665acc..25c1753ffbeb 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -299,7 +299,7 @@ PERF_IN := $(OUTPUT)perf-in.o
 export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
 include $(srctree)/tools/build/Makefile.include
 
-$(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
+$(PERF_IN): prepare FORCE
 	$(Q)$(MAKE) $(build)=perf
 
 $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
@@ -349,27 +349,27 @@ endif
 __build-dir = $(subst $(OUTPUT),,$(dir $@))
 build-dir   = $(if $(__build-dir),$(__build-dir),.)
 
-single_dep: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
+prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
 
-$(OUTPUT)%.o: %.c single_dep FORCE
+$(OUTPUT)%.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.i: %.c single_dep FORCE
+$(OUTPUT)%.i: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.s: %.c single_dep FORCE
+$(OUTPUT)%.s: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%-bison.o: %.c single_dep FORCE
+$(OUTPUT)%-bison.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%-flex.o: %.c single_dep FORCE
+$(OUTPUT)%-flex.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.o: %.S single_dep FORCE
+$(OUTPUT)%.o: %.S prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.i: %.S single_dep FORCE
+$(OUTPUT)%.i: %.S prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
 $(OUTPUT)perf-%: %.o $(PERFLIBS)
@@ -591,6 +591,6 @@ FORCE:
 
 .PHONY: all install clean config-clean strip install-gtk
 .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
-.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE single_dep
+.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE prepare
 .PHONY: libtraceevent_plugins
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 7/7] tools build: Build fixdep helper from perf and basic libs
  2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
                   ` (5 preceding siblings ...)
  2015-09-23 10:34 ` [PATCH 6/7] perf tools: Rename single_dep target to prepare Jiri Olsa
@ 2015-09-23 10:34 ` Jiri Olsa
  2015-09-29  8:41   ` [tip:perf/core] " tip-bot for Jiri Olsa
  6 siblings, 1 reply; 17+ messages in thread
From: Jiri Olsa @ 2015-09-23 10:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Adding fixdep target into Makefile.include to ease up
building of fixdep helper, that needs to be built before
we dive in to the build itself. The user can invoke the
fixdep target to build the helper.

Link: http://lkml.kernel.org/n/tip-xk4fs6etao060ekipi0o1xhk@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Documentation/Build.txt |  7 +++++++
 tools/build/Makefile.include        |  5 +++++
 tools/build/tests/ex/Makefile       |  8 +++++---
 tools/lib/api/Makefile              |  4 +++-
 tools/lib/bpf/Makefile              |  4 +++-
 tools/lib/lockdep/Makefile          |  4 +++-
 tools/perf/Makefile.perf            | 12 ++++++------
 7 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index 88824359d595..e32d9e303b15 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -113,6 +113,13 @@ It defines following interface:
       make $(build)=ex
 
 
+Fixdep
+------
+It's needed build fixdep helper before invoking the build.
+The Makefile.include adds fixdep target, that could be
+invoked by user.
+
+
 Rules
 -----
 
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
index 91bc60616de5..6572bb023543 100644
--- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include
@@ -1 +1,6 @@
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+fixdep:
+	$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
+
+.PHONY: fixdep
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index f279b84cb859..c50d5782ad5a 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -3,18 +3,20 @@ export CC      := gcc
 export LD      := ld
 export AR      := ar
 
+ex:
+
 include $(srctree)/tools/build/Makefile.include
 
 ex: ex-in.o libex-in.o
 	gcc -o $@ $^
 
-ex.%: FORCE
+ex.%: fixdep FORCE
 	make -f $(srctree)/tools/build/Makefile.build dir=. $@
 
-ex-in.o: FORCE
+ex-in.o: fixdep FORCE
 	make $(build)=ex
 
-libex-in.o: FORCE
+libex-in.o: fixdep FORCE
 	make $(build)=libex
 
 clean:
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index 8806ea7c2f99..d85904dc9b38 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -23,10 +23,12 @@ RM = rm -f
 
 API_IN := $(OUTPUT)libapi-in.o
 
+all:
+
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
-all: $(LIBFILE)
+all: fixdep $(LIBFILE)
 
 $(API_IN): FORCE
 	@$(MAKE) $(build)=libapi
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index c66ade68d4a1..fc9af57b666e 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -123,6 +123,8 @@ endif
 # the same command line setup.
 MAKEOVERRIDES=
 
+all:
+
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
@@ -133,7 +135,7 @@ CMD_TARGETS = $(LIB_FILE)
 
 TARGETS = $(CMD_TARGETS)
 
-all: $(VERSION_FILES) all_cmd
+all: fixdep $(VERSION_FILES) all_cmd
 
 all_cmd: $(CMD_TARGETS)
 
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index d12081da383b..7e319afac78a 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -93,6 +93,8 @@ else
   print_install =		echo '  INSTALL  '$1'	to	$(DESTDIR_SQ)$2';
 endif
 
+all:
+
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
@@ -109,7 +111,7 @@ CMD_TARGETS = $(LIB_FILE)
 TARGETS = $(CMD_TARGETS)
 
 
-all: all_cmd
+all: fixdep all_cmd
 
 all_cmd: $(CMD_TARGETS)
 
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 25c1753ffbeb..56517d304772 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -306,7 +306,7 @@ $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
 		$(PERF_IN) $(LIBS) -o $@
 
-$(GTK_IN): FORCE
+$(GTK_IN): fixdep FORCE
 	$(Q)$(MAKE) $(build)=gtk
 
 $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
@@ -349,7 +349,7 @@ endif
 __build-dir = $(subst $(OUTPUT),,$(dir $@))
 build-dir   = $(if $(__build-dir),$(__build-dir),.)
 
-prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
+prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h fixdep
 
 $(OUTPUT)%.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
@@ -389,7 +389,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
 LIBPERF_IN := $(OUTPUT)libperf-in.o
 
-$(LIBPERF_IN): FORCE
+$(LIBPERF_IN): fixdep FORCE
 	$(Q)$(MAKE) $(build)=libperf
 
 $(LIB_FILE): $(LIBPERF_IN)
@@ -397,10 +397,10 @@ $(LIB_FILE): $(LIBPERF_IN)
 
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
 
-$(LIBTRACEEVENT): FORCE
+$(LIBTRACEEVENT): fixdep FORCE
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
 
-libtraceevent_plugins: FORCE
+libtraceevent_plugins: fixdep FORCE
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins
 
 $(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
@@ -413,7 +413,7 @@ $(LIBTRACEEVENT)-clean:
 install-traceevent-plugins: $(LIBTRACEEVENT)
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
 
-$(LIBAPI): FORCE
+$(LIBAPI): fixdep FORCE
 	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a
 
 $(LIBAPI)-clean:
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/7] tools build: Add test for missing include
  2015-09-23 10:33 ` [PATCH 2/7] tools build: Add test for missing include Jiri Olsa
@ 2015-09-25 17:43   ` Arnaldo Carvalho de Melo
  2015-09-27 19:45     ` Jiri Olsa
  2015-09-29  8:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
  1 sibling, 1 reply; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-25 17:43 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Em Wed, Sep 23, 2015 at 12:33:57PM +0200, Jiri Olsa escreveu:
> The current build framework fails to cope with header file
> removal. The reason is the removed header file stays in the
> .cmd file target rule and force the build to fail.

So, where is this test hooked up, is the way to test this to do:

cd tools/build/tests/
./run.sh
less ex.out

?
 
> This issue is fixed and explained in following patches.
> 
> Adding new build test that simulates header removal.
> 
> Link: http://lkml.kernel.org/n/tip-580lv21jts6t9j15cosxggdc@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/build/tests/ex/Build    |  1 +
>  tools/build/tests/ex/Makefile |  2 +-
>  tools/build/tests/ex/ex.c     |  2 ++
>  tools/build/tests/ex/inc.c    |  8 ++++++++
>  tools/build/tests/run.sh      | 27 +++++++++++++++++++++++++++
>  5 files changed, 39 insertions(+), 1 deletion(-)
>  create mode 100644 tools/build/tests/ex/inc.c
> 
> diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
> index 429c7d452101..4d502f9b1a50 100644
> --- a/tools/build/tests/ex/Build
> +++ b/tools/build/tests/ex/Build
> @@ -4,6 +4,7 @@ ex-y += b.o
>  ex-y += b.o
>  ex-y += empty/
>  ex-y += empty2/
> +ex-y += inc.o
>  
>  libex-y += c.o
>  libex-y += d.o
> diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
> index a8f596e37fd2..f279b84cb859 100644
> --- a/tools/build/tests/ex/Makefile
> +++ b/tools/build/tests/ex/Makefile
> @@ -1,4 +1,4 @@
> -export srctree := ../../../..
> +export srctree := $(abspath ../../../..)
>  export CC      := gcc
>  export LD      := ld
>  export AR      := ar
> diff --git a/tools/build/tests/ex/ex.c b/tools/build/tests/ex/ex.c
> index dc42eb2e1a67..57de6074d252 100644
> --- a/tools/build/tests/ex/ex.c
> +++ b/tools/build/tests/ex/ex.c
> @@ -5,6 +5,7 @@ int c(void);
>  int d(void);
>  int e(void);
>  int f(void);
> +int inc(void);
>  
>  int main(void)
>  {
> @@ -14,6 +15,7 @@ int main(void)
>  	d();
>  	e();
>  	f();
> +	inc();
>  
>  	return 0;
>  }
> diff --git a/tools/build/tests/ex/inc.c b/tools/build/tests/ex/inc.c
> new file mode 100644
> index 000000000000..c20f1e9033a3
> --- /dev/null
> +++ b/tools/build/tests/ex/inc.c
> @@ -0,0 +1,8 @@
> +#ifdef INCLUDE
> +#include "krava.h"
> +#endif
> +
> +int inc(void)
> +{
> +	return 0;
> +}
> diff --git a/tools/build/tests/run.sh b/tools/build/tests/run.sh
> index 5494f8ea7567..44d2a0fade67 100755
> --- a/tools/build/tests/run.sh
> +++ b/tools/build/tests/run.sh
> @@ -34,9 +34,36 @@ function test_ex_suffix {
>  	make -C ex V=1 clean > /dev/null 2>&1
>  	rm -f ex.out
>  }
> +
> +function test_ex_include {
> +	make -C ex V=1 clean > ex.out 2>&1
> +
> +	# build with krava.h include
> +	touch ex/krava.h
> +	make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1
> +
> +	if [ ! -x ./ex/ex ]; then
> +	  echo FAILED
> +	  exit -1
> +	fi
> +
> +	# build without the include
> +	rm -f ex/krava.h ex/ex
> +	make -C ex V=1 >> ex.out 2>&1
> +
> +	if [ ! -x ./ex/ex ]; then
> +	  echo FAILED
> +	  exit -1
> +	fi
> +
> +	make -C ex V=1 clean > /dev/null 2>&1
> +	rm -f ex.out
> +}
> +
>  echo -n Testing..
>  
>  test_ex
>  test_ex_suffix
> +test_ex_include
>  
>  echo OK
> -- 
> 2.4.3

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/7] tools build: Add test for missing include
  2015-09-25 17:43   ` Arnaldo Carvalho de Melo
@ 2015-09-27 19:45     ` Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: Jiri Olsa @ 2015-09-27 19:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

On Fri, Sep 25, 2015 at 02:43:47PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Sep 23, 2015 at 12:33:57PM +0200, Jiri Olsa escreveu:
> > The current build framework fails to cope with header file
> > removal. The reason is the removed header file stays in the
> > .cmd file target rule and force the build to fail.
> 
> So, where is this test hooked up, is the way to test this to do:
> 
> cd tools/build/tests/
> ./run.sh
> less ex.out

yep, ex.out is there only in case of error

jirka

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [tip:perf/core] tools build: Add Makefile.include
  2015-09-23 10:33 ` [PATCH 1/7] tools build: Add Makefile.include Jiri Olsa
@ 2015-09-29  8:38   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dsahern, acme, linux-kernel, namhyung, jolsa, mingo, hpa, tglx,
	a.p.zijlstra

Commit-ID:  ab6201d09b1840c7ffcd6606c1d3dae68b8b3048
Gitweb:     http://git.kernel.org/tip/ab6201d09b1840c7ffcd6606c1d3dae68b8b3048
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:33:56 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:54 -0300

tools build: Add Makefile.include

To ease up build framework code setup for users.

More shared code will be added in the following patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Documentation/Build.txt | 45 ++++++++++++++++++++++++++-----------
 tools/build/Makefile.include        |  1 +
 tools/build/tests/ex/Makefile       |  3 ++-
 tools/lib/api/Makefile              |  2 +-
 tools/lib/bpf/Makefile              |  2 +-
 tools/lib/lockdep/Makefile          |  2 +-
 tools/perf/Makefile.perf            |  2 +-
 7 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index aa5e092..8882435 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -11,8 +11,9 @@ Unlike the kernel we don't have a single build object 'obj-y' list that where
 we setup source objects, but we support more. This allows one 'Build' file to
 carry a sources list for multiple build objects.
 
-a) Build framework makefiles
-----------------------------
+
+Build framework makefiles
+-------------------------
 
 The build framework consists of 2 Makefiles:
 
@@ -23,7 +24,7 @@ While the 'Build.include' file contains just some generic definitions, the
 'Makefile.build' file is the makefile used from the outside. It's
 interface/usage is following:
 
-  $ make -f tools/build/Makefile srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
+  $ make -f tools/build/Makefile.build srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
 
 where:
 
@@ -38,8 +39,9 @@ called $(OBJECT)-in.o:
 
 which includes all compiled sources described in 'Build' makefiles.
 
-a) Build makefiles
-------------------
+
+Build makefiles
+---------------
 
 The user supplies 'Build' makefiles that contains a objects list, and connects
 the build to nested directories.
@@ -95,8 +97,24 @@ It's only a matter of 2 single commands to create the final binaries:
 
 You can check the 'ex' example in 'tools/build/tests/ex' for more details.
 
-b) Rules
---------
+
+Makefile.include
+----------------
+
+The tools/build/Makefile.include makefile could be included
+via user makefiles to get usefull definitions.
+
+It defines following interface:
+
+  - build macro definition:
+      build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+    to make it easier to invoke build like:
+      make $(build)=ex
+
+
+Rules
+-----
 
 The build framework provides standard compilation rules to handle .S and .c
 compilation.
@@ -104,8 +122,9 @@ compilation.
 It's possible to include special rule if needed (like we do for flex or bison
 code generation).
 
-c) CFLAGS
----------
+
+CFLAGS
+------
 
 It's possible to alter the standard object C flags in the following way:
 
@@ -115,8 +134,8 @@ It's possible to alter the standard object C flags in the following way:
 This C flags changes has the scope of the Build makefile they are defined in.
 
 
-d) Dependencies
----------------
+Dependencies
+------------
 
 For each built object file 'a.o' the '.a.cmd' is created and holds:
 
@@ -130,8 +149,8 @@ All existing '.cmd' files are included in the Build process to follow properly
 the dependencies and trigger a rebuild when necessary.
 
 
-e) Single rules
----------------
+Single rules
+------------
 
 It's possible to build single object file by choice, like:
 
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
new file mode 100644
index 0000000..91bc606
--- /dev/null
+++ b/tools/build/Makefile.include
@@ -0,0 +1 @@
+build := -f $(srctree)/tools/build/Makefile.build dir=. obj
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index 52d2476..a8f596e 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -3,7 +3,8 @@ export CC      := gcc
 export LD      := ld
 export AR      := ar
 
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
+
 ex: ex-in.o libex-in.o
 	gcc -o $@ $^
 
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index fe1b02c..8806ea7 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -21,10 +21,10 @@ CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 
 RM = rm -f
 
-build  := -f $(srctree)/tools/build/Makefile.build dir=. obj
 API_IN := $(OUTPUT)libapi-in.o
 
 export srctree OUTPUT CC LD CFLAGS V
+include $(srctree)/tools/build/Makefile.include
 
 all: $(LIBFILE)
 
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index e630f9f..c66ade6 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -124,7 +124,7 @@ endif
 MAKEOVERRIDES=
 
 export srctree OUTPUT CC LD CFLAGS V
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
 
 BPF_IN    := $(OUTPUT)libbpf-in.o
 LIB_FILE := $(addprefix $(OUTPUT),$(LIB_FILE))
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index 18ffccf..d12081d 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -94,7 +94,7 @@ else
 endif
 
 export srctree OUTPUT CC LD CFLAGS V
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
 
 do_compile_shared_library =			\
 	($(print_shared_lib_compile)		\
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 6c5c699..6dec866 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -297,7 +297,7 @@ strip: $(PROGRAMS) $(OUTPUT)perf
 PERF_IN := $(OUTPUT)perf-in.o
 
 export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
-build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+include $(srctree)/tools/build/Makefile.include
 
 $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
 	$(Q)$(MAKE) $(build)=perf

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip:perf/core] tools build: Add test for missing include
  2015-09-23 10:33 ` [PATCH 2/7] tools build: Add test for missing include Jiri Olsa
  2015-09-25 17:43   ` Arnaldo Carvalho de Melo
@ 2015-09-29  8:39   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dsahern, namhyung, jolsa, linux-kernel, acme, a.p.zijlstra, tglx,
	mingo, hpa

Commit-ID:  0c00c3fb4e4a6ff714b7ad864f58e0fb33b3534c
Gitweb:     http://git.kernel.org/tip/0c00c3fb4e4a6ff714b7ad864f58e0fb33b3534c
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:33:57 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:54 -0300

tools build: Add test for missing include

The current build framework fails to cope with header file removal. The
reason is that the removed header file stays in the .cmd file target
rule and forces the build to fail.

This issue is fixed and explained in the following patches.

Adding a new build test that simulates header removal.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/tests/ex/Build    |  1 +
 tools/build/tests/ex/Makefile |  2 +-
 tools/build/tests/ex/ex.c     |  2 ++
 tools/build/tests/ex/inc.c    |  8 ++++++++
 tools/build/tests/run.sh      | 27 +++++++++++++++++++++++++++
 5 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
index 429c7d4..4d502f9 100644
--- a/tools/build/tests/ex/Build
+++ b/tools/build/tests/ex/Build
@@ -4,6 +4,7 @@ ex-y += b.o
 ex-y += b.o
 ex-y += empty/
 ex-y += empty2/
+ex-y += inc.o
 
 libex-y += c.o
 libex-y += d.o
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index a8f596e..f279b84 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -1,4 +1,4 @@
-export srctree := ../../../..
+export srctree := $(abspath ../../../..)
 export CC      := gcc
 export LD      := ld
 export AR      := ar
diff --git a/tools/build/tests/ex/ex.c b/tools/build/tests/ex/ex.c
index dc42eb2..57de607 100644
--- a/tools/build/tests/ex/ex.c
+++ b/tools/build/tests/ex/ex.c
@@ -5,6 +5,7 @@ int c(void);
 int d(void);
 int e(void);
 int f(void);
+int inc(void);
 
 int main(void)
 {
@@ -14,6 +15,7 @@ int main(void)
 	d();
 	e();
 	f();
+	inc();
 
 	return 0;
 }
diff --git a/tools/build/tests/ex/inc.c b/tools/build/tests/ex/inc.c
new file mode 100644
index 0000000..c20f1e9
--- /dev/null
+++ b/tools/build/tests/ex/inc.c
@@ -0,0 +1,8 @@
+#ifdef INCLUDE
+#include "krava.h"
+#endif
+
+int inc(void)
+{
+	return 0;
+}
diff --git a/tools/build/tests/run.sh b/tools/build/tests/run.sh
index 5494f8e..44d2a0f 100755
--- a/tools/build/tests/run.sh
+++ b/tools/build/tests/run.sh
@@ -34,9 +34,36 @@ function test_ex_suffix {
 	make -C ex V=1 clean > /dev/null 2>&1
 	rm -f ex.out
 }
+
+function test_ex_include {
+	make -C ex V=1 clean > ex.out 2>&1
+
+	# build with krava.h include
+	touch ex/krava.h
+	make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1
+
+	if [ ! -x ./ex/ex ]; then
+	  echo FAILED
+	  exit -1
+	fi
+
+	# build without the include
+	rm -f ex/krava.h ex/ex
+	make -C ex V=1 >> ex.out 2>&1
+
+	if [ ! -x ./ex/ex ]; then
+	  echo FAILED
+	  exit -1
+	fi
+
+	make -C ex V=1 clean > /dev/null 2>&1
+	rm -f ex.out
+}
+
 echo -n Testing..
 
 test_ex
 test_ex_suffix
+test_ex_include
 
 echo OK

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip:perf/core] tools build: Add fixdep dependency helper
  2015-09-23 10:33 ` [PATCH 3/7] tools build: Add fixdep dependency helper Jiri Olsa
@ 2015-09-29  8:39   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, tglx, jolsa, a.p.zijlstra, dsahern, mingo,
	namhyung, kai.germaschewski, acme, hpa

Commit-ID:  9f7ef9854e800bc3bab3d9a527e8f8f960eec1a6
Gitweb:     http://git.kernel.org/tip/9f7ef9854e800bc3bab3d9a527e8f8f960eec1a6
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:33:58 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:55 -0300

tools build: Add fixdep dependency helper

For dependency tracking we currently use targets that fall out of the
gcc -MD command. We store this info in the .cmd file and include as
makefile during the build.

This format put object as target and all the c and header files as
dependencies, like:

  util/abspath.o: util/abspath.c /usr/include/stdc-predef.h util/cache.h \
   /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
   ...

If any of those dependency header files (krava.h below) is removed the
build fails on:

  make[1]: *** No rule to make target 'krava.h', needed by 'inc.o'.  Stop.

This patch adds fixdep helper, that is used by kbuild to alter the shape
of the object dependencies like:

  source_util/abspath.o := util/abspath.c

  deps_util/abspath.o := \
    /usr/include/stdc-predef.h \
    util/cache.h \
    ...

  util/abspath.o: $(deps_util/abspath.o)

  $(deps_util/abspath.o):

With this format the header removal won't make the build fail, because
it'll be picked up by the last empty target defined for each header.

As previously mentioned the fixdep tool is taken from kbuild. It's not
complete backport, only the part that alters the standard dependency
info was taken, the part that adds the CONFIG_* dependency logic will be
probably taken later on.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Kai Germaschewski <kai.germaschewski@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Build    |   1 +
 tools/build/Makefile |  43 +++++++++++++
 tools/build/fixdep.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 212 insertions(+)

diff --git a/tools/build/Build b/tools/build/Build
new file mode 100644
index 0000000..63a6c34
--- /dev/null
+++ b/tools/build/Build
@@ -0,0 +1 @@
+fixdep-y := fixdep.o
diff --git a/tools/build/Makefile b/tools/build/Makefile
new file mode 100644
index 0000000..a930362
--- /dev/null
+++ b/tools/build/Makefile
@@ -0,0 +1,43 @@
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(shell pwd)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+endif
+
+include $(srctree)/tools//scripts/Makefile.include
+
+define allow-override
+  $(if $(or $(findstring environment,$(origin $(1))),\
+            $(findstring command line,$(origin $(1)))),,\
+    $(eval $(1) = $(2)))
+endef
+
+$(call allow-override,CC,$(CROSS_COMPILE)gcc)
+$(call allow-override,LD,$(CROSS_COMPILE)ld)
+
+ifeq ($(V),1)
+  Q =
+else
+  Q = @
+endif
+
+export Q srctree CC LD
+
+MAKEFLAGS := --no-print-directory
+build     := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+all: fixdep
+
+clean:
+	$(call QUIET_CLEAN, fixdep)
+	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
+	$(Q)rm -f fixdep
+
+$(OUTPUT)fixdep-in.o: FORCE
+	$(Q)$(MAKE) $(build)=fixdep
+
+$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
+	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $<
+
+FORCE:
+
+.PHONY: FORCE
diff --git a/tools/build/fixdep.c b/tools/build/fixdep.c
new file mode 100644
index 0000000..1521d36
--- /dev/null
+++ b/tools/build/fixdep.c
@@ -0,0 +1,168 @@
+/*
+ * "Optimize" a list of dependencies as spit out by gcc -MD
+ * for the build framework.
+ *
+ * Original author:
+ *   Copyright    2002 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ *
+ * This code has been borrowed from kbuild's fixdep (scripts/basic/fixdep.c),
+ * Please check it for detailed explanation. This fixdep borow only the
+ * base transformation of dependecies without the CONFIG mangle.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+
+char *target;
+char *depfile;
+char *cmdline;
+
+static void usage(void)
+{
+	fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
+	exit(1);
+}
+
+/*
+ * Print out the commandline prefixed with cmd_<target filename> :=
+ */
+static void print_cmdline(void)
+{
+	printf("cmd_%s := %s\n\n", target, cmdline);
+}
+
+/*
+ * Important: The below generated source_foo.o and deps_foo.o variable
+ * assignments are parsed not only by make, but also by the rather simple
+ * parser in scripts/mod/sumversion.c.
+ */
+static void parse_dep_file(void *map, size_t len)
+{
+	char *m = map;
+	char *end = m + len;
+	char *p;
+	char s[PATH_MAX];
+	int is_target;
+	int saw_any_target = 0;
+	int is_first_dep = 0;
+
+	while (m < end) {
+		/* Skip any "white space" */
+		while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
+			m++;
+		/* Find next "white space" */
+		p = m;
+		while (p < end && *p != ' ' && *p != '\\' && *p != '\n')
+			p++;
+		/* Is the token we found a target name? */
+		is_target = (*(p-1) == ':');
+		/* Don't write any target names into the dependency file */
+		if (is_target) {
+			/* The /next/ file is the first dependency */
+			is_first_dep = 1;
+		} else {
+			/* Save this token/filename */
+			memcpy(s, m, p-m);
+			s[p - m] = 0;
+
+			/*
+			 * Do not list the source file as dependency,
+			 * so that kbuild is not confused if a .c file
+			 * is rewritten into .S or vice versa. Storing
+			 * it in source_* is needed for modpost to
+			 * compute srcversions.
+			 */
+			if (is_first_dep) {
+				/*
+				 * If processing the concatenation of
+				 * multiple dependency files, only
+				 * process the first target name, which
+				 * will be the original source name,
+				 * and ignore any other target names,
+				 * which will be intermediate temporary
+				 * files.
+				 */
+				if (!saw_any_target) {
+					saw_any_target = 1;
+					printf("source_%s := %s\n\n",
+						target, s);
+					printf("deps_%s := \\\n",
+						target);
+				}
+				is_first_dep = 0;
+			} else
+				printf("  %s \\\n", s);
+		}
+		/*
+		 * Start searching for next token immediately after the first
+		 * "whitespace" character that follows this token.
+		 */
+		m = p + 1;
+	}
+
+	if (!saw_any_target) {
+		fprintf(stderr, "fixdep: parse error; no targets found\n");
+		exit(1);
+	}
+
+	printf("\n%s: $(deps_%s)\n\n", target, target);
+	printf("$(deps_%s):\n", target);
+}
+
+static void print_deps(void)
+{
+	struct stat st;
+	int fd;
+	void *map;
+
+	fd = open(depfile, O_RDONLY);
+	if (fd < 0) {
+		fprintf(stderr, "fixdep: error opening depfile: ");
+		perror(depfile);
+		exit(2);
+	}
+	if (fstat(fd, &st) < 0) {
+		fprintf(stderr, "fixdep: error fstat'ing depfile: ");
+		perror(depfile);
+		exit(2);
+	}
+	if (st.st_size == 0) {
+		fprintf(stderr, "fixdep: %s is empty\n", depfile);
+		close(fd);
+		return;
+	}
+	map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+	if ((long) map == -1) {
+		perror("fixdep: mmap");
+		close(fd);
+		return;
+	}
+
+	parse_dep_file(map, st.st_size);
+
+	munmap(map, st.st_size);
+
+	close(fd);
+}
+
+int main(int argc, char **argv)
+{
+	if (argc != 4)
+		usage();
+
+	depfile = argv[1];
+	target  = argv[2];
+	cmdline = argv[3];
+
+	print_cmdline();
+	print_deps();
+
+	return 0;
+}

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip:perf/core] tools build: Move dependency copy into function
  2015-09-23 10:33 ` [PATCH 4/7] tools build: Move dependency copy into function Jiri Olsa
@ 2015-09-29  8:40   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, linux-kernel, a.p.zijlstra, jolsa, acme, dsahern, tglx,
	mingo, hpa

Commit-ID:  275e2d95591e2714d6b541d4e26959381d6b2705
Gitweb:     http://git.kernel.org/tip/275e2d95591e2714d6b541d4e26959381d6b2705
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:33:59 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:55 -0300

tools build: Move dependency copy into function

So it's easier to add more functionality in the following commit.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Build.include | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/build/Build.include b/tools/build/Build.include
index 4c8daac..851c420 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -55,14 +55,19 @@ make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1)))))
 any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
 
 ###
+# Copy dependency data into .cmd file
+#  - gcc -M dependency info
+#  - command line to create object 'cmd_object :='
+dep-cmd = cat $(depfile) >  $(dot-target).cmd; \
+          printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd
+
+###
 # if_changed_dep  - execute command if any prerequisite is newer than
 #                   target, or command line has changed and update
 #                   dependencies in the cmd file
 if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)),         \
 	@set -e;                                                   \
-	$(echo-cmd) $(cmd_$(1));                                   \
-	cat $(depfile) > $(dot-target).cmd;                        \
-	printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
+	$(echo-cmd) $(cmd_$(1)) && $(dep-cmd))
 
 # if_changed      - execute command if any prerequisite is newer than
 #                   target, or command line has changed

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip:perf/core] tools build: Make the fixdep helper part of the build process
  2015-09-23 10:34 ` [PATCH 5/7] tools build: Make fixdep helper part of the build process Jiri Olsa
@ 2015-09-29  8:40   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, jolsa, a.p.zijlstra, hpa, acme, tglx, dsahern,
	mingo, namhyung

Commit-ID:  9fb81323eb3085b6a47fe81d78541958ae7eaea3
Gitweb:     http://git.kernel.org/tip/9fb81323eb3085b6a47fe81d78541958ae7eaea3
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:34:00 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:55 -0300

tools build: Make the fixdep helper part of the build process

Making the fixdep helper to be invoked within dep-cmd.

Each user of the build framework needs to make sure fixdep exists before
executing the build itself.

If the build doesn't find fixdep, it falls back to the old style
dependency tracking.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Build.include  | 10 ++++++++--
 tools/build/Makefile.build |  7 +++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/build/Build.include b/tools/build/Build.include
index 851c420..4d000bc 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -58,8 +58,14 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
 # Copy dependency data into .cmd file
 #  - gcc -M dependency info
 #  - command line to create object 'cmd_object :='
-dep-cmd = cat $(depfile) >  $(dot-target).cmd; \
-          printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd
+dep-cmd = $(if $(wildcard $(fixdep)),                                           \
+           $(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;           \
+           rm -f $(depfile);                                                    \
+           mv -f $(dot-target).tmp $(dot-target).cmd,                           \
+           printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
+           printf '\# using basic dep data\n\n' >> $(dot-target).cmd;           \
+           cat $(depfile) >> $(dot-target).cmd;                                 \
+           printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
 
 ###
 # if_changed_dep  - execute command if any prerequisite is newer than
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 0c5f485..4a96473 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -21,6 +21,13 @@ endif
 
 build-dir := $(srctree)/tools/build
 
+# Define $(fixdep) for dep-cmd function
+ifeq ($(OUTPUT),)
+  fixdep := $(build-dir)/fixdep
+else
+  fixdep := $(OUTPUT)/fixdep
+endif
+
 # Generic definitions
 include $(build-dir)/Build.include
 

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip:perf/core] perf tools: Rename the 'single_dep' target to ' prepare'
  2015-09-23 10:34 ` [PATCH 6/7] perf tools: Rename single_dep target to prepare Jiri Olsa
@ 2015-09-29  8:40   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, a.p.zijlstra, tglx, namhyung, mingo, linux-kernel, dsahern,
	acme, jolsa

Commit-ID:  324c824ade1cad094a21e6177b9aa7977146feeb
Gitweb:     http://git.kernel.org/tip/324c824ade1cad094a21e6177b9aa7977146feeb
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:34:01 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:55 -0300

perf tools: Rename the 'single_dep' target to 'prepare'

And use the new 'prepare' target for the $(PERF_IN) target.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 6dec866..25c1753 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -299,7 +299,7 @@ PERF_IN := $(OUTPUT)perf-in.o
 export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
 include $(srctree)/tools/build/Makefile.include
 
-$(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
+$(PERF_IN): prepare FORCE
 	$(Q)$(MAKE) $(build)=perf
 
 $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
@@ -349,27 +349,27 @@ endif
 __build-dir = $(subst $(OUTPUT),,$(dir $@))
 build-dir   = $(if $(__build-dir),$(__build-dir),.)
 
-single_dep: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
+prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
 
-$(OUTPUT)%.o: %.c single_dep FORCE
+$(OUTPUT)%.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.i: %.c single_dep FORCE
+$(OUTPUT)%.i: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.s: %.c single_dep FORCE
+$(OUTPUT)%.s: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%-bison.o: %.c single_dep FORCE
+$(OUTPUT)%-bison.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%-flex.o: %.c single_dep FORCE
+$(OUTPUT)%-flex.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.o: %.S single_dep FORCE
+$(OUTPUT)%.o: %.S prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
-$(OUTPUT)%.i: %.S single_dep FORCE
+$(OUTPUT)%.i: %.S prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
 $(OUTPUT)perf-%: %.o $(PERFLIBS)
@@ -591,6 +591,6 @@ FORCE:
 
 .PHONY: all install clean config-clean strip install-gtk
 .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
-.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE single_dep
+.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE prepare
 .PHONY: libtraceevent_plugins
 

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip:perf/core] tools build: Build fixdep helper from perf and basic libs
  2015-09-23 10:34 ` [PATCH 7/7] tools build: Build fixdep helper from perf and basic libs Jiri Olsa
@ 2015-09-29  8:41   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-09-29  8:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, hpa, acme, linux-kernel, a.p.zijlstra, namhyung, dsahern,
	mingo, tglx

Commit-ID:  7c422f5572667fef0db38d2046ecce69dcf0afc8
Gitweb:     http://git.kernel.org/tip/7c422f5572667fef0db38d2046ecce69dcf0afc8
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Sep 2015 12:34:02 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 15:50:55 -0300

tools build: Build fixdep helper from perf and basic libs

Adding the fixdep target into the Makefile.include to ease up building of
fixdep helper, that needs to be built before we dive in to the build itself.
The user can invoke the fixdep target to build the helper.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-8-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Documentation/Build.txt |  7 +++++++
 tools/build/Makefile.include        |  5 +++++
 tools/build/tests/ex/Makefile       |  8 +++++---
 tools/lib/api/Makefile              |  4 +++-
 tools/lib/bpf/Makefile              |  4 +++-
 tools/lib/lockdep/Makefile          |  4 +++-
 tools/perf/Makefile.perf            | 12 ++++++------
 7 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index 8882435..a47bffb 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -113,6 +113,13 @@ It defines following interface:
       make $(build)=ex
 
 
+Fixdep
+------
+It is necessary to build the fixdep helper before invoking the build.
+The Makefile.include file adds the fixdep target, that could be
+invoked by the user.
+
+
 Rules
 -----
 
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
index 91bc606..6572bb0 100644
--- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include
@@ -1 +1,6 @@
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+fixdep:
+	$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
+
+.PHONY: fixdep
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index f279b84..c50d578 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -3,18 +3,20 @@ export CC      := gcc
 export LD      := ld
 export AR      := ar
 
+ex:
+
 include $(srctree)/tools/build/Makefile.include
 
 ex: ex-in.o libex-in.o
 	gcc -o $@ $^
 
-ex.%: FORCE
+ex.%: fixdep FORCE
 	make -f $(srctree)/tools/build/Makefile.build dir=. $@
 
-ex-in.o: FORCE
+ex-in.o: fixdep FORCE
 	make $(build)=ex
 
-libex-in.o: FORCE
+libex-in.o: fixdep FORCE
 	make $(build)=libex
 
 clean:
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index 8806ea7..d85904d 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -23,10 +23,12 @@ RM = rm -f
 
 API_IN := $(OUTPUT)libapi-in.o
 
+all:
+
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
-all: $(LIBFILE)
+all: fixdep $(LIBFILE)
 
 $(API_IN): FORCE
 	@$(MAKE) $(build)=libapi
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index c66ade6..fc9af57 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -123,6 +123,8 @@ endif
 # the same command line setup.
 MAKEOVERRIDES=
 
+all:
+
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
@@ -133,7 +135,7 @@ CMD_TARGETS = $(LIB_FILE)
 
 TARGETS = $(CMD_TARGETS)
 
-all: $(VERSION_FILES) all_cmd
+all: fixdep $(VERSION_FILES) all_cmd
 
 all_cmd: $(CMD_TARGETS)
 
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index d12081d..7e319af 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -93,6 +93,8 @@ else
   print_install =		echo '  INSTALL  '$1'	to	$(DESTDIR_SQ)$2';
 endif
 
+all:
+
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
@@ -109,7 +111,7 @@ CMD_TARGETS = $(LIB_FILE)
 TARGETS = $(CMD_TARGETS)
 
 
-all: all_cmd
+all: fixdep all_cmd
 
 all_cmd: $(CMD_TARGETS)
 
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 25c1753..56517d3 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -306,7 +306,7 @@ $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
 		$(PERF_IN) $(LIBS) -o $@
 
-$(GTK_IN): FORCE
+$(GTK_IN): fixdep FORCE
 	$(Q)$(MAKE) $(build)=gtk
 
 $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
@@ -349,7 +349,7 @@ endif
 __build-dir = $(subst $(OUTPUT),,$(dir $@))
 build-dir   = $(if $(__build-dir),$(__build-dir),.)
 
-prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
+prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h fixdep
 
 $(OUTPUT)%.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
@@ -389,7 +389,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
 LIBPERF_IN := $(OUTPUT)libperf-in.o
 
-$(LIBPERF_IN): FORCE
+$(LIBPERF_IN): fixdep FORCE
 	$(Q)$(MAKE) $(build)=libperf
 
 $(LIB_FILE): $(LIBPERF_IN)
@@ -397,10 +397,10 @@ $(LIB_FILE): $(LIBPERF_IN)
 
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
 
-$(LIBTRACEEVENT): FORCE
+$(LIBTRACEEVENT): fixdep FORCE
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
 
-libtraceevent_plugins: FORCE
+libtraceevent_plugins: fixdep FORCE
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins
 
 $(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
@@ -413,7 +413,7 @@ $(LIBTRACEEVENT)-clean:
 install-traceevent-plugins: $(LIBTRACEEVENT)
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
 
-$(LIBAPI): FORCE
+$(LIBAPI): fixdep FORCE
 	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a
 
 $(LIBAPI)-clean:

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-09-29  8:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-23 10:33 [PATCH 0/7] tools build: Fix header removal build issue Jiri Olsa
2015-09-23 10:33 ` [PATCH 1/7] tools build: Add Makefile.include Jiri Olsa
2015-09-29  8:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-09-23 10:33 ` [PATCH 2/7] tools build: Add test for missing include Jiri Olsa
2015-09-25 17:43   ` Arnaldo Carvalho de Melo
2015-09-27 19:45     ` Jiri Olsa
2015-09-29  8:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-09-23 10:33 ` [PATCH 3/7] tools build: Add fixdep dependency helper Jiri Olsa
2015-09-29  8:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-09-23 10:33 ` [PATCH 4/7] tools build: Move dependency copy into function Jiri Olsa
2015-09-29  8:40   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-09-23 10:34 ` [PATCH 5/7] tools build: Make fixdep helper part of the build process Jiri Olsa
2015-09-29  8:40   ` [tip:perf/core] tools build: Make the " tip-bot for Jiri Olsa
2015-09-23 10:34 ` [PATCH 6/7] perf tools: Rename single_dep target to prepare Jiri Olsa
2015-09-29  8:40   ` [tip:perf/core] perf tools: Rename the 'single_dep' target to ' prepare' tip-bot for Jiri Olsa
2015-09-23 10:34 ` [PATCH 7/7] tools build: Build fixdep helper from perf and basic libs Jiri Olsa
2015-09-29  8:41   ` [tip:perf/core] " tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).