diff mbox

[v2,1/3] Makefile: target-finalize: add TARGET_FINALIZE_HOOKS

Message ID 1403252778-19761-2-git-send-email-fabio.porcedda@gmail.com
State Superseded
Headers show

Commit Message

Fabio Porcedda June 20, 2014, 8:26 a.m. UTC
Add TARGET_FINALIZE_HOOKS to the "target-finalize" rule to be able to
add to it commands as needed.
This is useful for having a nicer output because commands are executed
after the "target-finalize" initial message, also it is useful to ensure
an executing order even when top-level parallel makefile is being used.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Arnout Vandecappelle June 20, 2014, 11:19 p.m. UTC | #1
On 20/06/14 10:26, Fabio Porcedda wrote:
> Add TARGET_FINALIZE_HOOKS to the "target-finalize" rule to be able to
> add to it commands as needed.
> This is useful for having a nicer output because commands are executed
> after the "target-finalize" initial message, also it is useful to ensure
> an executing order even when top-level parallel makefile is being used.

 This commit message suggests that the patch would just add the call to the
hooks, not actually changing the purge-locales implementation (which would be a
separate patch).

 For me, it doesn't have to a be a separate patch, but at least that additional
change should be mentioned in the commit message.

 Regards,
 Arnout

> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> ---
>  Makefile | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index b576267..9de4806 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -513,7 +513,7 @@ ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
>  LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
>  LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
>  
> -define TARGET_PURGE_LOCALES
> +define PURGE_LOCALES
>  	rm -f $(LOCALE_WHITELIST)
>  	for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
>  
> @@ -525,13 +525,14 @@ define TARGET_PURGE_LOCALES
>  		done; \
>  	done
>  endef
> +TARGET_FINALIZE_HOOKS += PURGE_LOCALES
>  endif
>  
>  $(TARGETS_ROOTFS): target-finalize
>  
>  target-finalize: $(TARGETS)
>  	@$(call MESSAGE,"Finalizing target directory")
> -	$(TARGET_PURGE_LOCALES)
> +	$(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
>  	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
>  		$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
>  		$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
>
Fabio Porcedda June 23, 2014, 9:14 a.m. UTC | #2
On Sat, Jun 21, 2014 at 1:19 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 20/06/14 10:26, Fabio Porcedda wrote:
>> Add TARGET_FINALIZE_HOOKS to the "target-finalize" rule to be able to
>> add to it commands as needed.
>> This is useful for having a nicer output because commands are executed
>> after the "target-finalize" initial message, also it is useful to ensure
>> an executing order even when top-level parallel makefile is being used.
>
>  This commit message suggests that the patch would just add the call to the
> hooks, not actually changing the purge-locales implementation (which would be a
> separate patch).
>
>  For me, it doesn't have to a be a separate patch, but at least that additional
> change should be mentioned in the commit message.

Ok, i will add at the end:

Also convert "TARGET_PURGE_LOCALES" to a hook that use
"TARGET_FINALIZE_HOOKS".

Thanks && BR
Arnout Vandecappelle June 23, 2014, 9:20 a.m. UTC | #3
On 23/06/14 11:14, Fabio Porcedda wrote:
> On Sat, Jun 21, 2014 at 1:19 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 20/06/14 10:26, Fabio Porcedda wrote:
>>> Add TARGET_FINALIZE_HOOKS to the "target-finalize" rule to be able to
>>> add to it commands as needed.
>>> This is useful for having a nicer output because commands are executed
>>> after the "target-finalize" initial message, also it is useful to ensure
>>> an executing order even when top-level parallel makefile is being used.
>>
>>  This commit message suggests that the patch would just add the call to the
>> hooks, not actually changing the purge-locales implementation (which would be a
>> separate patch).
>>
>>  For me, it doesn't have to a be a separate patch, but at least that additional
>> change should be mentioned in the commit message.
> 
> Ok, i will add at the end:
> 
> Also convert "TARGET_PURGE_LOCALES" to a hook that use

 uses


 You can also add my

    Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

in that case.

 Regards,
 Arnout

> "TARGET_FINALIZE_HOOKS".
> 
> Thanks && BR
>
Fabio Porcedda June 23, 2014, 9:22 a.m. UTC | #4
On Mon, Jun 23, 2014 at 11:20 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 23/06/14 11:14, Fabio Porcedda wrote:
>> On Sat, Jun 21, 2014 at 1:19 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>>> On 20/06/14 10:26, Fabio Porcedda wrote:
>>>> Add TARGET_FINALIZE_HOOKS to the "target-finalize" rule to be able to
>>>> add to it commands as needed.
>>>> This is useful for having a nicer output because commands are executed
>>>> after the "target-finalize" initial message, also it is useful to ensure
>>>> an executing order even when top-level parallel makefile is being used.
>>>
>>>  This commit message suggests that the patch would just add the call to the
>>> hooks, not actually changing the purge-locales implementation (which would be a
>>> separate patch).
>>>
>>>  For me, it doesn't have to a be a separate patch, but at least that additional
>>> change should be mentioned in the commit message.
>>
>> Ok, i will add at the end:
>>
>> Also convert "TARGET_PURGE_LOCALES" to a hook that use
>
>  uses
>
>
>  You can also add my
>
>     Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
> in that case.

Done, thanks.

BR
diff mbox

Patch

diff --git a/Makefile b/Makefile
index b576267..9de4806 100644
--- a/Makefile
+++ b/Makefile
@@ -513,7 +513,7 @@  ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
 LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
 LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
 
-define TARGET_PURGE_LOCALES
+define PURGE_LOCALES
 	rm -f $(LOCALE_WHITELIST)
 	for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
 
@@ -525,13 +525,14 @@  define TARGET_PURGE_LOCALES
 		done; \
 	done
 endef
+TARGET_FINALIZE_HOOKS += PURGE_LOCALES
 endif
 
 $(TARGETS_ROOTFS): target-finalize
 
 target-finalize: $(TARGETS)
 	@$(call MESSAGE,"Finalizing target directory")
-	$(TARGET_PURGE_LOCALES)
+	$(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
 	rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
 		$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
 		$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake