From 4f3be1cfa8422c93271dcdb59f223f6c84c70804 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 16 Nov 2012 15:53:14 +0900 Subject: script: dtc: clean generated files Fix "make distclean" to clean up generated dtc files. Without this patch the following files are left around: - dtc-lexer.lex.c - dtc-parser.tab.c - dtc-parser.tab.h Signed-off-by: Magnus Damm Reviewed-by: Simon Horman Signed-off-by: Grant Likely --- scripts/dtc/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 6d1c6bb..2a48022 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -27,3 +27,5 @@ HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) # dependencies on generated files need to be listed explicitly $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h +# generated files need to be cleaned explicitly +clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h -- cgit v1.1 From 90b335fbbc316b58a0daee8ea792b5aa8903f2ae Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 27 Nov 2012 16:29:10 -0700 Subject: kbuild: centralize .dts->.dtb rule All architectures that use cmd_dtc do so in almost the same way. Create a central build rule to avoid duplication. The one difference is that most current uses of dtc build $(obj)/%.dtb from $(src)/dts/%.dts rather than building the .dtb in the same directory as the .dts file. This difference will be eliminated arch-by-arch in future patches. MIPS is the exception here; it already uses the exact same rule as the new common rule, so the duplicate is removed in this patch to avoid any conflict. arch/mips changes courtesy of Ralf Baechle. Update Documentation/kbuild to remove the explicit call to cmd_dtc from the example, now that the rule exists in a centralized location. Cc: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org Cc: Olof Johansson Cc: Russell King Acked-by: Catalin Marinas Cc: Jonas Bonn Cc: linux@lists.openrisc.net Cc: Aurelien Jacquiot Cc: linux-c6x-dev@linux-c6x.org Cc: Mark Salter Cc: Michal Simek Cc: microblaze-uclinux@itee.uq.edu.au Cc: Chris Zankel Cc: linux-xtensa@linux-xtensa.org Cc: Max Filippov Signed-off-by: Ralf Baechle Signed-off-by: Stephen Warren Signed-off-by: Rob Herring --- scripts/Makefile.lib | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0be6f11..bdf42fd 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb quiet_cmd_dtc = DTC $@ cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< +$(obj)/%.dtb: $(src)/%.dts FORCE + $(call if_changed_dep,dtc) + # Bzip2 # --------------------------------------------------------------------------- -- cgit v1.1