开发者

How do I create a makefile rule to run astyle?

开发者 https://www.devze.com 2023-04-03 04:21 出处:网络
I\'d like to create a makefile rule to run astyle on any writable source files. Currently, I have a rule like the following:

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

精彩评论

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

关注公众号