* powerpc: Fix make rules for dtc
@ 2006-10-04 3:37 David Gibson
2006-10-04 3:41 ` powerpc: Fix clean target for empty.c David Gibson
2006-10-05 17:58 ` powerpc: Fix make rules for dtc Segher Boessenkool
0 siblings, 2 replies; 6+ messages in thread
From: David Gibson @ 2006-10-04 3:37 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Paulus, please apply to the powerpc prep2 branch. Not sure if it also
need to go in the powerpc master branch.
There are a couple of errors in the make rules for invoking dtc in
arch/powerpc/boot. First, dtc does not generate gcc -MD style .d
files, so should be invoked via the 'if_changed' macro, rather than
'if_changed_dep'. Secondly, the clean-files target was missing an
entry to clean the generated .dtb files.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Index: working-2.6/arch/powerpc/boot/Makefile
===================================================================
--- working-2.6.orig/arch/powerpc/boot/Makefile 2006-10-04 13:31:46.000000000 +1000
+++ working-2.6/arch/powerpc/boot/Makefile 2006-10-04 13:31:54.000000000 +1000
@@ -74,7 +74,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds
@cp $< $@
clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
- $(obj)/empty.c
+ $(obj)/empty.c *.dtb
quiet_cmd_bootcc = BOOTCC $@
cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
@@ -93,7 +93,7 @@ $(patsubst %.c,%.o, $(filter %.c, $(src-
$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
$(call if_changed_dep,bootas)
$(obj)/%.dtb: $(srctree)/$(src)/dts/%.dts
- $(call if_changed_dep,dtc)
+ $(call if_changed,dtc)
$(obj)/wrapper.a: $(obj-wlib)
$(call cmd,bootar)
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 6+ messages in thread
* powerpc: Fix clean target for empty.c
2006-10-04 3:37 powerpc: Fix make rules for dtc David Gibson
@ 2006-10-04 3:41 ` David Gibson
2006-10-05 17:58 ` powerpc: Fix make rules for dtc Segher Boessenkool
1 sibling, 0 replies; 6+ messages in thread
From: David Gibson @ 2006-10-04 3:41 UTC (permalink / raw)
To: Paul Mackerras, linuxppc-dev
Paulus, another tiny fix. Applies after by fix for the dtc make rules.
The files listed in the clean-files variable should not include the
$(obj) prefix. This patch corrects this for
arch/powerpc/boot/empty.c, which was not previously removed on "make
clean" for this reason.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Index: working-2.6/arch/powerpc/boot/Makefile
===================================================================
--- working-2.6.orig/arch/powerpc/boot/Makefile 2006-10-04 13:31:54.000000000 +1000
+++ working-2.6/arch/powerpc/boot/Makefile 2006-10-04 13:38:31.000000000 +1000
@@ -74,7 +74,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds
@cp $< $@
clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
- $(obj)/empty.c *.dtb
+ empty.c *.dtb
quiet_cmd_bootcc = BOOTCC $@
cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc: Fix make rules for dtc
2006-10-04 3:37 powerpc: Fix make rules for dtc David Gibson
2006-10-04 3:41 ` powerpc: Fix clean target for empty.c David Gibson
@ 2006-10-05 17:58 ` Segher Boessenkool
2006-10-09 0:29 ` David Gibson
1 sibling, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2006-10-05 17:58 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev, Paul Mackerras
> clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
> - $(obj)/empty.c
> + $(obj)/empty.c *.dtb
If this wildcard works at all, it will still do the wrong thing:
deleting all .dtb files (even the ones that the Makefile cannot
create again, e.g., the user put them in the tree manually) is
at best not very polite.
Segher
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc: Fix make rules for dtc
2006-10-05 17:58 ` powerpc: Fix make rules for dtc Segher Boessenkool
@ 2006-10-09 0:29 ` David Gibson
2006-10-09 14:21 ` Segher Boessenkool
0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2006-10-09 0:29 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, Paul Mackerras
On Thu, Oct 05, 2006 at 07:58:59PM +0200, Segher Boessenkool wrote:
> > clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
> > - $(obj)/empty.c
> > + $(obj)/empty.c *.dtb
>
> If this wildcard works at all, it will still do the wrong thing:
> deleting all .dtb files (even the ones that the Makefile cannot
> create again, e.g., the user put them in the tree manually) is
> at best not very polite.
It certainly works at all (the preceding $(obj)/empty.c, however, is
wrong, I've sent a separate patch for that). One could say the same
thing for *.o in clean targets, though I guess adding .dtb files is
rather more likely. However, I can't seen an obvious way of
generating a list of the re-creatable dtbs, without an explicit
listing of every file in arch/powerpc/boot/dts which sounds like a bit
of a pain. Suggestions?
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc: Fix make rules for dtc
2006-10-09 0:29 ` David Gibson
@ 2006-10-09 14:21 ` Segher Boessenkool
2006-10-10 0:23 ` David Gibson
0 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2006-10-09 14:21 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev, Paul Mackerras
>>> clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
>>> - $(obj)/empty.c
>>> + $(obj)/empty.c *.dtb
>>
>> If this wildcard works at all, it will still do the wrong thing:
>> deleting all .dtb files (even the ones that the Makefile cannot
>> create again, e.g., the user put them in the tree manually) is
>> at best not very polite.
>
> It certainly works at all
My problem with it is the := which might be expanded at the wrong
time. Or maybe that won't glob the *.dtb yet, who knows. It's
not obviously "working" either way.
> (the preceding $(obj)/empty.c, however, is
> wrong, I've sent a separate patch for that). One could say the same
> thing for *.o in clean targets,
Yes, and that's a very well-known problem.
> though I guess adding .dtb files is
> rather more likely. However, I can't seen an obvious way of
> generating a list of the re-creatable dtbs, without an explicit
> listing of every file in arch/powerpc/boot/dts which sounds like a bit
> of a pain. Suggestions?
You shouldn't clean _all_ dtb's that you could build, only the dtb's
that you _did_ build. You already have a rule for what dtb's to
build I assume; just copy the logic from there.
Segher
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc: Fix make rules for dtc
2006-10-09 14:21 ` Segher Boessenkool
@ 2006-10-10 0:23 ` David Gibson
0 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2006-10-10 0:23 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, Paul Mackerras
On Mon, Oct 09, 2006 at 04:21:31PM +0200, Segher Boessenkool wrote:
> >>> clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
> >>> - $(obj)/empty.c
> >>> + $(obj)/empty.c *.dtb
> >>
> >> If this wildcard works at all, it will still do the wrong thing:
> >> deleting all .dtb files (even the ones that the Makefile cannot
> >> create again, e.g., the user put them in the tree manually) is
> >> at best not very polite.
> >
> > It certainly works at all
>
> My problem with it is the := which might be expanded at the wrong
> time. Or maybe that won't glob the *.dtb yet, who knows.
*I* know, because I checked the Kbuild rules first, and verified that
globs are legal in the clean-files variable.
> It's
> not obviously "working" either way.
> > (the preceding $(obj)/empty.c, however, is
> > wrong, I've sent a separate patch for that). One could say the same
> > thing for *.o in clean targets,
>
> Yes, and that's a very well-known problem.
>
> > though I guess adding .dtb files is
> > rather more likely. However, I can't seen an obvious way of
> > generating a list of the re-creatable dtbs, without an explicit
> > listing of every file in arch/powerpc/boot/dts which sounds like a bit
> > of a pain. Suggestions?
>
> You shouldn't clean _all_ dtb's that you could build, only the dtb's
> that you _did_ build. You already have a rule for what dtb's to
> build I assume; just copy the logic from there.
No. clean rules never work this way, because if you change the config
between building and cleaning, things won't get cleaned (which is why
clean rules are just about the only place one uses globs in makefiles,
rather than expanding variables appropriately).
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-10-10 0:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-04 3:37 powerpc: Fix make rules for dtc David Gibson
2006-10-04 3:41 ` powerpc: Fix clean target for empty.c David Gibson
2006-10-05 17:58 ` powerpc: Fix make rules for dtc Segher Boessenkool
2006-10-09 0:29 ` David Gibson
2006-10-09 14:21 ` Segher Boessenkool
2006-10-10 0:23 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).