No rule to make target

This error message is something I see nearly every day in the Problems View:

mingw32-make: *** No rule to make target ….

No rule to make target

No rule to make target

It means that the make file cannot find my file. More precise, it means that the make utility cannot resolve the rule to build the ‘target’ (see my other post on make files). Or in other words: the make files do not match any more what I have in my project. There could be several reasons:

  1. A file does not exist any more or is under a different path. That is something I have to fix in the project.
  2. I have imported a project from another place.
  3. I have changed the IDE and now it has a path to the libraries.
  4. I have generated new/different source files with Processor Expert.

All of above lead to wrong makes files with wrong paths in it.

The cure for the problem is to select the project and use the menu Project > Clean:

Cleaning a project

Cleaning a project

This will give you a dialog where you can select which projects to clean:

Clean Dialog

Clean Dialog

This cause a re-creation of the make files.

Another solution is to delete the output folder where all the make files and object files are. This is equal to what exists in classic (non-eclipse) CodeWarrior in the menu Project > Remove Object Code… But first I need to know which folder I have to delete. The Build Directory in the project settings configures this:

Build Directory Settings

Build Directory Settings

Deleting that folder will remove all the make files and object files. Starting a new build afterwards will then recreate my make files.

Tip: If you are exporting a project, then make sure you delete the Build Directory from the archive/project. This will reduce the file size. And it avoids that the project will get generate a “No rule to make target” message.

Happy Cleaning 🙂

13 thoughts on “No rule to make target

  1. I’ve been bitten too many times by “unclean” builds. Every swear you made a change, but you don’t see the result from your compiled code?

    Due to this, I always clean before building. To make this easy, I when to Window > Preferences > General > Keys and then found the “Build Clean” item and gave it a key binding of Alt+C.


  2. Pingback: Dissection of MCU10 Projects | MCU on Eclipse

  3. Pingback: Copy my CodeWarrior Project | MCU on Eclipse

  4. Hi Erich,

    I Got my new FRDM-K64F board!!!!!:-) ready to role:-)

    But i faced this getting started error.

    I have this problem every time i upgrade my IDE or MQX version. Can you please help me figure out any permanent generic solution for same,

    Problem: Same error as above mention in blog

    Observation: when i import the example project of MQX RTOS for my new FRDM-K64F board, all the link location are incorrect, the make file cannot find the intFlash.ld to proceed and it abruptly stops

    error: mingw32-make: *** No rule to make target `C:/lib/frdmk64f.cw10gcc/debug/bsp/intflash.ld’, needed by `explicit-dependencies’. Stop.

    I need your help to figure out this Problem. Last time when i tried accidentally the problem was solved for K60 tower system.


    • I assume you already have tried the ‘clean’ workaround? Is your linker file in C:/lib/frdmk64f.cw10gcc/debug/bsp/intflash.ld? I suggest to carefully check the links if they are correct. And keep in mind that the compiler settings need to match the file locations as well.


      • Hi Erich,

        Yes as per your suggestion i corrected each link in compiler, assembler and linker now the project is build with no error.

        but one problem i am not able to solve is the source files are not getting copy in my workspace project causing error.

        as a work around i copied source file in workspace project and project->properties->resource updated the link address.

        this is ok when i am copy single file but may not be suitable to big example projects.

        Please guide me the correct way to do it.


        • Eclipse will find source files behind linked files and linked folders. However, if you have header files behind links, then Eclipse finds them, but not the compiler. So if you have linked header files or linked directories with header files, then you must specify the path to the header files in the compiler settings.


  5. Almost same error happens to me. In my case the solution was to check “MQX_ROOT_DIR”, that was looking in a different drive from my MQX installation. After fix it (for me it was C:\Freescale\Freescale_MQX_4_0 ) all compile and works perfectly. Thank for the post, it gives me the solution.


  6. When nothing worked I replaced concerned file(file name will be mentioned in the error message) in the workspace->driver directory with the same file which I had in my library firmware and the problem was knocked out.


Leave a Reply to Erich Styger Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.