[U-Boot] [PATCH/next] add %.c->%.i and %.c->%.s rules

Mike Frysinger vapier at gentoo.org
Sun Jun 14 17:03:48 CEST 2009


The Linux kernel has some helper rules which allow you to quickly produce
some of the intermediary files from C source.  Specifically, you can
create .i files which is the preprocessed output and you can create .s
files which is the assembler output.  This is useful when you are trying
to track down header/macro expansion errors or inline assembly errors.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
note: this depends on the "per-file/dir flags customization" patch

 config.mk |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index f5b9c28..7fc0453 100644
--- a/config.mk
+++ b/config.mk
@@ -214,5 +214,9 @@ $(obj)%.o:	%.S
 	$(CC)  $(AFLAGS) $(AFLAGS_$(@F)) $(AFLAGS_$(BCURDIR)) -o $@ $< -c
 $(obj)%.o:	%.c
 	$(CC)  $(CFLAGS) $(CFLAGS_$(@F)) $(CFLAGS_$(BCURDIR)) -o $@ $< -c
+$(obj)%.i:	%.c
+	$(CPP) $(CFLAGS) $(CFLAGS_$(@F)) $(CFLAGS_$(BCURDIR)) -o $@ $< -c
+$(obj)%.s:	%.c
+	$(CC)  $(CFLAGS) $(CFLAGS_$(@F)) $(CFLAGS_$(BCURDIR)) -o $@ $< -c -S
 
 #########################################################################
-- 
1.6.3.1



More information about the U-Boot mailing list