Author Topic: Custom Makefile build does not produce same output as command line  (Read 4360 times)

Offline mark1977

  • Multiple posting newcomer
  • *
  • Posts: 26
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Custom Makefile build does not produce same output as command line
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Custom Makefile build does not produce same output as command line
« Reply #2 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/" .

Offline mark1977

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: Custom Makefile build does not produce same output as command line
« Reply #3 on: January 12, 2013, 07:16:34 pm »
Thanks both for your help.

Jens' solution worked.