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
Acked-by Applied
#2 lore raw
In reply to a message not in the archive
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

#5 lore raw
In reply to a message not in the archive

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.

#10 lore raw
In reply to a message not in the archive

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