![](/img/trans.png)
[英]Why is GCC make throwing errors and uneccesary warnings only when using the struct name instead of typedef?
[英]GCC and makefile: Only show errors and warnings
我有一個makefile,可以編譯我項目中的每個.c文件。 對於每個文件,我將整個編譯命令打印到shell,包含所有選項和標志。 這是一個文件的示例輸出:
arm-none-eabi-gcc -c -mcpu = cortex-m3 -O0 -dM -g -gdwarf-2 -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms = src / sim / sim_configuration.lst -include ./lib/stm32core/stm32f2xx_conf.h-I。 -I./lib/ARMStandardLibrary -I./lib/LwIP -I./lib/LwIP/src/include -I./lib/LwIP/src/include -I./lib/LwIP/src/include/ipv4 - I./lib/LwIP/src/include/ipv6 -I./lib/FatFS -I./lib/stm32core -I./src -I./src/sim -I./src/sd -I./src / tftp src / sim / sim_configuration.c -o src / sim / sim_configuration.o
問題是在整個命令輸出的混亂中會丟失各種警告。 有沒有辦法只打印出現的警告和錯誤( 不是原始命令)?
使用-s
選項執行make
。 從手冊頁 。
-s, --silent, --quiet
Silent operation; do not print the commands as they are executed.
你總是可以過濾掉stdout
所有輸出,這應該會給你帶來stderr
上的所有錯誤:
make 1>/dev/null
在命令之前使用@
來隱藏它:
rule1:
@gcc someting
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.