X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/12603cc0fbbfd50d11d764c2f91c3ae182a20d65..0840c2ef25cbbe1634b050ba5c8bc1b036129d83:/target/linux/adm5120-2.6/image/lzma-loader/src/Makefile diff --git a/target/linux/adm5120-2.6/image/lzma-loader/src/Makefile b/target/linux/adm5120-2.6/image/lzma-loader/src/Makefile index 0f4ffa63a..a553b7fde 100644 --- a/target/linux/adm5120-2.6/image/lzma-loader/src/Makefile +++ b/target/linux/adm5120-2.6/image/lzma-loader/src/Makefile @@ -16,7 +16,7 @@ # Copyright 2005 Oleg I. Vdovikin # Cleaned up, modified for lzma support, removed from kernel # -# Copyright 2007 Gabor Juhos +# Copyright 2007 Gabor Juhos # Modified to support user defined entry point address. # Added support for make targets with different names # @@ -25,6 +25,8 @@ LOADADDR := 0x80001000 LZMA_TEXT_START := 0x80500000 LZMA_STARTUP_ORG:= 0 LOADER_DATA := +CONFIG_PASS_KARGS := +CONFIG_BOARD := CC := $(CROSS_COMPILE)gcc LD := $(CROSS_COMPILE)ld @@ -36,6 +38,7 @@ BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug -S 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) @@ -46,7 +49,7 @@ LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START) 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 @@ -55,6 +58,16 @@ else 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 @@ -80,7 +93,7 @@ loader.elf: $(OBJECTS) mrproper: clean clean: - rm -f *.gz *.elf *.bin *.o + rm -f *.elf *.bin *.o