From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Makefile: target-purgelocales: add dependencies
Date: Mon, 28 Apr 2014 12:30:00 +0200 [thread overview]
Message-ID: <535E2DA8.7090306@mind.be> (raw)
In-Reply-To: <CAHkwnC8o4CsbpT9C_G20dRn1vRvb6wcz7gHKT5h6W7ehPZ4YRg@mail.gmail.com>
On 28/04/14 09:58, Fabio Porcedda wrote:
> On Mon, Apr 28, 2014 at 7:49 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 25/04/14 23:50, Fabio Porcedda wrote:
>>> On Thu, Apr 24, 2014 at 6:41 PM, Thomas Petazzoni
>>> <thomas.petazzoni@free-electrons.com> wrote:
>>>> Dear Fabio Porcedda,
>>>>
>>>> On Thu, 24 Apr 2014 18:24:39 +0200, Fabio Porcedda wrote:
>>>>
>>>>> -target-purgelocales:
>>>>> +target-purgelocales: $(filter-out target-purgelocales,$(TARGETS))
>>>>> rm -f $(LOCALE_WHITELIST)
>>>>> for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
>>>>
>>>> Don't we have several other targets that need to be executed only after
>>>> all packages have been built and installed? Wouldn't it make sense to
>>>> have a common solution for these? Like maybe a dedicated target?
>>>
>>> Can you please give some examples? I know only tatget-purgelocales and
>>> target-finalize.
>>>
>>> About the common solution, i see two possible solutions of the problem:
>>>
>>> 1) all those targets must be listed in a variable like
>>> TARGETS_PRE_ROOTFS, but those targets must be able to be executed in
>>> parallel without a specific order.
>>>
>>> 2) all those targets must be converted in hooks and added to a
>>> variable like PRE_ROOTFS_HOOKS, so those steps are going to be
>>> executed in serial observing a specific order.
>>>
>>> What is the more appropriate solution? The easiest and fastest one is
>>> the first, but i'm not sure if those targets can be executed in
>>> parallel.
>>
>> My personal preference is to have a single rule (e.g. target-finalize)
>> that performs everything that is post-targets and pre-rootfs. There isn't
>> much that needs to be done so parallelisation doesn't make sense. And I
>> think it's much easier to understand which steps are executed and in
>> which order if they are all put together in a single rule rather than
>> spread out over several.
>>
>> To make things more readable, we can put the commands into separate
>> variables. For instance:
>>
>> define TARGET_PURGE_LOCALES
>> rm -f $(LOCALE_WHITELIST)
>> ...
>> endef
>>
>> define TARGET_PURGE_DEVFILES
>> rm -rf $(TARGET_DIR)/usr/include ...
>> ...
>> endef
>>
>> ifneq ($(BR2_PACKAGE_GDB),y)
>> define TARGET_PURGE_GDB
>> rm -rf $(TARGET_DIR)/usr/share/gdb
>> endef
>> endif
>>
>> target-finalize: $(TARGETS)
>> $(TARGET_PURGE_LOCALES)
>> $(TARGET_PURGE_DEVFILES)
>> $(TARGET_PURGE_GDB)
>> $(TARGET_PURGE_DOC)
>> ...
>>
>>
>> I'm giving the content of target-finalize as an example here, but it's
>> not immediately needed to convert those into variables. The different
>> target-* steps that are currently added to TARGETS are rather more important.
>
> It's fine for me.
> So you prefer to list those variables inside the target instead of
> adding them to a hook variable? like e.g. PRE_ROOTFS_HOOK?
Indeed. The HOOKS way of working is not very clear. The code for calling
the hooks is not easy to understand at first sight, because it contains
this $(foreach ...) and $(sep) stuff. Also, the assignments to the HOOKS
variable are spread out over the Makefiles so it's hard to see which
things will get executed and in which order. And finally, it's not needed
here because we can enumerate all the possible steps - that's different
from the package infrastructure, where the HOOK contents differs from
package to package.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
next prev parent reply other threads:[~2014-04-28 10:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 16:24 [Buildroot] [PATCH] Makefile: target-purgelocales: add dependencies Fabio Porcedda
2014-04-24 16:41 ` Thomas Petazzoni
2014-04-25 21:50 ` Fabio Porcedda
2014-04-28 5:49 ` Arnout Vandecappelle
2014-04-28 7:58 ` Fabio Porcedda
2014-04-28 10:30 ` Arnout Vandecappelle [this message]
2014-04-28 10:32 ` Fabio Porcedda
2014-04-28 9:36 ` Peter Korsgaard
2014-04-28 16:10 ` Thomas Petazzoni
2014-06-11 9:24 ` Fabio Porcedda
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=535E2DA8.7090306@mind.be \
--to=arnout@mind.be \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox