From 70b3c1262bec05f587d0ea43cbcccd487d0dc46f Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 2 Aug 2012 09:54:33 +0000 Subject: ar71xx: image: allow to use board specific code in the lzma-loader git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32945 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ar71xx/image/Makefile | 4 ++-- target/linux/ar71xx/image/lzma-loader/Makefile | 2 ++ target/linux/ar71xx/image/lzma-loader/src/Makefile | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'target') diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 3897dd49b..26ac0ab10 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -113,7 +113,7 @@ define Image/BuildLoader -rm -rf $(KDIR)/lzma-loader $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\ LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \ - LOADER_DATA="$(KDIR)/vmlinux.bin.lzma" \ + LOADER_DATA="$(KDIR)/vmlinux.bin.lzma" BOARD="$(1)" \ compile loader.$(2) endef @@ -121,7 +121,7 @@ define Image/BuildLoaderAlone -rm -rf $(KDIR)/lzma-loader $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \ LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \ - FLASH_OFFS=$(4) FLASH_MAX=$(5) \ + BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \ compile loader.$(2) endef diff --git a/target/linux/ar71xx/image/lzma-loader/Makefile b/target/linux/ar71xx/image/lzma-loader/Makefile index 8d36691cb..2e0b9111f 100644 --- a/target/linux/ar71xx/image/lzma-loader/Makefile +++ b/target/linux/ar71xx/image/lzma-loader/Makefile @@ -15,6 +15,7 @@ LOADER_DATA := TARGET_DIR := FLASH_OFFS := FLASH_MAX := +BOARD := ifeq ($(TARGET_DIR),) TARGET_DIR := $(KDIR) @@ -40,6 +41,7 @@ loader-compile: $(PKG_BUILD_DIR)/.prepared LOADER_DATA=$(LOADER_DATA) \ FLASH_OFFS=$(FLASH_OFFS) \ FLASH_MAX=$(FLASH_MAX) \ + BOARD="$(BOARD)" \ clean all loader.gz: $(PKG_BUILD_DIR)/loader.bin diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile index c5965c9bd..3e6839c7c 100644 --- a/target/linux/ar71xx/image/lzma-loader/src/Makefile +++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile @@ -18,7 +18,7 @@ LOADADDR := LZMA_TEXT_START := 0x80a00000 LOADER_DATA := -CONFIG_BOARD := +BOARD := FLASH_OFFS := FLASH_MAX := @@ -63,6 +63,11 @@ ifneq ($(strip $(FLASH_MAX)),) CFLAGS += -DCONFIG_FLASH_MAX=$(FLASH_MAX) endif +BOARD_DEF := $(shell echo $(strip $(BOARD)) | tr a-z A-Z | tr - _) +ifneq ($(BOARD_DEF),) +CFLAGS += -DCONFIG_BOARD_$(BOARD_DEF) +endif + all: loader.bin # Don't build dependencies, this may die if $(CC) isn't gcc -- cgit v1.2.3