All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: linuxppc-dev@ozlabs.org
Cc: Paul Mackerras <paulus@samba.org>
Subject: [PATCH 3/7] boot: use FORCE
Date: Mon, 19 Mar 2007 14:58:03 -0600 (CST)	[thread overview]
Message-ID: <boot-03.miltonm@bga.com> (raw)
In-Reply-To: <boot-00.miltonm@bga.com>

Kbuild if_changed and if_changed_dep require the use of the dummy
FORCE to get the dependencies right.   Also add to targets to get
correct behavior.

Signed-off-by: Milton Miller <miltonm@bga.com>
--- 
Testing: Several repeat runs with V=2 and going up and down this series.
Without this, there were several missed rebuilds.
 Makefile |   24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

Index: kernel/arch/powerpc/boot/Makefile
===================================================================
--- kernel.orig/arch/powerpc/boot/Makefile	2007-03-19 09:15:06.000000000 -0500
+++ kernel/arch/powerpc/boot/Makefile	2007-03-19 09:15:19.000000000 -0500
@@ -85,24 +85,25 @@ quiet_cmd_bootas = BOOTAS  $@
       cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
 
 quiet_cmd_bootar = BOOTAR  $@
-      cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $^; mv $@.$$$$ $@
+      cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
 
-$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c
+$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
 	$(call if_changed_dep,bootcc)
-$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
+$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
 	$(call if_changed_dep,bootas)
 
-$(obj)/wrapper.a: $(obj-wlib)
-	$(call cmd,bootar)
+$(obj)/wrapper.a: $(obj-wlib) FORCE
+	$(call if_changed,bootar)
 
 hostprogs-y	:= addnote addRamDisk hack-coff mktree
 
+targets		+= $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
 extra-y		:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
 		   $(obj)/zImage.lds $(obj)/zImage.coff.lds
 
 wrapper		:=$(srctree)/$(src)/wrapper
 wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
-			$(wrapper)
+			$(wrapper) FORCE
 
 #############
 # Bits for building various flavours of zImage
@@ -127,7 +128,7 @@ $(obj)/zImage.initrd.ps3: vmlinux
 	@echo "  WARNING zImage.initrd.ps3 not supported (yet)"
 
 $(obj)/uImage: vmlinux $(wrapperbits)
-	$(call cmd,wrap,uboot)
+	$(call if_changed,wrap,uboot)
 
 image-$(CONFIG_PPC_PSERIES)		+= zImage.pseries
 image-$(CONFIG_PPC_MAPLE)		+= zImage.pseries
@@ -146,19 +147,20 @@ image-$(CONFIG_PPC_PMAC)	+= zImage.coff 
 endif
 
 initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y))
+targets	+= $(image-y) $(initrd-y)
 
 $(addprefix $(obj)/,$(filter-out uImage zImage.ps3,$(image-y))): \
 		$(obj)/zImage.%: vmlinux $(wrapperbits)
-	$(call cmd,wrap,$(patsubst $(obj)/zImage.%,%,$@))
+	$(call if_changed,wrap,$(patsubst $(obj)/zImage.%,%,$@))
 
 $(addprefix $(obj)/,$(filter-out uImage zImage.initrd.ps3,$(initrd-y))): \
 		$(obj)/zImage.initrd.%: vmlinux $(wrapperbits) \
 		$(obj)/ramdisk.image.gz
-	$(call cmd,wrap_initrd,$(patsubst $(obj)/zImage.initrd.%,%,$@),,,$(obj)/ramdisk.image.gz)
+	$(call if_changed,wrap,$(patsubst $(obj)/zImage.initrd.%,%,$@),,,$(obj)/ramdisk.image.gz)
 
-$(obj)/zImage:		$(addprefix $(obj)/, $(image-y))
+$(obj)/zImage:		$(addprefix $(obj)/, $(image-y)) FORCE
 	@rm -f $@; ln $< $@
-$(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y))
+$(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y)) FORCE
 	@rm -f $@; ln $< $@
 
 install: $(CONFIGURE) $(image-y)

  parent reply	other threads:[~2007-03-19 21:06 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 20:55 [PATCH 0/7] boot: cleanup and prep for more platforms Milton Miller
2007-03-19 20:58 ` [PATCH 4/7] bootwrapper: add a fatal error helper Milton Miller
2007-03-20  0:38   ` David Gibson
2007-03-20 13:38     ` Milton Miller
2007-03-21  0:01       ` David Gibson
2007-03-19 20:58 ` Milton Miller [this message]
2007-03-20 15:52   ` [PATCH 3/7] boot: use FORCE Segher Boessenkool
2007-03-19 20:58 ` [PATCH 2/7] boot: rebuild when wrapper changes Milton Miller
2007-03-20  0:36   ` David Gibson
2007-03-20 15:50   ` Segher Boessenkool
2007-03-19 20:58 ` [PATCH 6/7] bootwrapper: allow platforms to call library zImage_start Milton Miller
2007-03-20  4:55   ` David Gibson
2007-03-19 20:58 ` [PATCH 5/7] bootwrapper: missing relocation in crt0.S Milton Miller
2007-03-20  0:39   ` David Gibson
2007-03-20 20:09   ` Mark A. Greer
2007-03-19 20:58 ` [PATCH 7/7] boot: export flush_cache Milton Miller
2007-03-20  4:55   ` David Gibson
2007-03-19 20:58 ` [PATCH 1/7] boot: use a common zImage rule Milton Miller
2007-03-20  3:30   ` David Gibson
2007-03-20 13:47     ` Milton Miller
2007-03-20 17:41       ` Mark A. Greer
2007-03-21  2:46       ` David Gibson
2007-03-21 15:02 ` [PATCH 0/8] boot: cleanup and prep for more platforms Milton Miller
2007-03-21 15:02   ` [PATCH 6/8] boot: use FORCE Milton Miller
2007-03-21 15:02   ` [PATCH 1/8] bootwrapper: add a fatal error helper Milton Miller
2007-03-21 15:02   ` [PATCH 5/8] boot: rebuild when wrapper changes Milton Miller
2007-03-21 15:02   ` [PATCH 3/8] bootwrapper: allow platforms to call library zImage_start Milton Miller
2007-03-21 15:02   ` [PATCH 2/8] bootwrapper: missing relocation in crt0.S Milton Miller
2007-03-23  5:25     ` Paul Mackerras
2007-03-28  8:21       ` [PATCH 0/4] boot: cleanup and prep for more platforms Milton Miller
2007-03-28  8:21         ` [PATCH 1/4] bootwrapper: missing relocation in crt0.S Milton Miller
2007-03-28  8:21         ` [RFC] bootwrapper: allow vmlinuz to be an external payload Milton Miller
2007-03-28  8:21         ` Patch: [PATCH 3/4] bootwrapper: no gzip fixes Milton Miller
2007-03-28 20:03           ` Scott Wood
2007-03-28  8:21         ` [PATCH 2/4] bootwrapper: remove unused variable Milton Miller
2007-03-28  8:34           ` David Gibson
2007-03-28 16:04             ` Milton Miller
2007-03-28  8:21         ` [PATCH 4/4] bootwrapper: decompress less, check more Milton Miller
2007-03-29 13:31           ` Milton Miller
2007-03-21 15:03   ` [PATCH 4/8] boot: export flush_cache Milton Miller
2007-03-21 15:03   ` [PATCH 7/8] boot: clean rule fixes Milton Miller
2007-03-21 15:03   ` [PATCH 8/8] boot: use a common zImage rule Milton Miller
2007-03-22  3:46     ` David Gibson

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=boot-03.miltonm@bga.com \
    --to=miltonm@bga.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.