V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xuyaomin
V2EX  ›  程序员

makefile make clean 报错

  •  
  •   xuyaomin · Oct 27, 2019 · 3457 views
    This topic created in 2379 days ago, the information mentioned may be changed or developed.

    main.exe: main.o g++ -o .\bin\main.exe .\obj\main.o

    main.o: .\cpp\main.cpp .\hpp\hello.hpp g++ -c .\cpp\main.cpp -Ihpp -o .\obj\main.o

    clean: rm .\bin*.*

    在 vscode powershell 下面执行 make clean 失败

    PS E:\demo\makefile> make clean rm .\bin*.* process_begin: CreateProcess(NULL, rm .\bin*.*, ...) failed. make (e=2): makefile:8: recipe for target 'clean' failed make: *** [clean] Error 2

    4 replies    2019-11-15 13:48:15 +08:00
    atempcode
        1
    atempcode  
       Oct 27, 2019
    这。。。论坛不是帮你做作业的啊
    citrix
        2
    citrix  
       Oct 27, 2019 via Android
    少了.PHONY: clean
    waruqi
        3
    waruqi  
       Oct 27, 2019 via Android
    换 xmake 吧
    xuyaomin
        4
    xuyaomin  
    OP
       Nov 15, 2019
    原因是 windows 下面不支持 rm,所以应该改为 del
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2559 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 06:09 · PVG 14:09 · LAX 23:09 · JFK 02:09
    ♥ Do have faith in what you're doing.