开发者

Have my makefile show me compile errors?

exedarken: darken.c
    gcc -o exedarken darken.c

exeimagestats: imagestats.c
    gcc -o exeimagestats imagestats.c

exelighten: lighten.c
    gcc -o exelighten 开发者_Go百科lighten.c

exerotate: rotate.c
    gcc -o exerotate rotate.c

exeflip: flip.c
    gcc -o exeflip flip.c

exematte: matte.c
    gcc -o exematte matte.c

Theres my makefile. Is there a way for when I execute this makefile, I get to see the compile errors I get?


By default, make prints the output of any command it executes, ie if there are compilation errors, they should be shown.

On an unrelated note: repeating yourself is bad; your makefile can be simplified to

executables := exedarken exeimagestats exelighten exerotate exeflip exematte

$(executables) : exe% : %.c
    gcc -o $@ $<


Write in console:

make VERBOSE=1
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜