[U-Boot] [PATCH] debug_print macros support

Mike Frysinger vapier at gentoo.org
Mon Apr 6 10:05:17 CEST 2009


On Monday 06 April 2009 03:56:39 Wolfgang Denk wrote:
> In message Prafulla Wadaskar wrote:
> > > This seems to be a lot of effort, from code to command line pollution
> > > - for what exactly?
> > >
> > > Which is the problem you are trying to solve?
> >
> > If I understood current u-boot debugging properly, the debug statements
> > are enabled by editing src file by adding "#define DEBUG"
> > Doing this the release contents will be tampered,
>
> This is just one way to solve this, which is most convenient when you
> want to enable debugging on a  per-file  level.  Of  course  you  can
> acchieve  the  same  effect  by  just  passing "-DDEBUG" as a compile
> option. The Makefile allows to do this globally - there are currently
> no fine-grained selections available by default.

i havent tested it, but i think this should get fine-grained flags in a 
flexible manner ?  (the out of tree isnt exact, but you see what i'm after)
-mike

diff --git a/config.mk b/config.mk
index b1254e9..8791caa 100644
--- a/config.mk
+++ b/config.mk
@@ -209,20 +209,20 @@ export	TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS 
CPPFLAGS CFLAGS AFLAGS
 ifndef REMOTE_BUILD
 
 %.s:	%.S
-	$(CPP) $(AFLAGS) -o $@ $<
+	$(CPP) $(AFLAGS) $(AFLAGS_$@) -o $@ $<
 %.o:	%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
+	$(CC) $(AFLAGS) $(AFLAGS_$@) -c -o $@ $<
 %.o:	%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(CFLAGS_$@) -c -o $@ $<
 
 else
 
 $(obj)%.s:	%.S
-	$(CPP) $(AFLAGS) -o $@ $<
+	$(CPP) $(AFLAGS) $(AFLAGS_$@) -o $@ $<
 $(obj)%.o:	%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
+	$(CC) $(AFLAGS) $(AFLAGS_$@) -c -o $@ $<
 $(obj)%.o:	%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(CFLAGS_$@) -c -o $@ $<
 endif
 
 #########################################################################

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090406/3b97a2d1/attachment.pgp 


More information about the U-Boot mailing list