From 7e9562a107f170be5979199ae53a9780ce8cb81e Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Fri, 17 May 2019 13:02:31 +0100 Subject: [PATCH] examples: fix make clean when using pkg-config 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@dpdk.org Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- 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 e8115b46a6..af313d926e 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 488eeac70a..278b5f690d 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 a03dfa8eea..03d9ed3ccd 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 52076214b7..2edc0ea3d5 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 0b0d1ade95..1d3394947d 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 18db85ddb8..c3ba2787cd 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 e74252e274..19240911a7 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 dfce1a4bd0..182debcbae 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 f657c0336a..b182a2a29c 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 97d82f68aa..980b011fc7 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 6d1a1fbba5..56726d6883 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 409966afde..acd93e29b0 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 7bbc241c78..1baec86ad9 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 75f2bcd00b..a2d8244e81 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 5a1e368fa5..5595b9cbf4 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 634334f86f..e01703567d 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 fb3c4bc008..b4f729a669 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 ed5e2c73f3..3986a4c10f 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 e14c3a2b2b..4517a3d7d6 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 bc851b732e..56d0e06666 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 94d70a43e0..43277318f6 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 fc236f1298..b383437253 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 a106b04044..8a4eee8ae3 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 cc93603e3b..8ad2fbcbcb 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 8c51c7b969..dcc38a9280 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 d12e04782c..987724d477 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 d4b145ca17..935ee15912 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 474ec95716..2c3187a416 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 f113c9d56f..857a679b7d 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 fbcda09b20..7321f34f31 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 a25875900e..7012c3d4c4 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 b937d599b4..22c4013db8 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 351fb7e1d9..1dcd4c62ee 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 56713a524c..b9cd05f2fb 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 f4b85e49b9..3782378d99 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 046348fd1c..f49703ff43 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 80607b79c5..9c3e0ece08 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 0a3450bae5..813ab66a84 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 6a389c7760..b67d1937fc 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 113bce7d13..0ddcc320b7 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.20.1