diff mbox

[6/6] Makefile: Pass unknown targets through to the kernel make

Message ID 1323107263-1870-7-git-send-email-peter.maydell@linaro.org
State Accepted
Headers show

Commit Message

Peter Maydell Dec. 5, 2011, 5:47 p.m. UTC
Add some convenience rules so we pass unknown targets through
to the kernel makefile. This allows you to say 'make menuconfig'
(for instance) from this directory.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 Makefile |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Comments

Christoffer Dall Dec. 7, 2011, 5:56 a.m. UTC | #1
On Mon, Dec 5, 2011 at 12:47 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Add some convenience rules so we pass unknown targets through
> to the kernel makefile. This allows you to say 'make menuconfig'
> (for instance) from this directory.

I see, lets you basically sit in this directory and do your work. Reasonable.

In that case, perhaps a pseudo-target 'kernel' that always builds the
kernel (no matter if $(KERNEL_SRC)/[zu]Image has changed...

?


>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> [snip]
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 160cabd..e1635ea 100644
--- a/Makefile
+++ b/Makefile
@@ -59,7 +59,6 @@  clean:
 	rm -f $(IMAGE) boot.o model.lds monitor.o uImage
 
 $(KERNEL): $(KERNEL_SRC)/arch/arm/boot/uImage
-	$(MAKE) -C $(KERNEL_SRC) -j4 uImage
 	cp $< $@
 
 $(IMAGE): boot.o monitor.o model.lds $(KERNEL) $(FILESYSTEM) Makefile
@@ -74,4 +73,16 @@  monitor.o: $(MONITOR)
 model.lds: $(LD_SCRIPT) Makefile
 	$(CC) $(CPPFLAGS) -E -P -C -o $@ $<
 
+$(KERNEL_SRC)/arch/arm/boot/uImage: force
+	$(MAKE) -C $(KERNEL_SRC) -j4 uImage
+
+# Pass any target we don't know about through to the kernel makefile.
+# This is a convenience rule so we can say 'make menuconfig' etc here.
+%: force
+	$(MAKE) -C $(KERNEL_SRC) $@
+
+force: ;
+
+Makefile: ;
+
 .PHONY: all clean