From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Who calls to the defined function/s
Date: Tue, 20 Nov 2012 09:59:04 +0100 [thread overview]
Message-ID: <20121120095904.20264654@skate> (raw)
In-Reply-To: <CACUGKYMDKMSvqrUgRhiKyaVm6S5z7a+RMa+3oyCXspU8OVVbYQ@mail.gmail.com>
Dear John Tobias,
On Mon, 19 Nov 2012 18:21:03 -0800, John Tobias wrote:
> I was trying to (fully) understand the dataflow of the buildroot's
> Makefile. How/who parse/calls to the functions like:
>
> HELLO_INSTALL_TARGET_CMDS
> HELLO_BUILD_CMDS
>
> $(eval $(generic-package))
The generic-package macro will find in which directory your Makefile
is, for example package/hello/. It will take this "hello" convert it to
uppercase, and use it as the prefix for all variables. So basically, a
package in package/hello/hello.mk will have to define HELLO_SITE,
HELLO_SOURCE, HELLO_VERSION, and possibly HELLO_BUILD_CMDS,
HELLO_INSTALL_TARGET_CMDS, etc.
> So, How I can tell to the generic-package to call HELLO_TEST_CMDS too?
>
> example:
> define HELLO_TEST_CMDS
> ...
> endef
That would require a modification of the package infrastructure, which
you probably don't want to do. What are you trying to achieve with a
new command exactly?
New commands are normally not needed:
*) For autotools-package and cmake-package, you have hooks so that you
can do something after extraction, after patching, after
configuration, after installation, etc.
*) For generic-package, you can do something like:
ifeq ($(BR2_PACKAGE_HELLO_SOMETHING),y)
define HELLO_DO_THIS_CMDS
$(MAKE) -C $(@D) do-this
endef
endif
ifeq ($(BR2_PACKAGE_HELLO_SOMETHING_ELSE),y)
define HELLO_DO_THAT_CMDS
$(MAKE) -C $(@D) do-that
endef
endif
define HELLO_BUILD_CMDS
$(HELLO_DO_THIS_CMDS)
$(HELLO_DO_THAT_CMDS)
endef
Please make sure to read our documentation at
http://buildroot.org/downloads/manual/manual.html#_adding_new_packages_to_buildroot
which explains all of this with quite some details and examples.
Do not hesitate to get back to the list if you need further details,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2012-11-20 8:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 2:21 [Buildroot] Who calls to the defined function/s John Tobias
2012-11-20 8:59 ` Thomas Petazzoni [this message]
2012-11-20 18:26 ` John Tobias
2012-11-20 23:00 ` John Tobias
2012-11-21 0:52 ` John Tobias
2012-11-21 6:39 ` Arnout Vandecappelle
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=20121120095904.20264654@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.