[U-Boot] [PATCH 06/12 V3] autoscript: Move conditional compilation to Makefile

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Aug 29 22:03:59 CEST 2008


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 common/Makefile         |    3 ++-
 common/cmd_autoscript.c |    4 ----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 0c8ef5b..918b908 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -31,7 +31,7 @@ COBJS-y += main.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-y += cmd_autoscript.o
+COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
@@ -148,6 +148,7 @@ COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
+COBJS-y	+= $(COBJS-yy)
 COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c
index 13af93e..c2e7e66 100644
--- a/common/cmd_autoscript.c
+++ b/common/cmd_autoscript.c
@@ -47,8 +47,6 @@
 #include <hush.h>
 #endif
 
-#if defined(CONFIG_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
-
 int
 autoscript (ulong addr, const char *fit_uname)
 {
@@ -200,8 +198,6 @@ autoscript (ulong addr, const char *fit_uname)
 	return rcode;
 }
 
-#endif
-
 /**************************************************/
 #if defined(CONFIG_CMD_AUTOSCRIPT)
 int
-- 
1.5.6.3



More information about the U-Boot mailing list