开发者

change variable for a target in a Makefile

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜