[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-ab6201d09b1840c7ffcd6606c1d3dae68b8b3048@git.kernel.org>
Date: Tue, 29 Sep 2015 01:38:57 -0700
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: dsahern@...il.com, acme@...hat.com, linux-kernel@...r.kernel.org,
namhyung@...nel.org, jolsa@...nel.org, mingo@...nel.org,
hpa@...or.com, tglx@...utronix.de, a.p.zijlstra@...llo.nl
Subject: [tip:perf/core] tools build: Add Makefile.include
Commit-ID: ab6201d09b1840c7ffcd6606c1d3dae68b8b3048
Gitweb: http://git.kernel.org/tip/ab6201d09b1840c7ffcd6606c1d3dae68b8b3048
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Wed, 23 Sep 2015 12:33:56 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.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@...nel.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists