Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make: *** No rule to make target `all'. Stop. Eclipse error

Tags:

I've just downloaded Eclipse CDT developer kit (87MB) for Windows. I've also installed MinGW, and msys. I also added this to PATH: C:\msys\1.0\bin;C:\mingw\bin. and restarted computer after that. I've checked by type "make --version" in cmd and it works.

However, for some reason I cannot compile my C project. I don't get binary files and got only the following things in COnsole:

**** Build of configuration Default for project XXX ****

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

Could some one help me with this please?

like image 909
chepukha Avatar asked Sep 15 '10 05:09

chepukha


People also ask

What does No rule to make target mean?

No rule to make target generally means simply that you have a compiler version that does not match the original compiler used in the project. You only need to go to the project properties and change the compiler to use the one you installed.

What is make target in Eclipse?

A "make target" provides a way for developers to interactively select a makefile target from within the Eclipse environment. It is assumed that the makefile is named makefile , which will allow it to run with the default build tool configuration. This can be changed but is cleaner if defaults are used.

How do I stop compiling in eclipse?

In the right corner at the bottom there should be an icon which would open the progress view. There you can click the stop button.


2 Answers

For future reference, if you're trying to import an existing project with a makefile...

This message will still pop up if your makefile doesn't have an "all" rule. Using the "Generate Makefiles automatically" option should take care of this automatically. If you don't want makefiles made for you, you have at least 3 simple options...

Option 1

If you don't want to use a rule by that name, use twokats' solution. Here's a clarification.

  1. Go to Project Properties -> C/C++ Build -> Behaviour Tab.
  2. Leave Build (Incremental Build) Checked.
  3. Remove "all" from the text box next to Build (Incremental Build).

This lets Eclipse know you aren't trying to use a make target called "all". For some reason, that is the default.

Option 2

Use something similar to Etiennebr's makefile. Note, the all: $(TARGET) line is the rule that Eclipse is complaining it can't find.

Option 3

Substitute "all" with a rule name of your choice, and be sure to include that rule in your makefile.

like image 148
drmuelr Avatar answered Dec 30 '22 18:12

drmuelr


Just for your reference, there is a way to configure the CDT build options. I had this same error message (although I did have a make target - just not named "all") and found this solution (for Galileo + CDT):

Right click your project and choose Properties. The Properties dialog will appear and you should see a C/C++ Build option where you can set specific build options. Highlight this item, and the Properties page will appear. Choose the configuration you wish to modify, and then in the section below that you should see 2 tabs: Builder Settings and Behavior. It is the Behavior tab you want. In this section you can set preferences for build settings and workbench settings, including specifying a target name (default is "all") or turning off automatic builds.

This was incredibly helpful to me when I started using the CDT. My source code is separate from the build area, and until I configure, no makefiles exist. When I configured, my default target name is explicitly "default", not "all". It was annoying to have Eclipse report an error in my project before I did anything. Setting up the environment to match my development worked wonders. HTH.

like image 45
twokats Avatar answered Dec 30 '22 19:12

twokats