Author Topic: How to create a project through makefile in codeblocks  (Read 10328 times)

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
How to create a project through makefile in codeblocks
« on: February 21, 2017, 05:19:45 am »
I am new to codeblocks. I want to create my own project through makefile. How can I do so, any help?

My main purpose is to create a plugin. I look through the codeblocks svn code and check the plugin section. There i found that none of the plugins have any project (.cbp) file but only makefile.am. So I doubt that In codeblocks people use to develop plugins through makefile rather than using the codeblocks plugin wizard available within codeblocks.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to create a project through makefile in codeblocks
« Reply #1 on: February 21, 2017, 10:44:04 am »
There are (multiple) project files for every plugin. But there are also Makefiles so codeblocks can be build without codeblocks

Quote
So I doubt that In codeblocks people use to develop plugins through makefile rather than using the codeblocks plugin wizard available within codeblocks.
It is possible that the wizard is outdated or the project is not set up probably.

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: How to create a project through makefile in codeblocks
« Reply #2 on: February 22, 2017, 08:11:33 am »
Hi
Quote
There are (multiple) project files for every plugin. But there are also Makefiles so codeblocks can be build without codeblocks

If you'll check the plugins directory "C:\zbcqcm\codeblocks_svn_code\code\src\plugins". None of the plugin has .cbp file corresponding to it. Only plugins available here "C:\zbcqcm\codeblocks_svn_code\code\src\plugins\contrib" have the cbp file. Why is it so?

Moreover If I guess that all core plugins are build up by makefile and contrib plugin is build by plugin wizard, Am I right?
Can you answer some of my queries?

- Debuggergdb is a core plugin or contrib plugin? as it doesn't contain any ,cbp file, i guess its a core plugin.
- From contrib plugin, if I open .cbp file and delete makefile, plugin project still execute fine, does it mean if I have .cbp, I don't need makefile?
- I want to start building a project from makefile, can you help me with any documentation?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to create a project through makefile in codeblocks
« Reply #3 on: February 22, 2017, 10:50:34 am »
There are two completely independent ways to build codeblocks:
1) Using cb projects
2) Using Makefiles
Both have nothing to do with each other *). Cb project files are self-sustaining, all needed information is stored in there. You can't find project files for the core plugins because they are stored in the Codeblocks.cbp as targets. You can for example build the debugger plugin by selecting the target "Debugger" within the codeblocks source.



*) You have the possibility to use makefiles within the codeblocks project, by creating a Makefile project, or you set it up with Project->Properties->This is a custom Makefile
     Then the project file is simply a collection of file names, because the whole build process is handled by the makefile...
This is not how codeblocks itself is build. Codeblocks is build by either using Makefiles OR Project files /Workspace

Quote
Can you answer some of my queries?
I hope i have answered all your question. If not please ask again ;)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: How to create a project through makefile in codeblocks
« Reply #4 on: February 22, 2017, 01:53:06 pm »
There are two completely independent ways to build codeblocks:
1) Using cb projects
2) Using Makefiles
Both have nothing to do with each other

There is a tool called cbp2make for creating make files from codeblocks project files. Not sure how up to date it is now, but it can be a good way for distributing software to others (e.g. github).