Skip to contentSkip to conversation

Move the preprocessor test for building flash.c to the Makefile.

PATCH New Robert P. J. Day 2 participants 3 messages Nov 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Move the preprocessor test for building flash.c to the Makefile.

Move the preprocessor test of CONFIG_SYS_NO_FLASH out of flash.c and back to the Makefile, for readability.

---

this one is a little uglier since it adds an "#ifndef" check to the
Makefile, but i still consider this to be more readable since it's potentially misleading to have a hard-coded build of a file in the Makefile, only to have to go that file to notice that a subsequent preprocessor check takes the file out of play. except in weird circumstances, tests like that should be in the Makefile.

i don't think there's a lot of this left.

common/Makefile +2 -0
index 3781738..69629f5 100644
@@ -152,7 +152,9 @@ COBJS-$(CONFIG_VFD) += cmd_vfd.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
+#ifndef CONFIG_SYS_NO_FLASH
 COBJS-y += flash.o
+#endif
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
 COBJS-$(CONFIG_LCD) += lcd.o
common/flash.c +0 -6
index eb4b2f5..f5da566 100644
@@ -26,8 +26,6 @@
 #include <common.h>
 #include <flash.h>
 
-#if !defined(CONFIG_SYS_NO_FLASH)
-
 extern flash_info_t  flash_info[]; /* info for FLASH chips */
 
 /*-----------------------------------------------------------------------
@@ -222,7 +220,3 @@ void flash_perror (int err)
 		break;
 	}
 }
-
-/*-----------------------------------------------------------------------
- */
-#endif /* !CONFIG_SYS_NO_FLASH */

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

========================================================================

#1 lore raw

PATCH 1/1 Move the preprocessor test for building flash.c to the Makefile.

common/Makefile COBJS-$(CONFIG_VFD) += cmd_vfd.o · line 160

Quoted 12 lines · On Thursday 19 November 2009 12:38:42 Robert P. J. Day wrote:
common/Makefile +2 -0
@@ -152,7 +152,9 @@ COBJS-$(CONFIG_VFD) += cmd_vfd.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
+#ifndef CONFIG_SYS_NO_FLASH
 COBJS-y += flash.o
+#endif
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
 COBJS-$(CONFIG_LCD) += lcd.o

me thinks you did not test this and/or you dont know how Makefile's work and/or you forgot to remove debug comments.

regardless, obvious NACK
-mike
-------------- 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/20091119/173841e0/attachment.pgp

#2 lore raw

PATCH 1/1 Move the preprocessor test for building flash.c to the Makefile.

Quoted 17 lines · Mike Frysinger

common/Makefile COBJS-$(CONFIG_VFD) += cmd_vfd.o · line 160

Quoted 12 lines · On Thursday 19 November 2009 12:38:42 Robert P. J. Day wrote:
common/Makefile +2 -0
@@ -152,7 +152,9 @@ COBJS-$(CONFIG_VFD) += cmd_vfd.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
+#ifndef CONFIG_SYS_NO_FLASH
 COBJS-y += flash.o
+#endif
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
 COBJS-$(CONFIG_LCD) += lcd.o

me thinks you did not test this and/or you dont know how Makefile's work and/or you forgot to remove debug comments.

Quoted 2 lines

regardless, obvious NACK
-mike

oh, crap, that's what i get for getting lazy and not paying
attention. sorry.

rday
--

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

========================================================================