Skip to contentSkip to conversation

tests: fix quoting of CFLAGS in Makefile

PATCH In review Sam James 2 participants 2 messages Mar 23, 2023 Device mapper

lore
Share & tools
lore

Sam James

author
#0 lore raw

PATCH 1/1 tests: fix quoting of CFLAGS in Makefile

Otherwise, when CFLAGS/CPPFLAGS have multiple entries (like "-O2 -pipe"), we get an error:

```
make[1]: Entering directory '/var/tmp/portage/sys-fs/multipath-tools-0.9.4/work/multipath-tools-0.9.4/tests'
/bin/sh: line 1: -pipe: command not found
make[1]: *** [Makefile:115: libmultipath.so.0] Error 127
make[1]: *** Waiting for unfinished jobs....
```
---
 tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile +1 -1
index 1648ab9d..83edc2f0 100644
@@ -112,7 +112,7 @@ dep_clean:
 # Pass the original values of CFLAGS etc. to the sub-make, which will include
 # Makefile.in again. Otherwise, the flags would be added twice.
 libmultipath.so.0: $(multipathdir)/libmultipath.so.0
-	@CFLAGS=$(ORIG_CFLAGS) CPPFLAGS=$(ORIG_CPPFLAGS) LDFLAGS=$(ORIG_LDFLAGS) \
+	@CFLAGS="$(ORIG_CFLAGS)" CPPFLAGS="$(ORIG_CPPFLAGS)" LDFLAGS="$(ORIG_LDFLAGS)" \
 	$(MAKE) -C $(multipathdir) configdir=$(TESTDIR)/conf.d plugindir=$(TESTDIR)/lib test-lib
 
 # COLON will get expanded during second expansion below
Signature · 6 lines
2.40.0

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Sam James

Otherwise, when CFLAGS/CPPFLAGS have multiple entries (like "-O2 - pipe"), we
get an error:

```
make[1]: Entering directory '/var/tmp/portage/sys-fs/multipath-tools-
0.9.4/work/multipath-tools-0.9.4/tests'
/bin/sh: line 1: -pipe: command not found
make[1]: *** [Makefile:115: libmultipath.so.0] Error 127
make[1]: *** Waiting for unfinished jobs....
```
Quoted 1 line

Thanks!

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel