zoukankan      html  css  js  c++  java
  • 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.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:UsersADMINI~1AppDataLocalTemp
    ma15980.
    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:UsersADMINI~1AppDataLocalTemp
    mb15980.
    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.
  • 相关阅读:
    预习非数值数据的编码方式
    预习原码补码
    C语言||作业01
    C语言寒假大作战04
    C语言寒假大作战03
    C语言寒假大作战02
    C语言寒假大作战01
    C语言|作业12—学期总结
    C语言|博客作业11
    第三章预习
  • 原文地址:https://www.cnblogs.com/licb/p/nmake.html
Copyright © 2011-2022 走看看