From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Wed, 14 Nov 2012 16:58:44 +0100 (CET) Subject: [U-Boot] how are "CONFIG_*" variables processed by Makefiles? In-Reply-To: Message-ID: <735961133.1325719.1352908723962.JavaMail.root@advansee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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