In a Makefile I've a target called objects and if I run make objects it produces .o from every .cpp. Now I want to introduce a target check-syntax that call the target object but before change the variable CFLAGS from -Wall -O2 to -Wall -O0 -fsyntax-only.
How to do it?开发者_如何学运维
(IN GNUMake, anyway, and I'll assume you meant CFLAGS)
CFLAGS = -Wall -O2
objects: ...
    whatever
check-syntax: CFLAGS = -Wall -O0 -fsyntax-only
check-syntax: objects
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论