开发者

How do I create a makefile rule to run astyle?

I'd like to create a makefile rule to run astyle on any writable source files. Currently, I have a rule like the following:

style:
  find . -perm -200 -regex ".*[.][CHch]p*" -exec astyle --s开发者_高级运维uffix=none --style=ansi --convert-tabs "{}" \;

This rule basically works but doesn't seem to be the make way of doing things.


Assuming you have a list of source files (or can create them with the shell function), something like:

style : $(SOURCES:.cpp=.astyle-check-stamp)
    astyle $(ASTYLEFLAGS) $< && touch $@

would be the make-style. It would re-check each changed source file with astyle and skipped already checked files.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜