user994165
user994165

Reputation: 9512

Eclipse CDT Custom Makefile

I have a C project and I'm trying to use my own makefile. In C/C++ Build Settings I unchecked "use default build command" and I also changed make to make -f ${ProjDriPath}/GNUmakefile

The make file is GNUmakefile. I get the following message:

make: * No rule to make target `/GNUmakefile'. Stop.

The command was originally "make" and the checkbox was checked, but when I went to build in Eclipse, I got an error message about more than one main function. I have several source files in the project that are each compiled separately. So that's why I tried changing the Eclipse settings. The "make" command works from the terminal.

Upvotes: 3

Views: 1732

Answers (1)

Daniel Fischer
Daniel Fischer

Reputation: 183898

I changed "make" to "make -f ${ProjDriPath}/GNUmakefile"

I get the following message "make: * No rule to make target `/GNUmakefile'. Stop. "

I strongly suspect that you

  • haven't set the environment variable ProjDirPath, or
  • have copy-pasted the make command above and have the typo ProjDriPath only in that command, but not in the environment variable.

With the environment variable not set, it expands to an empty string, and make searches for /GNUmakefile, which of course doesn't exist in the root directory. Then make has no rule to create it, and reports that message.

Upvotes: 5

Related Questions