c - "make clean"结果 "No rule to make target ` 干净 '"

我正在运行 Ubuntu 10.04。每当我运行 make clean 时,我都会得到:

make: *** No rule to make target `clean'. Stop.

这是我的生成文件:

CC = gcc
CFLAGS = -g -pedantic -O0 -std=gnu99 -m32 -Wall
PROGRAMS = digitreversal
all : $(PROGRAMS)
digitreversal : digitreversal.o
       $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
.PHONY: clean
clean:
       @rm -f $(PROGRAMS) *.o core

任何想法为什么它不起作用?

编辑:好像在做:

make -f Makefile.txt clean

有效。现在:是否有任何设置要更改,所以我不必每次都执行 -f Makefile.txt

最佳答案

您的makefile 的名称似乎不是'Makefile' 或'makefile'。如果它是不同的说'abc'尝试运行'make -f abc clean'

https://stackoverflow.com/questions/4182118/

相关文章:

java - 使用 Gradle 的 Application 插件添加类路径条目

c - 去 1.5+ : Error - imports runtime: C source fil

c++ - 如何强制 clang 默认使用某些库?

c++ - 将 CMake 与同一语言的多个编译器一起使用

build - CMake:如何最好地构建多个(可选)子项目?

c++ - 包括 .cpp 而不是 header(.h)

gcc - 如何构建 MinGW W64

build - Unix : fast 'remove directory' for cleanin

ios - 如何使用 watchkit 应用程序从命令行生成 .ipa 文件

ios - asm中的未知寄存器名称 'q0'