[PATCH v2] arm/dt: Add a make rule to build dtb for enabled boards

Andy Green andy at warmcat.com
Thu Apr 7 07:30:03 UTC 2011


On 04/04/2011 04:01 PM, Somebody in the thread at some point said:

Hi -

> With 'make ARCH=arm dtb', it builds Device Tree Blobs for those boards
> enabled by build CONFIG.

> index d51ab6c..7fd2af9 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -292,6 +292,9 @@ zinstall uinstall install: vmlinux
>   %.dtb:
>   	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
>
> +dtb:
> +	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
> +

The version of this that went into linux-linaro-2.6.38 looks like this

X-Git-Url: 
http://git.linaro.org/gitweb?p=kernel%2Flinux-linaro-2.6.38.git;a=blobdiff_plain;f=arch%2Farm%2FMakefile;h=1be856a21093241d24ee7ba41de2bc3f0fccff4f;hp=d51ab6c6482aa186055eaf3cd218e07f6a872743;hb=1449fb96cb7f12a28a4f0aebf83c0b0ece0dfeed;hpb=7c4bc9c2662c6d9840afed0e29eb01314af9bb78

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d51ab6c..1be856a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -289,7 +289,7 @@ zImage Image xipImage bootpImage uImage: vmlinux
  zinstall uinstall install: vmlinux
  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@

-%.dtb:
+dtbs %.dtb:
  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@

  # We use MRPROPER_FILES and CLEAN_FILES now

On recent make, it breaks build of the kernel immediately:

/projects/linaro/linux-2.6/arch/arm/Makefile:292: *** mixed implicit and 
normal rules.  Stop.

$ rpm -q make
make-3.82-4.fc15.x86_64

''The previous behavior of mixing implicit and pattern rules in one line
like that was never supported or documented, but due to a "hole" in the
parser it worked for certain specific cases (for example, reversing that
line so the pattern comes first would not work, nor would adding extra
explicit targets after the pattern target).

In 3.82, the parser was tightened in this respect and that "hole" was
closed, hence you see this error.''

http://www.mail-archive.com/bug-make@gnu.org/msg06220.html

I worked around it by changing the line back to just say

%.dtb:

but I don't know if that does what was actually intended the same; 
according to the linked make ml post it may need to be two clauses.

-Andy



More information about the linaro-kernel mailing list