Windows 上的 Makefile 干净 [英] Makefile clean on windows

查看:32
本文介绍了Windows 上的 Makefile 干净的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在学习使用 makefile,我制作了以下 makefile(我在 windows 上使用 Visual Studio 命令行编译器)

I'm learning about using makefiles now and I made the following makefile (I'm on windows using visual studio command line compiler)

CC = cl
CFLAG = /EHsc
test_database.exe: composer.obj database.obj test_database.obj
    $(CC) test_database.obj database.obj composer.obj
test_database.obj: test_database.cpp
    $(CC) $(CFLAGS) -c test_database.cpp
composer.obj: composer.cpp composer.h
    $(CC) $(CFLAGS) -c composer.cpp
database.obj: database.cpp database.h
    $(CC) $(CFLAGS) -c database.cpp

.PHONY : clean
clean:
    rm -f *.obj

每当我调用 make clean 时,我都会得到 make:中断/异常被捕获 (code = 0xc00000fd, addr = 0x4ff283)我不太确定我做错了什么.我可以使用 make 编译程序没问题我只是在我瞄准干净时得到错误.rm 存在于我的机器上,并且在我一直使用它的路径上.我已经用 DEL 试过了,也有同样的错误.任何为我指明正确方向的帮助将不胜感激.

Whenever I invoke make clean I get make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4ff283) I'm not quite sure what I'm doing wrong. I can use make to compile the program no problem I just get the error when I target clean. rm exists on my machine and is on the path as I use it all the time. I've tried it with DEL as well with an identical error. Any help pointing me in the right direction would be appreciated.

Make 版本是 GNU Make 3.80

推荐答案

最近,我遇到了同样的问题.在我的情况下,转义星号(即 rm -rf \*.obj)似乎解决了这个问题.虽然我的 make 版本有点新:GNU Make 3.81.

Recently, I faced the same problem. In my case it appears that escaping an asterisk (that is rm -rf \*.obj) solved the problem. Though my make version is a bit newer: GNU Make 3.81.

这篇关于Windows 上的 Makefile 干净的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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