Author Topic: Import project from Automake  (Read 13743 times)

Offline tomb_unaff

  • Single posting newcomer
  • *
  • Posts: 6
Import project from Automake
« on: December 01, 2008, 12:58:07 am »
I just download CLAMAV sources and I would like to use Code::Blocks IDE for debuging and development. (I am new to Code::Blocks).

But I cannot see: Import project from automake (or similar: cmake, qmake, ect...) Cannot find plugin...

Is there possiblity to somhow import this CLAMAV project into Code::Blocks?

Tom

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Import project from Automake
« Reply #1 on: December 01, 2008, 07:16:52 am »
But I cannot see: Import project from automake
If you ever see an IDE that allows to import automake (...) projects - tell me.
This is usually a by far too complex task to be done and is therefore nor supported by C::B.

Instead, analyse what's actually setup in the build (automake) process and setup your project accordingly. I did this many times with Makefile based projects - it's not too hard. As a bonus you can use the full palette of C::B functionality if you don't use a Makefile project. Which brings me to the other (less clever) option: Let automake generate the Makefiles and setup a C::B project which is based on Makefiles.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tomb_unaff

  • Single posting newcomer
  • *
  • Posts: 6
Re: Import project from Automake
« Reply #2 on: December 02, 2008, 07:15:44 pm »
Thanks for reply,

Although you can easily Import project from Makefile in Kdevelop, but I'd like to use CodeBlocks.

Quote
Let automake generate the Makefiles and setup a C::B project which is based on Makefiles.

Ok, I run ./configure and I got Makefile,
In next step I create new project:

File -> New -> Project

And I choose Console Application.

What shall I do next to get CLAMAV in C::B?

Is there some guide or tutorial how to create project for C::B form Makefile?

Thanks you in advance.
Tom


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Import project from Automake
« Reply #3 on: December 02, 2008, 09:01:27 pm »
Although you can easily Import project from Makefile in Kdevelop, but I'd like to use CodeBlocks.
I wonder if that really works reliable. You can do a lot strange things with Makefiles. I am sure KDevelop does not support each and every possible Makefile magic... but hey - I should give it a try... ;-)

Is there some guide or tutorial how to create project for C::B form Makefile?
No, there is not and there can hardly be (due to the reason I said above).
But: Try to setup a simple project (only a new, empty C::B project - nothing else). Then go to the project properties, enter the name of your Makefile and select "This is a custom Makefile". Don't forget to setup the project's (top-level) path correctly - meaning to store the project file in the folder where the "root" Makefile is.

Still: I strongly suggest you go to the Makefile(s) step by step and transfer the settings to C::B's build system. It's far easier to maintain and to adopt for the future.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Import project from Automake
« Reply #4 on: December 02, 2008, 09:42:26 pm »
Well, considering that KDevelop's build system is based on autoconf/make, the ability to import foreign makefiles is no big magic. It's pretty much copy-paste, and make will do the rest.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Import project from Automake
« Reply #5 on: December 02, 2008, 10:09:07 pm »
Well, considering that KDevelop's build system is based on autoconf/make, the ability to import foreign makefiles is no big magic. It's pretty much copy-paste, and make will do the rest.
Oh... understood. So that's no "magic" then... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tomb_unaff

  • Single posting newcomer
  • *
  • Posts: 6
Re: Import project from Automake
« Reply #6 on: December 03, 2008, 06:37:25 pm »
Thanks for reply,

MortenMacFly I did what you said & when I build application (Ctrl+F9)

I got this message:
make: *** No rule to make target `Debug'.  Stop.
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
I want to have a debug enable as well.
Is it something wrong with make file? Plese have a look into Makefile:

http://codepad.org/EiNZQRgM

Here is the CLAMAV project with Makefile:

Code
tomb@tomb_localhost ~/projects/aau/virus_scanner/av_scan/example/my_ex1 $ ls
AUTHORS        COPYING.unrar  NEWS                clamav-milter  configure     libclamav           my_ex1.layout
BUGS           COPYING.zlib   README              clamconf       configure.in  libclamav.pc        shared
COPYING        ChangeLog      UPGRADE             clamd          contrib       libclamav.pc.in     sigtool
COPYING.BSD    FAQ            aclocal.m4          clamdscan      database      libclamunrar        stamp-h1
COPYING.LGPL   INSTALL        clamav-config       clamscan       docs          libclamunrar_iface  target.h
COPYING.bzip2  Makefile       clamav-config.h     config         etc           libtool             test
COPYING.file   Makefile.am    clamav-config.h.in  config.log     examples      m4                  unit_tests
COPYING.lzma   Makefile.in    clamav-config.in    config.status  freshclam     my_ex1.cbp


And Screenshot of my Properties project in  CodeBlocks


How can I fix this?
Regards,
Tom
« Last Edit: December 03, 2008, 09:18:45 pm by tomb_unaff »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Import project from Automake
« Reply #7 on: December 03, 2008, 08:59:30 pm »
make: *** No rule to make target `Debug'.  Stop.
The error message is clear: You called make with the target "Debug" which is not present in your Makefile. ´C::B calls make with the name of the C::B target you are trying to compile. So either you make it available (if you want to debug) or you rename your target in C::B to the name of the target in the Makefile (which I don't know).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline tomb_unaff

  • Single posting newcomer
  • *
  • Posts: 6
Re: Import project from Automake
« Reply #8 on: December 04, 2008, 08:37:07 pm »
Thanks for reply,
OK, I will go for Release target.
Now when I Build Project(Ctrl+F9) I am getting following message:

Code
-------------- Build: Release in cl_release ---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done.

I don't have too much experiences with Makefile.
Can someone help and tell me what shall I do, what should be change  in Makefile to be able to build project?
Here is my Makefile http://codepad.org/EiNZQRgM

Thanks in advance,
Tom

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Import project from Automake
« Reply #9 on: December 04, 2008, 09:36:06 pm »
Try to rename your target to "all", that's the first (and therefore the default-)target inside the makefile.

Offline tomb_unaff

  • Single posting newcomer
  • *
  • Posts: 6
Re: Import project from Automake
« Reply #10 on: December 06, 2008, 11:32:11 pm »
Thank you jens,

You gave me nice hint!
Regards,
Tom