]> git.droids-corp.org - dpdk.git/commitdiff
examples: fix make clean when using pkg-config
authorBruce Richardson <bruce.richardson@intel.com>
Fri, 17 May 2019 12:02:31 +0000 (13:02 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 20 May 2019 21:57:47 +0000 (23:57 +0200)
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 <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
40 files changed:
examples/bbdev_app/Makefile
examples/bond/Makefile
examples/cmdline/Makefile
examples/distributor/Makefile
examples/eventdev_pipeline/Makefile
examples/exception_path/Makefile
examples/fips_validation/Makefile
examples/flow_classify/Makefile
examples/flow_filtering/Makefile
examples/helloworld/Makefile
examples/ip_fragmentation/Makefile
examples/ip_pipeline/Makefile
examples/ip_reassembly/Makefile
examples/ipsec-secgw/Makefile
examples/ipv4_multicast/Makefile
examples/kni/Makefile
examples/l2fwd-cat/Makefile
examples/l2fwd-crypto/Makefile
examples/l2fwd-jobstats/Makefile
examples/l2fwd-keepalive/Makefile
examples/l2fwd/Makefile
examples/l3fwd-acl/Makefile
examples/l3fwd-power/Makefile
examples/l3fwd-vf/Makefile
examples/l3fwd/Makefile
examples/link_status_interrupt/Makefile
examples/load_balancer/Makefile
examples/packet_ordering/Makefile
examples/ptpclient/Makefile
examples/qos_meter/Makefile
examples/qos_sched/Makefile
examples/rxtx_callbacks/Makefile
examples/service_cores/Makefile
examples/skeleton/Makefile
examples/tep_termination/Makefile
examples/timer/Makefile
examples/vhost/Makefile
examples/vhost_scsi/Makefile
examples/vmdq/Makefile
examples/vmdq_dcb/Makefile

index e8115b46a6c12c84a9989fae8ff894a200a3a3e2..af313d926e23d560de20a2e2ed606d6cddb696bd 100644 (file)
@@ -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
 
index 488eeac70a7871d1fc7607db156b3907bf7caed7..278b5f690d0421b291d32dc80e25d5e1d18d0b4a 100644 (file)
@@ -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
 
index a03dfa8eea23ffbbb4357af45449623161675364..03d9ed3ccdfce7dec69cf588b39c3678e33a897e 100644 (file)
@@ -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
 
index 52076214b789ae18b1992f4dacc5f75b988f5021..2edc0ea3d52e46a34ebc7c7b55fe535b9d4f7e3d 100644 (file)
@@ -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
 
index 0b0d1ade955896a4179f826f982396bbbd84bb71..1d3394947d2d575bda2963e20d62646b198b70e2 100644 (file)
@@ -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
 
index 18db85ddb835dab7949ed4334f3b936976ac0e76..c3ba2787cda46d8a6ecb9feba56d54ea0fefb5be 100644 (file)
@@ -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
 
index e74252e274dbe661e5c26e1af0910c53026e3b90..19240911a7e0677e98113de5e7b777a7fc37314f 100644 (file)
@@ -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
 
index dfce1a4bd05c2c5687f8b37f1aa52b27fd8de88f..182debcbae3e64c957fc417ef3f098078c19f67d 100644 (file)
@@ -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
 
index f657c0336a52a7c82289d374483619cc8463cb53..b182a2a29c8ec37b911b7f92c552e1b4fac3898a 100644 (file)
@@ -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
 
index 97d82f68aa0b6a3b3c50b69b6ae7227a181b4de1..980b011fc7bd278aed916f154bebce89916d9004 100644 (file)
@@ -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
 
index 6d1a1fbba59c0b02c95bff579272acf07a2f6601..56726d68837302807bb17e6ad1b28b7a543b7fa1 100644 (file)
@@ -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
 
index 409966afde29a9aaabf261948681038546d89698..acd93e29b0f28e1bd69a4a142e41f3fdbb4044fb 100644 (file)
@@ -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
 
index 7bbc241c7810ef4b3a613627128533813bad3976..1baec86ad93e1b68146fe4558e8db87180b1d66a 100644 (file)
@@ -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
 
index 75f2bcd00bb7e602f49747588577b1aaae354ff7..a2d8244e815db341e4de00ecd0953b9f59df1f0b 100644 (file)
@@ -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
 
index 5a1e368fa5be60601c4d96b347306ffe725885d9..5595b9cbf4e3f419baaf466b4a962e7f64c08903 100644 (file)
@@ -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
 
index 634334f86f8c3e5638c5d7041631696f0d1aa96f..e01703567d577f459ec69556bb830b7a3007afbd 100644 (file)
@@ -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
 
index fb3c4bc00889507f4983a0047d647e463e4306e0..b4f729a66972e7b1e25f6ca3138af26c43907874 100644 (file)
@@ -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
 
index ed5e2c73f300446dc37fa567fe5f62417e82382e..3986a4c10f5f479bcece8f8671098f718ecba980 100644 (file)
@@ -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
 
index e14c3a2b2ba6ced238d83adb2449178612d92f1d..4517a3d7d6e553a2c3e143d1e7ecd56729230d01 100644 (file)
@@ -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
 
index bc851b732e3f4151bb7e06764a111018c02b5a6c..56d0e066667330604a8458e2bdeff283039ee5a2 100644 (file)
@@ -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
 
index 94d70a43e0cc9c557ecf3bc4ae1fa9a189f006c7..43277318f656ebd84a295eab170ddd099acc3e3d 100644 (file)
@@ -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
 
index fc236f1298c528dee43e3afb5a624e339c2ef89b..b3834372532a30fcd4a37cb00eaef8a1f9ee1078 100644 (file)
@@ -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
 
index a106b040443c5d48416ef5827ca4ca7922136ede..8a4eee8ae3f0e4d5d6be1947de7302eb7d1189fb 100644 (file)
@@ -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
 
index cc93603e3b076f895c0cef818ebb7c6f8b513967..8ad2fbcbcb6500c93c9ae4382fa394c086063ba3 100644 (file)
@@ -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
 
index 8c51c7b969243ca3e2633f47c64d6bc450ecbddc..dcc38a92804d1d9997ec782d856342506ce44916 100644 (file)
@@ -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
 
index d12e04782ceb34e526005db57d879d241696c7cb..987724d4775e482814e705b332f6a466f1a8711c 100644 (file)
@@ -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
 
index d4b145ca17140fcbef418b86f5f1f7eb8f4462d0..935ee159120b0ca132ed9a1d9c581635e5fbf7a2 100644 (file)
@@ -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
 
index 474ec95716bb930dfe49cad53158f2f6c6ac8603..2c3187a416fa7d2c41f81bf491df4f9428c8e256 100644 (file)
@@ -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
 
index f113c9d56fee59c9b3811a6fdd61f86aa60d72d7..857a679b7d1f7cbf59b1e100ec6be9a75752e4a5 100644 (file)
@@ -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
 
index fbcda09b20ff4890396fd7e8314dc7af4265c23b..7321f34f318be24cd110dbdecaa67893469f83d4 100644 (file)
@@ -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
 
index a25875900e1d6f39615b15b953bc0f03b2e24db9..7012c3d4c474f2f355f94521ecb6a02314f7bec4 100644 (file)
@@ -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
 
index b937d599b4e9138e101eb83154172c5f44f6a34d..22c4013db87d875256d69014be5d59593133ac12 100644 (file)
@@ -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
 
index 351fb7e1d9665367a6a819f30f11d060b3ebfda1..1dcd4c62ee41377420dc04dc8ae6e101ddb850a5 100644 (file)
@@ -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
 
index 56713a524cc5f8598262b62a94f7dca9b5e5f04f..b9cd05f2fbe427835c51f9ab8ec7ecf3a97992d5 100644 (file)
@@ -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
 
index f4b85e49b99701704ecbc34e8aa1952769f2c6c7..3782378d999d1d42ece3d8e88d72c62479a6a84b 100644 (file)
@@ -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
 
index 046348fd1c32aae92959e29ddd4078025ccabf15..f49703ff43214e31e816888a3a5fa53c90bd7c38 100644 (file)
@@ -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
 
index 80607b79c5c6e0b8b820c8bc57b74390bfbf7a0e..9c3e0ece08a0bdc6efb838dc85144e2fa3681688 100644 (file)
@@ -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
 
index 0a3450bae57d1771e5f995049875f85c8c141d5c..813ab66a84e35754d3760a21ef344b6d320bd179 100644 (file)
@@ -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
 
index 6a389c7760aa44baf1c43d7abed6d635c012355d..b67d1937fcc98c1d47599dd01a2526ade15d71c1 100644 (file)
@@ -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
 
index 113bce7d1355c634c2ef3a0106d2a691347e37ff..0ddcc320b7968f9353dcc8b9409f75fc2db56f0a 100644 (file)
@@ -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