[U-Boot] how are "CONFIG_*" variables processed by Makefiles?

Benoît Thébaudeau benoit.thebaudeau at advansee.com
Wed Nov 14 16:58:44 CET 2012


Dear Robert P. J. Day,

On Wednesday, November 14, 2012 4:35:15 PM, Robert P. J. Day wrote:
>   i'm sure there's a trivial explanation for this that i'm missing
>   but
> i'm looking at this snippet from arch/arm/cpu/armv7/omap3/Makefile:
> 
> ... snip ...
> COBJS   += board.o
> COBJS   += clock.o
> COBJS   += mem.o
> COBJS   += sys_info.o
> ifdef CONFIG_SPL_BUILD
> COBJS-$(CONFIG_SPL_OMAP3_ID_NAND)       += spl_id_nand.o
> endif
> 
> COBJS-$(CONFIG_DRIVER_TI_EMAC)  += emac.o
> COBJS-$(CONFIG_EMIF4)   += emif4.o
> COBJS-$(CONFIG_SDRC)    += sdrc.o        <--- this line, eg.
> 
> SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> OBJS    := $(addprefix $(obj),$(COBJS) $(COBJS-y) $(SOBJS))
> ... snip ...
> 
>   how does the fact that the beagle that i'm building for, which
> defines:
> 
> include/configs/omap3_beagle.h:#define CONFIG_SDRC
> 
> translate that simple #define into a value that can be used by the
> Makefile to select sdrc.o to be compiled?
> 
>   i'm used to the linux kernel config process which explicitly sets
> the variables to the string "y", so that, in the above, the variable
> $(COBJS-y) would pick up those conditional compilations.
> 
>   but what is happening here?  i'm sure it's simple, i just don't see
> where it's happening in the config and build process.  thanks.

Take a look at the following rule in the main Makefile:
$(obj)include/autoconf.mk: $(obj)include/config.h

Best regards,
Benoît


More information about the U-Boot mailing list