Author Topic: cbMakefileGen plugin  (Read 152929 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: cbMakefileGen plugin
« Reply #15 on: July 27, 2007, 08:26:08 pm »
Thank you.
I have no time now for update my plugin. But work is not stopped and to be continued later.


Would you welcome patches to your plugin?
What license is it under?

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 kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #16 on: July 30, 2007, 07:27:11 am »
Would you welcome patches to your plugin?
What license is it under?

Tim S

Patches welcomed of course. But I have a local repository only. I am ready create global repository if required.
License: GPL. Open source.
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen

Offline Vorl

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: cbMakefileGen plugin
« Reply #17 on: August 01, 2007, 07:12:18 pm »
Hello

I think that this plugin will be really usefull.
Do you plan to improve it ? I have noticed that it does not handle dependences (?) and that it use absolute paths. Would be very great to have these two points fixed :roll:

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: cbMakefileGen plugin
« Reply #18 on: August 02, 2007, 03:07:11 am »
Patches welcomed of course. But I have a local repository only. I am ready create global repository if required.
License: GPL. Open source.


I think it would help if you uploaded the zip file to a site to download from instead using a attachment in this thread.
Or, it would be better if you did an SVN or CVS repository, but I think for now just a file download would be enough.

I myself use http://www.savefile.com to share files, but they is many other free sites.

Tim S

Simple patch to add Virtual "All" Target

Code
diff --unified=3 --recursive --ignore-file-name-case --ignore-space-change --ignore-blank-lines --exclude='*.bak' cbmakegen.orig/cbmakegen.cbp cbmakegen/cbmakegen.cbp
--- cbmakegen.orig/cbmakegen.cbp 2007-06-22 11:11:48.000000000 -0400
+++ cbmakegen/cbmakegen.cbp 2007-08-01 20:50:44.890625000 -0400
@@ -46,6 +46,9 @@
  </ExtraCommands>
  </Target>
  </Build>
+ <VirtualTargets>
+ <Add alias="All" targets="default;" />
+ </VirtualTargets>
  <Unit filename="Makefile.cpp">
  <Option weight="30" />
  </Unit>
« Last Edit: August 02, 2007, 03:10:09 am by stahta01 »
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 kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #19 on: August 02, 2007, 07:15:46 am »
Hello

I think that this plugin will be really usefull.
Do you plan to improve it ? I have noticed that it does not handle dependences (?) and that it use absolute paths. Would be very great to have these two points fixed :roll:

I do registered on BerliOS and create project cbMakefileGen for support this project. Now I wait for update BerliOS configs.

About absolute paths:
I don't use a project options for resolve absolute or relative pathname now. I would check this project options for resolve pathnames.
About dependences:
My investigations is empty, I can't found possibility for get dependences for files now. If you knows, get me information.
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen

Offline kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #20 on: August 02, 2007, 07:35:59 am »
I think it would help if you uploaded the zip file to a site to download from instead using a attachment in this thread.
Or, it would be better if you did an SVN or CVS repository, but I think for now just a file download would be enough.

Wait a minute, please, I do registered on BerliOS and would create repository and zip versions this plugin.

Simple patch to add Virtual "All" Target
...
Thank you for patch. I made a some changes too. I would upload sources and distributives to BerliOS after refresh configs.

I have problems for creating distibutive for linux now. Anybody help me? Ubuntu 6.10 installed on my work machine. Thanks.
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: cbMakefileGen plugin
« Reply #21 on: August 02, 2007, 08:01:16 am »
I have problems for creating distibutive for linux now. Anybody help me? Ubuntu 6.10 installed on my work machine. Thanks.

I can do minor help getting it to compile and run under Ubuntu, but I have no idea on how to do an deb package.

Is it an runtime issue? Or an packaging issue?

Tim S

I use andLinux under Windows XP and can do minor testing and debugging of the code in it.
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 kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #22 on: August 02, 2007, 08:22:11 am »
I have problems for creating distibutive for linux now. Anybody help me? Ubuntu 6.10 installed on my work machine. Thanks.

I can do minor help getting it to compile and run under Ubuntu, but I have no idea on how to do an deb package.

Thank you, for help. I have no problem with compile and run.

Is it an runtime issue? Or an packaging issue?

Both. On first time required create package for install plugin. May be anybody want use this plugin and can't compile it.

I use andLinux under Windows XP and can do minor testing and debugging of the code in it.

Thank you for your help. Tests can help me for improve plugin.

I do upload sources to BerliOS to my project named cbMakefileGen. Anybody can checkout repository now:

svn checkout svn://svn.berlios.de/cbmakegen/trunk
or
svn checkout http://svn.berlios.de/svnroot/repos/cbmakegen/trunk


Anybody can send a feature requests, bug reports and patches now.
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: cbMakefileGen plugin
« Reply #23 on: August 02, 2007, 08:57:43 am »
FYI:

I had to remove the path C:\utility\7-Zip\

Tim S

Code
Index: cbmakegen.cbp
===================================================================
--- cbmakegen.cbp (revision 1)
+++ cbmakegen.cbp (working copy)
@@ -83,7 +83,7 @@
  <ExtraCommands>
  <Add after="zip -j9 ..\..\..\devel\share\CodeBlocks\cbMakefileGen.zip manifest.xml" />
  <Add after="zip -j9 cbMakefileGen.cbplugin ..\..\..\devel\share\CodeBlocks\cbMakefileGen.zip ..\..\..\devel\share\CodeBlocks\plugins\cbMakefileGen.dll" />
- <Add after="C:\utility\7-Zip\7z.exe a cbMakefileGen.7z cbMakefileGen.cbplugin" />
+ <Add after="7z.exe a cbMakefileGen.7z cbMakefileGen.cbplugin" />
  <Mode after="always" />
  </ExtraCommands>
  </Target>
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 kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #24 on: August 02, 2007, 10:32:02 am »
FYI:
I had to remove the path C:\utility\7-Zip\
Fixed into repository now. Thanks!
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen

Offline Vorl

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: cbMakefileGen plugin
« Reply #25 on: August 02, 2007, 06:06:15 pm »
About dependences:
My investigations is empty, I can't found possibility for get dependences for files now. If you knows, get me information.

I don't know CB very well but I would be surprise that you cannot access to the dependences. I will try to have a look at the source code tomorrow. As a last resort, I think that the depences are in the file <projectname>.depend and it would be possible to parse this file (?).
« Last Edit: August 02, 2007, 06:08:53 pm by Vorl »

Offline kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #26 on: August 03, 2007, 08:25:44 am »
About dependences:
My investigations is empty, I can't found possibility for get dependences for files now. If you knows, get me information.

I don't know CB very well but I would be surprise that you cannot access to the dependences. I will try to have a look at the source code tomorrow. As a last resort, I think that the depences are in the file <projectname>.depend and it would be possible to parse this file (?).

No, I can't found this possibility. I think C::B has this feature.
<projectname>.depend: I want investigate sources for search using this file. I want search using it like internal object (like tree for each file).
depslib (plugins/compilergcc/depslib) contant a lot functions for check dependencies, I investigate this library now.
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen

Offline Vorl

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: cbMakefileGen plugin
« Reply #27 on: August 03, 2007, 07:06:26 pm »
After a quick look in the source code today, it seems effectively that it won't be easy : everything seems done by depslib but it does not propose a method to get the list of dependences for a file.
the .depend file is actually the dump of the cache of depslib. Parsing it could be the simplest way.
Another way would be to use the -M... options of gcc but it will be more complex I think.


Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: cbMakefileGen plugin
« Reply #28 on: August 03, 2007, 09:29:19 pm »
The easiest way to find dependencies is to let g++ to tell you what are they by using -MT, -MD & -MM flags.

For example, lets say you have a project with 2 files, test.cpp and main.cpp, and they both link into an executable, so the makefile
that can handle dependencies is something like this:

Code
Objects=Debug\test.o Debug\main.o
IncludePath=-I.

TestExec: $(Objects)
g++ -o TestExec $(Objects)

Debug\test.o: test.cpp Debug\test.o.d
g++ -c test.cpp -g  -o Debug\test.o $(IncludePath)

Debug\test.o.d:
@g++ -g $(IncludePath) -MTDebug\test.o -MFDebug\test.o.d -MM test.cpp

Debug\main.o: main.cpp Debug\main.o.d
g++ -c main.cpp -g   -o Debug\main.o $(IncludePath)

Debug\main.o.d:
@g++ -g $(IncludePath) -MTDebug\main.o -MFDebug\main.o.d -MM main.cpp

clean:
-if exist Debug\test.o del Debug\test.o
-if exist Debug\test.o.d del Debug\test.o.d
-if exist Debug\main.o del Debug\main.o
-if exist Debug\main.o.d del Debug\main.o.d
-if exist $(OutputFile) del $(OutputFile)
-if exist $(OutputFile).exe del $(OutputFile).exe

-include Debug/*.d


Note that for every object, I am adding another dependencie: <object_name>.d, for example:
Code
Debug\test.o: test.cpp Debug\test.o.d

Now, the rule for 'Debug\test.o.d', is:
Code
Debug\test.o.d:
@g++ -g $(IncludePath) -MTDebug\test.o -MFDebug\test.o.d -MM test.cpp
which invokes g++ preprocessor to create it. Open the .d file (it is a text file), and you will see there a single makefile rule generated by g++ for Debug\test.o, which includes all the dependencies required for test.o (I used here MM to omit system dependencies, such as stdio.h etc)

By chagning any of the file that test.cpp is including, the makefile will recompile it.

HTH,
Eran

Offline kisoft

  • Almost regular
  • **
  • Posts: 194
Re: cbMakefileGen plugin
« Reply #29 on: August 06, 2007, 08:06:53 am »
After a quick look in the source code today, it seems effectively that it won't be easy : everything seems done by depslib but it does not propose a method to get the list of dependences for a file.
the .depend file is actually the dump of the cache of depslib. Parsing it could be the simplest way.
Another way would be to use the -M... options of gcc but it will be more complex I think.

If .depend is C::B feature (I think it's true) then I being use this file for parsing for search dependencies.

The easiest way to find dependencies is to let g++ to tell you what are they by using -MT, -MD & -MM flags.

For example, lets say you have a project with 2 files, test.cpp and main.cpp, and they both link into an executable, so the makefile
that can handle dependencies is something like this:

...

Thank you very much, eranif. Example is excellent and very completely!

This method is good for gcc compiler only. Another compilers has other or don't has this feature.
But this method - one more way and may be used optionally.

So, parsing is win now :)

.d method will be realizated later if anybody wish it.
OS: WinXPSP3
wxWidgets: 2.8.12
CodeBlocks: Master github cbMakefileGen plugin:
https://github.com/kisoft/cbmakefilegen