[dpdk-dev] [PATCH v2 3/3] examples: fix make clean when using pkg-config for building

Bruce Richardson bruce.richardson at intel.com
Fri May 17 13:46:13 CEST 2019


The "make clean" command had a number of issues:
- the "--ignore-fail-on-non-empty" flag is not present on BSD
- the call to remove the build folder would fail if there was no build
  folder present.

These are fixed by only removing the build folder if it exists, and by
using -p flag to rmdir in place of --ignore-fail-on-non-empty

Fixes: 22119c4591a0 ("examples: use pkg-config in makefiles")

Cc: stable at dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 examples/bbdev_app/Makefile             | 2 +-
 examples/bond/Makefile                  | 2 +-
 examples/cmdline/Makefile               | 2 +-
 examples/distributor/Makefile           | 2 +-
 examples/eventdev_pipeline/Makefile     | 2 +-
 examples/exception_path/Makefile        | 2 +-
 examples/fips_validation/Makefile       | 2 +-
 examples/flow_classify/Makefile         | 2 +-
 examples/flow_filtering/Makefile        | 2 +-
 examples/helloworld/Makefile            | 2 +-
 examples/ip_fragmentation/Makefile      | 2 +-
 examples/ip_pipeline/Makefile           | 2 +-
 examples/ip_reassembly/Makefile         | 2 +-
 examples/ipsec-secgw/Makefile           | 2 +-
 examples/ipv4_multicast/Makefile        | 2 +-
 examples/kni/Makefile                   | 2 +-
 examples/l2fwd-cat/Makefile             | 2 +-
 examples/l2fwd-crypto/Makefile          | 2 +-
 examples/l2fwd-jobstats/Makefile        | 2 +-
 examples/l2fwd-keepalive/Makefile       | 2 +-
 examples/l2fwd/Makefile                 | 2 +-
 examples/l3fwd-acl/Makefile             | 2 +-
 examples/l3fwd-power/Makefile           | 2 +-
 examples/l3fwd-vf/Makefile              | 2 +-
 examples/l3fwd/Makefile                 | 2 +-
 examples/link_status_interrupt/Makefile | 2 +-
 examples/load_balancer/Makefile         | 2 +-
 examples/packet_ordering/Makefile       | 2 +-
 examples/ptpclient/Makefile             | 2 +-
 examples/qos_meter/Makefile             | 2 +-
 examples/qos_sched/Makefile             | 2 +-
 examples/rxtx_callbacks/Makefile        | 2 +-
 examples/service_cores/Makefile         | 2 +-
 examples/skeleton/Makefile              | 2 +-
 examples/tep_termination/Makefile       | 2 +-
 examples/timer/Makefile                 | 2 +-
 examples/vhost/Makefile                 | 2 +-
 examples/vhost_scsi/Makefile            | 2 +-
 examples/vmdq/Makefile                  | 2 +-
 examples/vmdq_dcb/Makefile              | 2 +-
 40 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/examples/bbdev_app/Makefile b/examples/bbdev_app/Makefile
index e8115b46a..af313d926 100644
--- a/examples/bbdev_app/Makefile
+++ b/examples/bbdev_app/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/bond/Makefile b/examples/bond/Makefile
index 488eeac70..278b5f690 100644
--- a/examples/bond/Makefile
+++ b/examples/bond/Makefile
@@ -39,7 +39,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/cmdline/Makefile b/examples/cmdline/Makefile
index a03dfa8ee..03d9ed3cc 100644
--- a/examples/cmdline/Makefile
+++ b/examples/cmdline/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index 52076214b..2edc0ea3d 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile
index 0b0d1ade9..1d3394947 100644
--- a/examples/eventdev_pipeline/Makefile
+++ b/examples/eventdev_pipeline/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 18db85ddb..c3ba2787c 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile
index e74252e27..19240911a 100644
--- a/examples/fips_validation/Makefile
+++ b/examples/fips_validation/Makefile
@@ -44,7 +44,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile
index dfce1a4bd..182debcba 100644
--- a/examples/flow_classify/Makefile
+++ b/examples/flow_classify/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index f657c0336..b182a2a29 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -33,7 +33,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile
index 97d82f68a..980b011fc 100644
--- a/examples/helloworld/Makefile
+++ b/examples/helloworld/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile
index 6d1a1fbba..56726d688 100644
--- a/examples/ip_fragmentation/Makefile
+++ b/examples/ip_fragmentation/Makefile
@@ -36,7 +36,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
index 409966afd..acd93e29b 100644
--- a/examples/ip_pipeline/Makefile
+++ b/examples/ip_pipeline/Makefile
@@ -55,7 +55,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP)* build/*.o
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 7bbc241c7..1baec86ad 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -36,7 +36,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile
index 75f2bcd00..a2d8244e8 100644
--- a/examples/ipsec-secgw/Makefile
+++ b/examples/ipsec-secgw/Makefile
@@ -48,7 +48,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5a1e368fa..5595b9cbf 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -36,7 +36,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/kni/Makefile b/examples/kni/Makefile
index 634334f86..e01703567 100644
--- a/examples/kni/Makefile
+++ b/examples/kni/Makefile
@@ -36,7 +36,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index fb3c4bc00..b4f729a66 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
index ed5e2c73f..3986a4c10 100644
--- a/examples/l2fwd-crypto/Makefile
+++ b/examples/l2fwd-crypto/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index e14c3a2b2..4517a3d7d 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index bc851b732..56d0e0666 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 94d70a43e..43277318f 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index fc236f129..b38343725 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile
index a106b0404..8a4eee8ae 100644
--- a/examples/l3fwd-power/Makefile
+++ b/examples/l3fwd-power/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index cc93603e3..8ad2fbcbc 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index 8c51c7b96..dcc38a928 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index d12e04782..987724d47 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index d4b145ca1..935ee1591 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 474ec9571..2c3187a41 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index f113c9d56..857a679b7 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index fbcda09b2..7321f34f3 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -37,7 +37,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index a25875900..7012c3d4c 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile
index b937d599b..22c4013db 100644
--- a/examples/rxtx_callbacks/Makefile
+++ b/examples/rxtx_callbacks/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile
index 351fb7e1d..1dcd4c62e 100644
--- a/examples/service_cores/Makefile
+++ b/examples/service_cores/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else
 
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index 56713a524..b9cd05f2f 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index f4b85e49b..3782378d9 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -39,7 +39,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/timer/Makefile b/examples/timer/Makefile
index 046348fd1..f49703ff4 100644
--- a/examples/timer/Makefile
+++ b/examples/timer/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 80607b79c..9c3e0ece0 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -39,7 +39,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/vhost_scsi/Makefile b/examples/vhost_scsi/Makefile
index 0a3450bae..813ab66a8 100644
--- a/examples/vhost_scsi/Makefile
+++ b/examples/vhost_scsi/Makefile
@@ -38,7 +38,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 6a389c776..b67d1937f 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 113bce7d1..0ddcc320b 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -35,7 +35,7 @@ build:
 .PHONY: clean
 clean:
 	rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
-	rmdir --ignore-fail-on-non-empty build
+	test -d build && rmdir -p build || true
 
 else # Build using legacy build system
 
-- 
2.21.0



More information about the dev mailing list