summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorVinícius Tinti <viniciustinti@gmail.com>2017-04-24 13:04:58 -0700
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-04-25 08:13:52 +0900
commit433db3e260bc8134d4a46ddf20b3668937e12556 (patch)
tree2174c7cc5e16f1a275a8bfc456428099c94d2700 /scripts/Makefile.build
parent785f11aa595bc3d4e74096cbd598ada54ecc0d81 (diff)
downloadlinux-433db3e260bc8134d4a46ddf20b3668937e12556.tar.bz2
kbuild: Add support to generate LLVM assembly files
Add rules to kbuild in order to generate LLVM assembly files with the .ll extension when using clang. # from c code make CC=clang kernel/pid.ll Signed-off-by: Vinícius Tinti <viniciustinti@gmail.com> Signed-off-by: Behan Webster <behanw@converseincode.com> Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d883116ebaa4..e5f1425c601f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -177,6 +177,14 @@ cmd_cc_symtypes_c = \
$(obj)/%.symtypes : $(src)/%.c FORCE
$(call cmd,cc_symtypes_c)
+# LLVM assembly
+# Generate .ll files from .c
+quiet_cmd_cc_ll_c = CC $(quiet_modtag) $@
+ cmd_cc_ll_c = $(CC) $(c_flags) -emit-llvm -S -o $@ $<
+
+$(obj)/%.ll: $(src)/%.c FORCE
+ $(call if_changed_dep,cc_ll_c)
+
# C (.c) files
# The C file is compiled and updated dependency information is generated.
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)