I have a makefile which builds a project composed of many files which all need to be built.
To make matters more complicated, I have a number of included directories in each call to gcc (so each call to gcc looks long on the command line).
I'd like to suppress all output except for errors and warnings (so that I can actually see them when make runs!)
Is there any way to do this?
If you want to inhibit the display of commands during a particular make run, you can use the -s option. If you want to inhibit the display of all command lines in every run, add the special target . SILENT to your makefile . and there is no file named xyz , make halts after rm returns its exit status.
Maybe you can look for CFLAGS options in Makefile and remove the -Werror flag. The Werror flag will make all warnings into errors. Show activity on this post.
To suppress this warning use the unused attribute (Section 6.32 Specifying Attributes of Variables). To suppress this warning use the unused attribute (Section 6.32 Specifying Attributes of Variables). Warn whenever a statement computes a result that is explicitly not used.
make -s
should do what you're after a bit more neatly. I don't know of a way to force it on the makefiles, but the GNU manual might have one.
Failing that you could check the Linux kernel build system, since that seems to automatically hide stdout.
By adding a "@" to the front of a command, the command line string is suppressed e.g. from
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(CC) -c $(CFLAGS) $< -o $@
to
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c @$(CC) -c $(CFLAGS) $< -o $@
will take
make[1]: Entering directory `.../libraries/libgcdc/build' /home/crowe/arm-tools/gcc-arm-none-eabi-4_6-2012q2/bin/arm-none-eabi-gcc -c -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Werror-implicit-function-declaration -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -g -O0 -D DEBUG -I.. -I../include -I../../libchip_sam3s -I../../libboard_arm_demo -I../../libboard_generic -I../../libusb/include -Dsam3s4 -DTRACE_LEVEL=5 -Dprintf=iprintf ../source/hid_callbacks.c -o debug_sam3s_svn2/hid_callbacks.o make[1]: Leaving directory ` .../libraries/libgcdc/build'
to
make[1]: Entering directory `.../libraries/libgcdc/build' make[1]: Leaving directory `.../libraries/libgcdc/build'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With