Author Topic: compile with autotools  (Read 5841 times)

Offline albertolp

  • Single posting newcomer
  • *
  • Posts: 3
compile with autotools
« on: May 07, 2010, 07:47:37 pm »
Im trying to compile using c::b and autotools, but its not going good...

Ive got my in myproject/myproject.cbp, the sources it has to compile are in myproject/src and myproject/test

I went to project properties and check "this is a custom Makefile"


but when i try to compile it says:
make: *** No rule to make target `Debug'.  Stop.
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: compile with autotools
« Reply #1 on: May 07, 2010, 08:22:18 pm »
You can do either of the below

1. Change Code::Blocks configuration to match the makefile
2. Change the makefile to match Code::Blocks

I find it easier to change the makefile; but, since you are using the autotools this might not be easy.

What is the correct makefile target to be called for building?

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline albertolp

  • Single posting newcomer
  • *
  • Posts: 3
Re: compile with autotools
« Reply #2 on: May 08, 2010, 10:57:14 am »
myproject/Makefile build the entire project

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: compile with autotools
« Reply #3 on: May 09, 2010, 01:16:38 am »
I can not help you without getting real answers; I suggest you read about makefile organization; you need to understand what is a makefile target.

http://en.wikipedia.org/wiki/Makefile

Tim S.  

PS: Full Compile Logging might help you to understand what C::B is doing.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
« Last Edit: May 09, 2010, 01:19:47 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline albertolp

  • Single posting newcomer
  • *
  • Posts: 3
Re: compile with autotools
« Reply #4 on: May 10, 2010, 04:15:57 pm »
the target is all

and its the first target in my Makefile

Sorry, i misread you there :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: compile with autotools
« Reply #5 on: May 10, 2010, 05:32:19 pm »
the target is all

and its the first target in my Makefile

Sorry, i misread you there :)

Rename the CB target to "all" from "release" or "debug"; and the build should work.

Next is fixing the clean command; I have never fixed it without editing the makefile.
(I believe it is possible; I just never did it.)

The rest uses
Project -> Build Options
Tab "Make" Commands
Please record values before making changing
I have never changed theses settings; not sure best way to change them.

Tim S.
« Last Edit: May 10, 2010, 05:41:34 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: compile with autotools
« Reply #6 on: May 10, 2010, 06:46:19 pm »
If the makefile has no release or debug target, you can just remove the $target from the make-commands (including the clean) command and it should work.