Re: [PATCH] headercheck: add dependency check and improve speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 23, 2007 at 03:40:25PM -0400, David Woodhouse wrote:
> On Wed, 2007-05-23 at 21:34 +0200, Sam Ravnborg wrote:
> > On Wed, May 23, 2007 at 03:02:19PM -0400, David Woodhouse wrote:
> > > $ make headers_check
> > > $ sed -i /auxvec.h/d include/asm/Kbuild 
> > > $ make headers_check
> > > $ sed -i /auxvec.h/d include/asm-generic/Kbuild.asm
> > > $ make headers_check
> > > 
> > > Why doesn't it recheck <linux/auxvec.h> and fail?
> > 
> > Because asm/auxvec.h gets pulled by asm-generic/Kbuild.asm
> 
> Not after the 4th command in the above sequence, it doesn't.
Missed that.
This fixes it.

	Sam

diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 6d74b54..7fa28b8 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -51,7 +51,7 @@ ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR))
 endif
 
 # file generated during checktime listing depfiles and incfiles
-depsfile  := $(INSTALL_HDR_PATH)/$(_dst)/.check.cmd
+depsfile  := $(INSTALL_HDR_PATH)/$(_dst)/.check.d
 checkfile := $(INSTALL_HDR_PATH)/$(_dst)/check
 
 
@@ -135,15 +135,16 @@ echo "\# endif" ;							\
 echo "\#endif /* $$STUBDEF */" ;					\
 ) > $@
 
-.PHONY: __headersinst __headerscheck
+PHONY += __headersinst __headerscheck
 
 ifdef HDRCHECK
 __headerscheck: $(subdir-y) $(checkfile)
 	$(Q):
 
-.PHONY: FORCE
+PHONY += FORCE
+targets += $(checkfile)
 $(checkfile): FORCE
-	$(if $?, $(call cmd,check))
+	$(call if_changed,check)
 	$(Q)touch $(checkfile)
 
 # Include autogenerated file listing depfiles and incfiles
@@ -151,6 +152,15 @@ ifneq ($(wildcard $(depsfile)),)
   include $(depsfile)
 endif
 
+targets := $(wildcard $(sort $(targets)))
+cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
+
+ifneq ($(cmd_files),)
+  include $(cmd_files)
+endif
+
+
+
 $(checkfile) : $(depfiles)
 # dummy rule - cannot be made
 $(depfiles) : ;
@@ -195,7 +205,8 @@ altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y)
 	$(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR)
 
 # Recursion
-.PHONY: $(subdir-y)
+PHONY += $(subdir-y)
 $(subdir-y):
 	$(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel)
 
+.PHONY: $(PHONY)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux