mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [KBUILD] allow any PHONY in if_changed_dep
Date: Sat, 1 Jul 2006 04:16:56 -0500 (CDT)	[thread overview]
Message-ID: <200607010916.k619GuxT005076@sullivan.realtime.net> (raw)

While all the if_changed family filter $(PHONY) from the list of newer
files, if_changed_dep was only filtering FORCE from the list of all
dependents.  This resulted in forced recompile every time.

Signed-off-by: Milton Miller <miltonm@bga.com>

--- 

Sam,

I have been working on some cleanups in arch/powerpc/boot/Makefile,
switching to if_changed and friends.  There are rules to copy headers
from the kernel environment to the boot environment, applying slight
cleanups.

Currently a subset of the c files depend on the headers, and there is
a manual dependency on the headers.  I was trying to get if_changed_dep
to depend only on the headers actually used, but copy all needed headers
before compiling any C files in the zImage code.  

Does the following patch look ok to you?   It removes all PHONY targets
from the list of all dependents, not just FORCE.  I'm thinking the clause
is to catch files haven't been generated and therefore are not newer but
are still required.  If you want to build every time you can just call cmd.

milton

Two excerpts from the proposed makefile follow:

> -$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
> -#$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h)
> +linuxheader := zlib.h zconf.h zutil.h
> 
> [ $(obj-boot): %.o: %.c ]
>
> +$(obj-boot):  COPYHEADERS
> +COPYHEADERS:	$(addprefix $(obj)/,$(linuxheader) $(zlibheader))
> +PHONY	+= COPYHEADERS


Index: kernel/scripts/Kbuild.include
===================================================================
--- kernel.orig/scripts/Kbuild.include	2006-07-01 00:58:38.926249877 -0500
+++ kernel/scripts/Kbuild.include	2006-07-01 01:02:00.909937514 -0500
@@ -131,7 +131,7 @@ if_changed = $(if $(strip $(filter-out $
 # execute the command and also postprocess generated .d dependencies
 # file
 if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?)  \
-		$(filter-out FORCE $(wildcard $^),$^)    \
+		$(filter-out $(PHONY) $(wildcard $^),$^)    \
 	$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),     \
 	@set -e; \
 	$(echo-cmd) $(cmd_$(1)); \

             reply	other threads:[~2006-07-01  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-01  9:16 Milton Miller [this message]
2006-07-01  9:39 ` Sam Ravnborg
2006-07-01 23:36   ` Milton Miller
     [not found] ` <kexec-zImage-try2@bga.com>
2006-07-01 23:46   ` [3/5][POWERPC] boot: use more Kbuild rules Milton Miller
     [not found] <200607051502.k65F28bO019554@sullivan.realtime.net>
2006-07-05 15:12 ` [KBUILD] allow any PHONY in if_changed_dep Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200607010916.k619GuxT005076@sullivan.realtime.net \
    --to=miltonm@bga.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®