Skip to contentSkip to conversation

setting TEXT_BASE via make target name

U-Boot Wolfgang Wegner 1 participant 1 message Dec 22, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I am in the process of cleaning up my board code, and just noticed some strange (for me) behaviour when trying to set TEXT_BASE depending on the make target name.

Here is what works:

Makefile:
astro_mcf5373l_config \
astro_mcf5373l_RAM_config : unconfig

	@$(MKCONFIG) -t $(@:_config=) astro_mcf5373l m68k mcf532x mcf5373l astro

include/configs/board_config.h:
#ifdef CONFIG_MK_RAM
#define CONFIG_MONITOR_IS_IN_RAM
#define CONFIG_TEXT_BASE 0x40020000
#else
#define CONFIG_TEXT_BASE 0x00000000
#endif

board_dir/config.mk
TEXT_BASE = $(CONFIG_TEXT_BASE)
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)

It seems a bit strange that I have to use the intermediate variable CONFIG_TEXT_BASE, but setting TEXT_BASE directly in my board_config.h simply does not work, and of course I have to set TEXT_BASE in config.mk to have it exported [to the linking stage].

Is the above "code" ok, or is there a more elegant and thus preferrable way to set TEXT_BASE?

Best regards,
Wolfgang