COBJS-y += devices.o
 COBJS-y += dlmalloc.o
 COBJS-y += exports.o
-COBJS-y += hush.o
+COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
 COBJS-y += memsize.o
 COBJS-y += s_record.o
-COBJS-y += serial.o
+COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 COBJS-y += xyzModem.o
 
 # core command
 COBJS-$(CONFIG_CMD_DOC) += docecc.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
 COBJS-y += flash.o
-COBJS-y += kgdb.o
+COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
 COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 
 /*cmd_boot.c*/
 extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /* do_bootd */
 #endif
-#ifdef CONFIG_SYS_HUSH_PARSER
 #ifndef __U_BOOT__
 #include <ctype.h>     /* isalpha, isdigit */
 #include <unistd.h>    /* getpid */
 );
 
 #endif
-#endif /* CONFIG_SYS_HUSH_PARSER */
 /****************************************************************************/
 
 #include <kgdb.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_KGDB)
-
 #undef KGDB_DEBUG
 
 /*
        "      program if it is executed (see the \"hello_world\"\n"
        "      example program in the U-Boot examples directory)."
 );
-#else
-
-int kgdb_not_configured = 1;
-
-#endif
 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_SERIAL_MULTI)
-
 static struct serial_device *serial_devices = NULL;
 static struct serial_device *serial_current = NULL;
 
 
        serial_current->puts (s);
 }
-
-#endif /* CONFIG_SERIAL_MULTI */