Skip to content
Advertisement

Makefile : No rule to make target

I have a problem with Makefile. It should compile a .c file to an object file only if the .c file has been modified. But I have an error when I use all rule:

JavaScript

When I use manually it works:

JavaScript

My work directory:

JavaScript

Makefile content:

JavaScript

Advertisement

Answer

this dependency line:

JavaScript

concatenates $(OBJ_PATH) with the object name, but there’s a / missing, should be

JavaScript

else it expands (ex: for main) to:

JavaScript
Advertisement