News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

cbMakefileGen plugin

Started by kisoft, June 22, 2007, 10:17:13 AM

Previous topic - Next topic

stahta01

Quote from: kisoft on July 27, 2007, 08:46:01 AM
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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kisoft

Quote from: stahta01 on July 27, 2007, 08:26:08 PM
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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]

Vorl

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:

stahta01

#18
Quote from: kisoft on July 30, 2007, 07:27: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


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>
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kisoft

Quote from: Vorl 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:

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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]

kisoft

Quote from: stahta01 on August 02, 2007, 03:07:11 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.

Quote from: stahta01 on August 02, 2007, 03:07:11 AM
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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]

stahta01

Quote from: kisoft on August 02, 2007, 07:35:59 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kisoft

Quote from: stahta01 on August 02, 2007, 08:01:16 AM
Quote from: kisoft on August 02, 2007, 07:35:59 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.

Quote from: stahta01 on August 02, 2007, 08:01:16 AM
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.

Quote from: stahta01 on August 02, 2007, 08:01:16 AM
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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]

stahta01

FYI:

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

Tim S


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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kisoft

Quote from: stahta01 on August 02, 2007, 08:57:43 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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]

Vorl

#25
Quote from: kisoft on August 02, 2007, 07:15:46 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 (?).

kisoft

Quote from: Vorl on August 02, 2007, 06:06:15 PM
Quote from: kisoft on August 02, 2007, 07:15:46 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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]

Vorl

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.


eranif

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:

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:
Debug\test.o: test.cpp Debug\test.o.d

Now, the rule for 'Debug\test.o.d', is:
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

kisoft

Quote from: Vorl 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.

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

Quote from: eranif 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:

...

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:
[url="https://github.com/kisoft/cbmakefilegen"]https://github.com/kisoft/cbmakefilegen[/url]