-echo "#define CONFIG_MK_${BOARD_NAME} 1" >>config.h
-echo "#include <configs/$1.h>" >>config.h
-echo "#include <asm/config.h>" >>config.h
+
+for i in ${TARGETS} ; do
+ echo "#define CONFIG_MK_${i} 1" >>config.h ;
+done
+
+cat << EOF >> config.h
+#define CONFIG_BOARDDIR board/$BOARDDIR
+#include <config_defaults.h>
+#include <configs/$1.h>
+#include <asm/config.h>
+EOF