I need to add -Werror to the already existing (Exported?) CFLAGS for a build. Right now I am just trying to extract the data CFLAGS holds. I am super new to Make and Makefiles but have to add some pre-existing build files.
Say I have a target in a makefile like this
.PHONY: add_errors
add_errors:
@flags=$(CFLAGS);\
echo $$flags;\
But the issue is, CFLAGS is a really large string that has many options set. When the makefile is executed I get the following error
/bin/sh: 1: -marm: not found
make[2]: *** [add_errors] Error 127
Which looks like something is taking the first space as the string and then discarding the rest of it.
Inside CFLAGS, a snippet of the text is
-march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=/opt/dspg/v2.11-rc2/sysroots/cortexa9-neon-dspg-linux-gnueabi -Wno-psabi -ggdb -I/opt/dspg/v2.11-rc2/sysroots/cortexa9-neon-dspg-linux-gnueabi/usr/include/libxml2
What can I do?