Skip to contentSkip to conversation

Dependencies for headers_install, 'make headers_install_all'

PATCH New David Woodhouse 1 participant 1 message Sep 21, 2006 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Dependencies for headers_install, 'make headers_install_all'

This patch implements (hopefully) sane dependencies for installing headers, so we don't just remove the entire export directory and start again each time. It should handle removing of files which are no longer exported, and re-exporting anything which might have changed.

It also implements a 'make headers_install_all' which exports headers for _all_ architectures, which is suitable for making a tarball of kernel headers.

It will allow us to also use similar dependencies for _checking_ headers only when they change, although that is not yet fully implemented.

Makefile +11 -3
index 33074e8..fa72626 100644
@@ -892,18 +892,26 @@ # Kernel headers
 INSTALL_HDR_PATH=$(objtree)/usr
 export INSTALL_HDR_PATH
 
+HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
+
+PHONY += headers_install_all
+headers_install_all: include/linux/version.h
+	$(Q)unifdef -Ux /dev/null
+	$(Q)for arch in $(HDRARCHES); do \
+	 $(MAKE) ARCH=$$arch -rR -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch __headersinst ;\
+	 done
+
 PHONY += headers_install
 headers_install: include/linux/version.h
 	@if [ ! -r include/asm-$(ARCH)/Kbuild ]; then \
 	  echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \
 	  exit 1 ; fi
 	$(Q)unifdef -Ux /dev/null
-	$(Q)rm -rf $(INSTALL_HDR_PATH)/include
-	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include
+	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include __headersinst
 
 PHONY += headers_check
 headers_check: headers_install
-	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1
+	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include __headerscheck
 
 # ---------------------------------------------------------------------------
 # Modules

b/include/asm-x86_64/Kbuild

scripts/Makefile.headersinst +76 -48

203 lines not on this page · raw message

scripts/hdrcheck.sh +2 -0
index b5ca35a..3159858 100755
@@ -6,3 +6,5 @@ for FILE in `grep '^[ \t]*#[ \t]*include
 	exit 1
     fi
 done
+# FIXME: List dependencies into $3
+touch $3
Signature · 1 line
dwmw2