我的电脑在 Cygwin 上找不到我的 makefile (windows)
MY computer can't find my makefile on Cygwin (windows)
我正在尝试 运行 cygwin 的 make 实用程序,它一直告诉我“***没有指定目标,也没有找到 Makefile。停止”
我不明白。如果有帮助的话,这是我的 makefile,它叫做 Makefile.mak:
TestSet.out: TestSet.o Set.o
g++ -o TestSet.out TestSet.o Set.o
TestSet.o: TestSet.cpp Set.h SetInterface.h
g++ -c TestSet.cpp
Set.o: Set.cpp Set.h SetInterface.h
g++ -c Set.cpp
clean:
rm TestSet.out TestSet.o Set.o
This is my makefile if it helps, it's called Makefile.mak
那就是你的问题了。
这不是 make
默认查找的名称之一。
您需要重命名文件或使用 make -f Makefile.mak
见http://www.gnu.org/software/make/manual/make.html#Makefile-Arguments
您还应该确保安装了 Cygwin 的手册页,然后您可以 运行 man make
并且您将看到:
If no -f option is present, make
will look for the makefiles GNUmakefile
, makefile
, and Makefile
, in that order.
这也可以回答你的问题,因为它没有提到名为 Makefile.mak
的文件
我正在尝试 运行 cygwin 的 make 实用程序,它一直告诉我“***没有指定目标,也没有找到 Makefile。停止”
我不明白。如果有帮助的话,这是我的 makefile,它叫做 Makefile.mak:
TestSet.out: TestSet.o Set.o
g++ -o TestSet.out TestSet.o Set.o
TestSet.o: TestSet.cpp Set.h SetInterface.h
g++ -c TestSet.cpp
Set.o: Set.cpp Set.h SetInterface.h
g++ -c Set.cpp
clean:
rm TestSet.out TestSet.o Set.o
This is my makefile if it helps, it's called Makefile.mak
那就是你的问题了。
这不是 make
默认查找的名称之一。
您需要重命名文件或使用 make -f Makefile.mak
见http://www.gnu.org/software/make/manual/make.html#Makefile-Arguments
您还应该确保安装了 Cygwin 的手册页,然后您可以 运行 man make
并且您将看到:
If no -f option is present,
make
will look for the makefilesGNUmakefile
,makefile
, andMakefile
, in that order.
这也可以回答你的问题,因为它没有提到名为 Makefile.mak