[tools] disable mpfr tests compilation, slightly speeds up the build process
[openwrt.git] / include / kernel-build.mk
index 477c9ee..e3e446b 100644 (file)
@@ -54,6 +54,28 @@ define BuildKernel
        $(Kernel/Prepare)
        touch $$@
 
        $(Kernel/Prepare)
        touch $$@
 
+  $(KERNEL_BUILD_DIR)/symtab.txt: FORCE
+       find $(LINUX_DIR) $(STAGING_DIR_ROOT)/lib/modules -name \*.ko | \
+               xargs $(TARGET_CROSS)nm | \
+               awk '$$$$1 == "U" { print $$$$2 } ' | \
+               sort -u > $$@
+
+  $(KERNEL_BUILD_DIR)/symtab.h: $(KERNEL_BUILD_DIR)/symtab.txt
+       ( \
+               echo '#define SYMTAB_KEEP \'; \
+               cat $(KERNEL_BUILD_DIR)/symtab.txt | \
+                       awk '{print "*(__ksymtab." $$$$1 ") \\" }'; \
+               echo; \
+               echo '#define SYMTAB_KEEP_GPL \'; \
+               cat $(KERNEL_BUILD_DIR)/symtab.txt | \
+                       awk '{print "*(__ksymtab_gpl." $$$$1 ") \\" }'; \
+               echo; \
+               echo '#define SYMTAB_KEEP_STR \'; \
+               cat $(KERNEL_BUILD_DIR)/symtab.txt | \
+                       awk '{print "*(__ksymtab_strings." $$$$1 ") \\" }'; \
+               echo; \
+       ) > $$@
+
   $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
        $(Kernel/Configure)
        touch $$@
   $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
        $(Kernel/Configure)
        touch $$@
@@ -62,7 +84,7 @@ define BuildKernel
        $(Kernel/CompileModules)
        touch $$@
 
        $(Kernel/CompileModules)
        touch $$@
 
-  $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
+  $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) $(if $(CONFIG_STRIP_KERNEL_EXPORTS),$(KERNEL_BUILD_DIR)/symtab.h) FORCE
        $(Kernel/CompileImage)
        touch $$@
        
        $(Kernel/CompileImage)
        touch $$@
        
@@ -77,7 +99,7 @@ define BuildKernel
   compile: $(LINUX_DIR)/.modules
        $(MAKE) -C image compile TARGET_BUILD=
 
   compile: $(LINUX_DIR)/.modules
        $(MAKE) -C image compile TARGET_BUILD=
 
-  oldconfig menuconfig: $(STAMP_PREPARED) FORCE
+  oldconfig menuconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
        [ -e "$(LINUX_CONFIG)" ] || touch "$(LINUX_CONFIG)"
        $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
        touch $(LINUX_CONFIG)
        [ -e "$(LINUX_CONFIG)" ] || touch "$(LINUX_CONFIG)"
        $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
        touch $(LINUX_CONFIG)
This page took 0.023875 seconds and 4 git commands to generate.