LZMA_TEXT_START := 0x80500000
LZMA_STARTUP_ORG:= 0
LOADER_DATA :=
+CONFIG_PASS_KARGS :=
+CONFIG_BOARD :=
CC := $(CROSS_COMPILE)gcc
LD := $(CROSS_COMPILE)ld
CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic \
-ffunction-sections -pipe -mlong-calls -fno-common \
+ -ffreestanding \
-mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap
CFLAGS += -DLOADADDR=$(LOADADDR)
O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
-OBJECTS := head.o decompress.o board.o LzmaDecode.o
+OBJECTS := head.o decompress.o board.o printf.o LzmaDecode.o
ifneq ($(strip $(LOADER_DATA)),)
OBJECTS += data.o
CFLAGS += -D_LZMA_IN_CB
endif
+ifneq ($(strip $(CONFIG_PASS_KARGS)),)
+CFLAGS += -DCONFIG_PASS_KARGS
+endif
+
+BOARD_DEF := $(strip $(CONFIG_BOARD))
+BOARD_DEF := $(shell echo $(BOARD_DEF) | tr a-z A-Z | tr -d -)
+ifneq ($(BOARD_DEF),)
+CFLAGS += -DCONFIG_BOARD_$(BOARD_DEF)
+endif
+
all: loader.bin
# Don't build dependencies, this may die if $(CC) isn't gcc
mrproper: clean
clean:
- rm -f *.gz *.elf *.bin *.o
+ rm -f *.elf *.bin *.o