开发者

Hiding the removal of intermediate files using Make

I use intermediate files in my Makefile, however make prints out the 开发者_开发百科rm command that it uses to delete them all afterwards. How do I hide this print statement?


The make manual says that targets marked .SECONDARY will behave as .INTERMEDIATE but won't be automatically deleted. You could mark all the intermediate targets as secondary, and then remove the files yourself, something like

OBJECTS=foo.o bar.o
all:foo bar
    @rm -f $(OBJECTS)
.SECONDARY: $(OBJECTS)

should do.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜