Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: zz on August 08, 2012, 03:03:52 am

Title: how to fix --- mingw32-make.exe: *** No rule to make target `Debug'. Stop
Post by: zz on August 08, 2012, 03:03:52 am
I have a very simple program like this:

#include <iostream>
int main() { std::cout << "test";};

However, when I use a makefile like below, I got the error  "mingw32-make.exe: *** No rule to make target `Debug'.  Stop"    Will anyone kind enough to point me to the right direction.  Thanks for any tips.


.PHONY: all
all: hello

# This rule tells make how to build hello from hello.cpp
hello: hello.cpp
   g++ -o hello hello.cpp

# This rule tells make to copy hello to the binaries subdirectory,
# creating it if necessary
.PHONY: install
install:
   mkdir -p binaries
   cp -p hello binaries

# This rule tells make to delete hello and hello.o
.PHONY: clean
clean:
   rm -f hello
Title: Re: how to fix --- mingw32-make.exe: *** No rule to make target `Debug'. Stop
Post by: MortenMacFly on August 08, 2012, 06:28:50 am
No rule to make target `Debug'.
Well your Makefile doesn't have a target named "Debug" - it is as simple as that. It has the targets "all", "hello" and "install" though. The Project's target name will be used with Makefile to address a specific target. (Note that Makefiles can have many targets, so there is a need to call a specific one.) Read yourself into the topic of Makefiles and correct the Makefile or just rename the target of you project you are compiling to match the target you want to address in the Makefile.
Title: Re: how to fix --- mingw32-make.exe: *** No rule to make target `Debug'. Stop
Post by: Jenna on August 08, 2012, 08:36:12 am
Or remove the $target in the make-options tab of the projects build-options, if you want to use the default target of the makefile.