summaryrefslogtreecommitdiffstats
path: root/tools/build
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2014-12-30 18:44:38 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-02-12 13:22:41 -0300
commit1999307b469bdfda97baa78c7f4ecf3800fdbacd (patch)
treecbcb1a7e0bee031df45442a3e4009d4314fa97d2 /tools/build
parent6d8e62c302bb9285e8882116fc317916ece5d0ab (diff)
downloadop-kernel-dev-1999307b469bdfda97baa78c7f4ecf3800fdbacd.zip
op-kernel-dev-1999307b469bdfda97baa78c7f4ecf3800fdbacd.tar.gz
perf build: Add single target build framework support
Add support to build single targets, like: $ make util/map.o # objects $ make util/map.i # preprocessor $ make util/map.s # assembly Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Tested-by: Will Deacon <will.deacon@arm.com> Cc: Alexis Berlemont <alexis.berlemont@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-tt10y0dmweq6rjaod937rpb4@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build')
-rw-r--r--tools/build/Makefile.build20
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index aced86d..b5ded20 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -49,6 +49,12 @@ quiet_cmd_mkdir = MKDIR $(dir $@)
quiet_cmd_cc_o_c = CC $@
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
+quiet_cmd_cc_i_c = CPP $@
+ cmd_cc_i_c = $(CC) $(c_flags) -E -o $@ $<
+
+quiet_cmd_cc_s_c = AS $@
+ cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
+
# Link agregate command
# If there's nothing to link, create empty $@ object.
quiet_cmd_ld_multi = LD $@
@@ -64,6 +70,18 @@ $(OUTPUT)%.o: %.S FORCE
$(call rule_mkdir)
$(call if_changed_dep,cc_o_c)
+$(OUTPUT)%.i: %.c FORCE
+ $(call rule_mkdir)
+ $(call if_changed_dep,cc_i_c)
+
+$(OUTPUT)%.i: %.S FORCE
+ $(call rule_mkdir)
+ $(call if_changed_dep,cc_i_c)
+
+$(OUTPUT)%.s: %.c FORCE
+ $(call rule_mkdir)
+ $(call if_changed_dep,cc_s_c)
+
# Gather build data:
# obj-y - list of build objects
# subdir-y - list of directories to nest
@@ -100,7 +118,7 @@ FORCE:
# Include all cmd files to get all the dependency rules
# for all objects included
-targets := $(wildcard $(sort $(obj-y) $(in-target)))
+targets := $(wildcard $(sort $(obj-y) $(in-target) $(MAKECMDGOALS)))
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
OpenPOWER on IntegriCloud