LIB    := $(obj)libmisc.a
 
-COBJS-y += ali512x.o
-COBJS-y += ns87308.o
-COBJS-y += status_led.o
+COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
+COBJS-$(CONFIG_NS87308) += ns87308.o
+COBJS-$(CONFIG_STATUS_LED) += status_led.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 
 
 #include <config.h>
 
-#ifdef CONFIG_ALI152X
-
 #include <common.h>
 #include <asm/io.h>
 #include <asm/ic/ali512x.h>
 
        return data & bit;
 }
-
-
-#endif
 
 
 #include <config.h>
 
-#ifdef CFG_NS87308
-
 #include <ns87308.h>
 
 void initialise_ns87308 (void)
        PNP_PGCS_CSLINE_CONF(2, CFG_NS87308_CS2_CONF);
 #endif
 }
-
-#endif
 
 
 /* ------------------------------------------------------------------------- */
 
-#ifdef CONFIG_STATUS_LED
-
 typedef struct {
        led_id_t mask;
        int state;
        }
        __led_set (ld->mask, state);
 }
-
-#endif /* CONFIG_STATUS_LED */
 
 #ifdef CFG_NS16550_SERIAL
 
 #include <ns16550.h>
-#ifdef CFG_NS87308
+#ifdef CONFIG_NS87308
 #include <ns87308.h>
 #endif
 
 {
        int clock_divisor;
 
-#ifdef CFG_NS87308
+#ifdef CONFIG_NS87308
        initialise_ns87308();
 #endif
 
 
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308                    /* Nat Semi super-io cntr on ISA bus */
+#define CONFIG_NS87308                    /* Nat Semi super-io cntr on ISA bus */
 #define CFG_NS87308_BADDR_10    1
 #define CFG_NS87308_DEVS        (CFG_NS87308_UART1   | \
                                 CFG_NS87308_UART2   | \
 
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308                    /* Nat Semi super-io controller on ISA bus */
+#define CONFIG_NS87308                 /* Nat Semi super-io controller on ISA bus */
 
 #define CFG_NS87308_BADDR_10   1
 
 
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308                    /* Nat Semi super-io controller on ISA bus */
+#define CONFIG_NS87308                 /* Nat Semi super-io controller on ISA bus */
 
 #define CFG_NS87308_BADDR_10   1
 
 
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308                    /* Nat Semi super-io controller on ISA bus */
+#define CONFIG_NS87308                 /* Nat Semi super-io controller on ISA bus */
 
 #define CFG_NS87308_BADDR_10   1