码迷,mamicode.com
首页 > 其他好文 > 详细

nmake学习笔记2

时间:2014-08-27 17:56:38      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   io   for   div   代码   log   

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.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

        cl /c main.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

main.cpp
        cl /c func.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

func.cpp
        link main.obj func.obj
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (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.0
Copyright (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 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

cl /c main.cpp

main.cpp
        cl @C:\Users\ADMINI~1\AppData\Local\Temp\nmb15980.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

cl /c func.cpp

func.cpp
        link main.obj func.obj
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

 

nmake学习笔记2

标签:style   blog   color   os   io   for   div   代码   log   

原文地址:http://www.cnblogs.com/licb/p/nmake.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!