On Mon, Dec 06, 2010 at 09:35:59AM -0800, dirk.brandewie@xxxxxxxxx wrote:From: Dirk Brandewie<dirk.brandewie@xxxxxxxxx>
-
+# DTC
+# ---------------------------------------------------------------------------
+
+# Generate an assembly file to wrap the output of the device tree compiler
+$(obj)/%.dtb.S: $(obj)/%.dtb
+ @echo '#include<asm-generic/vmlinux.lds.h>'> $@
+ @echo '.section .dtb.init.rodata,"a"'>> $@
+ @echo '.balign STRUCT_ALIGNMENT'>> $@
+ @echo '.global __dtb_$(*F)_begin'>> $@
+ @echo '__dtb_$(*F)_begin:'>> $@
+ @echo '.incbin "$<" '>> $@
+ @echo '__dtb_$(*F)_end:'>> $@
+ @echo '.global __dtb_$(*F)_end'>> $@
+ @echo '.balign STRUCT_ALIGNMENT'>> $@
+
If we really want this rule in Makefile.lib then at least make it less verbose,
and more secure.
Something like this:
quiet_dt_S_dtb_cmd = DTB $@
dt_S_dtb_cmd = \
( \
@echo '#include<asm-generic/vmlinux.lds.h>'; \
@echo '.section .dtb.init.rodata,"a"'; \
@echo '.balign STRUCT_ALIGNMENT'; \
echo '.global __dtb_$(*F)_begin'; \
echo '__dtb_$(*F)_begin:'; \
echo '.incbin "$<" '; \
echo '__dtb_$(*F)_end:'; \
echo '.global __dtb_$(*F)_end'; \
echo '.balign STRUCT_ALIGNMENT'; \
)> $@
$(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd,dt_S_dtb)
+DTC = $(objtree)/scripts/dtc/dtc
If this is the only spot where we use DTC then drop the variable.
+
+quiet_cmd_dtc = DTC $@
+ cmd_dtc = $(DTC) -O dtb -o $@ -b 0 $(DTC_FLAGS) $<
+ooo
What is the purpose of these "ooo"? A debugging left-over?
Sam