public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michael Lawnick <nospam_lawnick@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot Makefile question
Date: Tue, 17 Feb 2009 16:03:03 +0100	[thread overview]
Message-ID: <gnejj8$bp$1@ger.gmane.org> (raw)
In-Reply-To: <22057574.post@talk.nabble.com>

Steven Zedeck said the following:
> For example, I'm having problems understanding what this means in a
> Makefile:
> 
> COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
> COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
> COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
> COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
> COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
> 
> COBJS	:= $(COBJS-y)
> SRCS	:= $(COBJS:.o=.c)
> OBJS	:= $(addprefix $(obj),$(COBJS))
> 
> This is from drivers/mtd/Makefile.
> 
> How does COBJS get initially defined upon entry into the Makefile?
> 
> Does at45.o get added to the list of objects to be built only if the
> CONFIG_HAS_DATAFLASH flag is set?
> 
> What does the "-" sign mean before the "$" ?
> 
On start of compile, the file autoconf.mk is generated along your board
configuration #defines in board/<board>/<board-name>.h
It looks like this:
CONFIG_PPC=y
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_BOARD_EARLY_INIT_R=y
CONFIG_SYS_CLK_FREQ=100000000
CONFIG_CMD_ITEST=y
...

autoconf.mk is then used as a predefinition file for the rules of your
Makefile. So
COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
evaluates to either
COBJS-y += at45.o
or
COBJS- += at45.o
or
COBJS-n += at45.o
> What does this mean?  COBJS	:= $(COBJS-y)

This is the assignment of the dynamically built string to the variable
that is then used for the gcc command.

HTH
-- 

Michael

  reply	other threads:[~2009-02-17 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 13:43 [U-Boot] U-Boot Makefile question Steven Zedeck
2009-02-17 15:03 ` Michael Lawnick [this message]
2009-02-17 16:02 ` Mike Frysinger
2009-02-18  9:34 ` Frank Svendsbøe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gnejj8$bp$1@ger.gmane.org' \
    --to=nospam_lawnick@gmx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox