public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Robert P. J. Day <rpjday@crashcourse.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] why is the compilation of cmd_pcmcia.c hardcoded?
Date: Wed, 18 Nov 2009 03:17:21 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0911180307560.31136@localhost> (raw)


  i'm curious as to why common/Makefile hardcodes the compilation of
cmd_pcmcia.c thusly:

  COBJS-y += cmd_pcmcia.o

since i'm interested in building for a beagleboard, i have no interest
in PCMCIA support, yet that source file will be compiled for me, even
though the selection macro CONFIG_CMD_PCMCIA does exist and is defined
by a number of other board configurations.

  what seems stranger is that, even though that config macro exists,
it isn't used in the Makefile but *is* tested in the source file
itself to determine whether the "pinit" command will be compiled:

=====
#if defined(CONFIG_CMD_PCMCIA)

extern int pcmcia_on (void);
extern int pcmcia_off (void);

int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
...
}

U_BOOT_CMD(
        pinit,  2,      0,      do_pinit,
        "PCMCIA sub-system",
        "on  - power on PCMCIA socket\n"
        "pinit off - power off PCMCIA socket"
);

#endif

=====

  so the "pinit" command *won't* be compiled into my image, but the
remainder of that file will still be compiled.  if the rest of that
file truly needs to be built for every board, would it not make more
sense to break the pinit code into a separate file, and have the
Makefile look something like:

ifdef CONFIG_CMD_PCMCIA
COBJS-$(CONFIG_CMD_PCMCIA) += cmd_pcmcia.o
endif

  or is there something else happening there that i'm missing?

rday

p.s.  based on the obvious naming convention of those files, i would
have imagined a file by the name of cmd_pinit.c.

--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

             reply	other threads:[~2009-11-18  8:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  8:17 Robert P. J. Day [this message]
2009-11-18 17:37 ` [U-Boot] why is the compilation of cmd_pcmcia.c hardcoded? Ben Warren
2009-11-19  0:15 ` Mike Frysinger
2009-12-07 20:16 ` Wolfgang Denk

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=alpine.LFD.2.00.0911180307560.31136@localhost \
    --to=rpjday@crashcourse.ca \
    --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