Skip to contentSkip to conversation

mk: allow application to override clean

PATCH Applied [email protected] 4 participants 6 messages Jan 23, 2015 – Jan 30, 2015 5 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mk: allow application to override clean

From: Stephen Hemminger <[email protected]>

In some cases application may want to have additional rules for clean. This can be handled by allowing the double colon form of rule.

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

Single colon and double colon rules for same target causes an error.

mk/rte.app.mk +1 -1
@@ -325,7 +325,7 @@
 # Clean all generated files
 #
 .PHONY: clean
-clean: _postclean
+clean:: _postclean
 	$(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
 
 .PHONY: doclean
---
 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +1 -1
index 40afb2c..9c8b06a 100644
@@ -325,7 +325,7 @@ $(RTE_OUTPUT)/app/$(APP).map: $(APP)
 # Clean all generated files
 #
 .PHONY: clean
-clean: _postclean
+clean:: _postclean
 	$(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
 
 .PHONY: doclean
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1421993948-24785-1-git-send-email-stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org

Acked-by Applied
#2 lore raw
Quoted 10 lines

In some cases application may want to have additional rules for clean. This can be handled by allowing the double colon form of rule.

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

Single colon and double colon rules for same target causes an error.

I think this need could also be solved by having a pkgconfig-like file and not using this rte.app.mk.

Applied, despite wrong formatting of the patch

Thanks

Signature · 1 line
Thomas
#3 lore raw
In reply to a message not in the archive

Hi Stephen,

Quoted 7 lines · On 01/23/2015 07:19 AM, [email protected]…

From: Stephen Hemminger <[email protected]>

In some cases application may want to have additional rules for clean. This can be handled by allowing the double colon form of rule.

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

There is already a way to do that in dpdk makefiles: you can add the following code in your application Makefile, before the line that includes $(RTE_SDK)/mk/rte.app.mk:

POSTCLEAN += my_clean

.PHONY: my_clean
my_clean:
@echo executed after clean

Regards,
Olivier

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Hi Stephen,

2015-01-28 12:00, Olivier MATZ:

Quoted 15 lines

Hi Stephen,

Quoted 7 lines · On 01/23/2015 07:19 AM, [email protected]…

From: Stephen Hemminger <[email protected]>

In some cases application may want to have additional rules for clean. This can be handled by allowing the double colon form of rule.

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

There is already a way to do that in dpdk makefiles: you can add the following code in your application Makefile, before the line that includes $(RTE_SDK)/mk/rte.app.mk:

Quoted 5 lines

POSTCLEAN += my_clean

.PHONY: my_clean
my_clean:
@echo executed after clean

Does it fit with your needs?
Should we revert your patch? Double-colon rules were avoided in DPDK. "Double-colon rules are somewhat obscure and not often very useful"

Signature · 1 line
Thomas
#6 lore raw
Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Thomas Monjalon
Sent: Thursday, January 29, 2015 10:52 AM
To: [email protected]
Cc: [email protected]; Stephen Hemminger
Subject: Re: [dpdk-dev] [PATCH] mk: allow application to override clean

Should we revert your patch? Double-colon rules were avoided in DPDK. "Double-colon rules are somewhat obscure and not often very useful"

Hi,

Also, it looks like DPDK applications that had a 'make clean' target, like dpdk-pktgen, now need to change it to a double colon target to avoid a make error like this:

    $ cd pktgen-dpdk/
    $ make
    /tmp/dpdk/mk/rte.app.mk:331: *** target file `clean' has both : and :: entries.  Stop.

This is complaining that the local pktgen 'clean:' rule conflicts with the DPDK 'clean::' rule.

John.

A message that is not in the archive (sent off-list or not yet received): 1902752B0C92F943AB7EA9EE13E2DEEC287AE6B39E@HQ1-EXCH02.corp.brocade.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20150129223641.75306372-CA4OZQ/[email protected]

#10 lore raw

2015-01-29 22:36, Stephen Hemminger:

Quoted 27 lines
Quoted 24 lines · On Thu, 29 Jan 2015 02:52:45 -0800 Thomas Monjalon…

Hi Stephen,

2015-01-28 12:00, Olivier MATZ:

Quoted 20 lines

Hi Stephen,

Quoted 7 lines · On 01/23/2015 07:19 AM, [email protected]…

From: Stephen Hemminger <[email protected]>

In some cases application may want to have additional rules for clean. This can be handled by allowing the double colon form of rule.

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

There is already a way to do that in dpdk makefiles: you can add the following code in your application Makefile, before the line that includes $(RTE_SDK)/mk/rte.app.mk:

POSTCLEAN += my_clean

.PHONY: my_clean
my_clean:
@echo executed after clean

Quoted 6 lines
Quoted 4 lines

Does it fit with your needs?
Should we revert your patch? Double-colon rules were avoided in DPDK. "Double-colon rules are somewhat obscure and not often very useful"

Works for me.

So the commit is now reverted:

	http://dpdk.org/browse/dpdk/commit/?id=785e1a0932b67136
Signature · 1 line
Thomas