首页 > 代码库 > nmake学习笔记2

nmake学习笔记2

makefile中的“@<<”看起来很奇怪,查很多地方都没有结果。写了两个示例比较其结果:

如果makefile如下:

All:main.obj func.obj    link $**.cpp.obj:    cl /c $<    clean:  erase *.obj  erase *.exe

输出为:

Microsoft (R) Program Maintenance Utility   Version 6.00.9782.0Copyright (C) Microsoft Corp 1988-1998. All rights reserved.        cl /c main.cppMicrosoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86Copyright (C) Microsoft Corp 1984-1998. All rights reserved.main.cpp        cl /c func.cppMicrosoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86Copyright (C) Microsoft Corp 1984-1998. All rights reserved.func.cpp        link main.obj func.objMicrosoft (R) Incremental Linker Version 6.00.8447Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

在makefile中加入“@<<”,代码如下:

All:main.obj func.obj    link $**.cpp.obj:    cl @<</c $<<<    clean:  erase *.obj  erase *.exe

输入出:

Microsoft (R) Program Maintenance Utility   Version 6.00.9782.0Copyright (C) Microsoft Corp 1988-1998. All rights reserved.        cl @C:\Users\ADMINI~1\AppData\Local\Temp\nma15980.Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86Copyright (C) Microsoft Corp 1984-1998. All rights reserved.cl /c main.cppmain.cpp        cl @C:\Users\ADMINI~1\AppData\Local\Temp\nmb15980.Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86Copyright (C) Microsoft Corp 1984-1998. All rights reserved.cl /c func.cppfunc.cpp        link main.obj func.objMicrosoft (R) Incremental Linker Version 6.00.8447Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

 

nmake学习笔记2