Makefile选项的含义

时间:2014-08-08 14:05:03

标签: linux shell makefile

下面的Makefile规则 -

SUBDIRS = foo bar baz

 subdirs:
         for dir in $(SUBDIRS); do \
           $(MAKE) -C $$dir; \
         done

中有选项-C。有人能告诉我这个选项的功能是什么吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

 -C dir, --directory=dir
            Change to directory dir before reading the makefiles or doing anything else.  If multiple -C options are specified, each is interpreted relative to the previous one: -C  /  -C  etc  is
            equivalent to -C /etc.  This is typically used with recursive invocations of make.