一个关于Makefile里面清除文件的问题
mathe 2013-02-25 10:26:01 我在自己的工程里面需要使用一个外部的库,假设这个库为libtest,放在目录external/libtest下面
而编译这个库,我们需要先运行其下面的configure文件产生Makefile,然后make之。同样如果要清楚这个工程,可以使用Make clean来清除。
于是我在自己的Makefile里面添加:
external/libtest/Makefile:
cd external/libtest/configure
external/libtest/libtest.lib: external/libtest/Makefile
$(MAKE) -C external/libtest
clean:
$(MAKE) clean -C external/libtest
****//and other clean options
问题就处在这里,我另外一个同事从SVN里面更新代码以后,直接使用
make clean
来清除临时文件
由于这个时候external/libtest下面的Makefile还没有产生
$(MAKE) clean -C external/libtest
报错了。
大家有什么好的建议处理这个问题?也就是说我这里实际需要的是一个条件编译,只有文件external/libtest/Makefile存在的时候才执行