FLASH_OFFS :=
FLASH_MAX :=
PLATFORM :=
+SUBTARGET :=
CACHE_FLAGS :=
CC := $(CROSS_COMPILE)gcc
OBJDUMP := $(CROSS_COMPILE)objdump
-include $(PLATFORM).mk
-
BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug \
-R .MIPS.abiflags -S
O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
-OBJECTS := head.o loader.o cache.o board-$(PLATFORM).o printf.o LzmaDecode.o
+OBJECTS := head.o loader.o cache.o board.o printf.o LzmaDecode.o
+
+ifeq ($(strip $(SUBTARGET)),)
+$(error "Please specify a SUBTARGET!")
+endif
+
+ifeq ($(strip $(SUBTARGET)),mt7620)
+CFLAGS += -DSOC_MT7620
+endif
+
+ifeq ($(strip $(SUBTARGET)),mt7621)
+CFLAGS += -DSOC_MT7621
+endif
+
+ifeq ($(strip $(SUBTARGET)),rt305x)
+CFLAGS += -DSOC_RT305X
+endif
+
+ifeq ($(strip $(SUBTARGET)),rt3883)
+CFLAGS += -DSOC_RT3883
+endif
ifneq ($(strip $(LOADER_DATA)),)
OBJECTS += data.o