使用NMAKE将所有源放在目录中? [英] Use NMAKE to make all source in a directory?

查看:120
本文介绍了使用NMAKE将所有源放在目录中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用nmake,是否可以让makefile自动生成当前目录中的所有.cpp文件,而无需单独指定?

Using nmake, is it possible to have the makefile build all the .cpp files in the current directory automatically, without having to specify them individually?

类似于:

O = $(OBJ_DIR)/main.obj
{$(SOURCE_DIR)}.cpp{$(OBJ_DIR)}.obj:
    ---COMPILE $< HERE---

我想避免指定每个obj。可以这样做吗?

I'd like to avoid having to specify each obj to make. Can this be done?

推荐答案

.cpp.obj:
    $(CC) $(CFLAGS) $*.cpp

是一个默认规则,从.cpp文件...

is a default rule that will automatically resolve .obj dependencies from .cpp files...

这篇关于使用NMAKE将所有源放在目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆