kbuild: simplify use of genksyms

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Sunday, December 28, 2008 - 5:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=37a8d9...
Commit:     37a8d9f67f18de1e2cbc7387311ce22d4dbff518
Parent:     a1d94aa5560dc6b06baf30ae477115b51dc25461
Author:     Sam Ravnborg <sam@ravnborg.org>
AuthorDate: Fri Dec 19 21:38:09 2008 +0100
Committer:  Sam Ravnborg <sam@ravnborg.org>
CommitDate: Fri Dec 19 22:00:58 2008 +0100

    kbuild: simplify use of genksyms
    
    Avoid duplicating long list of options in two places
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/Makefile.build |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d21f0ea..c1da14b 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -151,17 +151,17 @@ cmd_cc_i_c       = $(CPP) $(c_flags)   -o $@ $<
 $(obj)/%.i: $(src)/%.c FORCE
 	$(call if_changed_dep,cc_i_c)
 
+cmd_gensymtypes =                                                           \
+    $(CPP) -D__GENKSYMS__ $(c_flags) $< |                                   \
+    $(GENKSYMS) -T $@ -a $(ARCH)                                            \
+     $(if $(KBUILD_PRESERVE),-p)                                            \
+     $(if $(1),-r $(firstword $(wildcard $(@:.symtypes=.symref) /dev/null)))
+
 quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
-cmd_cc_symtypes_c	   = \
-		set -e;							\
-		$(CPP) -D__GENKSYMS__ $(c_flags) $<			\
-		| $(GENKSYMS) -T $@					\
-			      -r $(firstword $(wildcard			\
-				     $(@:.symtypes=.symref) /dev/null))	\
-			      $(if $(KBUILD_PRESERVE),-p)		\
-			      -a $(ARCH)				\
-		  >/dev/null;						\
-		test -s $@ || rm -f $@
+cmd_cc_symtypes_c =                                                         \
+    set -e;                                                                 \
+    $(call cmd_gensymtypes, true) >/dev/null;                               \
+    test -s $@ || rm -f $@
 
 $(obj)/%.symtypes : $(src)/%.c FORCE
 	$(call cmd,cc_symtypes_c)
@@ -191,14 +191,8 @@ else
 cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
 cmd_modversions =							\
 	if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then	\
-		$(CPP) -D__GENKSYMS__ $(c_flags) $<			\
-		| $(GENKSYMS) $(if $(KBUILD_SYMTYPES),			\
-			           -T $(@:.o=.symtypes))		\
-			      -r $(firstword $(wildcard			\
-				     $(@:.o=.symref) /dev/null))	\
-			      $(if $(KBUILD_PRESERVE),-p)		\
-			      -a $(ARCH)				\
-		> $(@D)/.tmp_$(@F:.o=.ver);				\
+		$(call cmd_gensymtypes, $(KBUILD_SYMTYPES))		\
+		    > $(@D)/.tmp_$(@F:.o=.ver);				\
 									\
 		$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) 		\
 			-T $(@D)/.tmp_$(@F:.o=.ver);			\
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kbuild: simplify use of genksyms, Linux Kernel Mailing ..., (Sun Dec 28, 5:59 pm)