Code::Blocks Forums

User forums => Help => Topic started by: mark1977 on January 09, 2013, 10:28:30 pm

Title: Custom Makefile build does not produce same output as command line
Post by: mark1977 on January 09, 2013, 10:28:30 pm
Hi ,

I am using cb svn 8455 on Linux.

When I use a custom Makefile, the result of building the project is:
Code
Running command: make -f /home/mark/Codes/CPC3/Makefile Debug
make: *** No rule to make target `CPbnd_mpi.cpp', needed by `CPbnd_mpi.o'. Stop.

This is strange to me, it's almost as if cb is using an olf Makefile. When I copy and paste the above command onto the command line, the make proceeds fine without any errors.

If I go to project properties then I am using a custom makefile: /home/mark/Codes/CPC3/Makefile
and the box underneath is checked.

Why does the build not produce the same result as the command line?

Thanks,

Mark
Title: Re: Custom Makefile build does not produce same output as command line
Post by: stahta01 on January 10, 2013, 12:48:33 am
Are you using the same make executable file?
What is the working folder you are running the command in?
Is Code::Blocks using the same working folder?
Code::Blocks typically defaults to using the same folder holding the project file as the working folder.

I am not sure what it uses for custom makefile projects.

Tim S.
Title: Re: Custom Makefile build does not produce same output as command line
Post by: Jenna on January 10, 2013, 01:19:21 am
The Makefile: textcontrol should contain just the makefiles name ("Makefile" in your case) and the Execution directory: field for the makefile should contain the path to it (either absolute or relative to the project) in your case "/home/mark/Codes/CPC3/" .
Title: Re: Custom Makefile build does not produce same output as command line
Post by: mark1977 on January 12, 2013, 07:16:34 pm
Thanks both for your help.

Jens' solution worked.