Author Topic: cbp2make - makefile generation tool  (Read 758220 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6246
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: cbp2make - makefile generation tool
« Reply #120 on: August 26, 2024, 04:13:37 pm »

https://github.com/stahta01/MINGW-packages/actions/runs/10543268999#artifacts

Link to 4 versions of untested packages.

These packages are autodeleted in time; I have no idea how long I think it was 90 days.

Tim S.

Thanks. I will try it, it looks like I need to use the pacman command to manually install this package.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6246
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: cbp2make - makefile generation tool
« Reply #121 on: August 26, 2024, 04:22:21 pm »
Oh, sorry, it looks like cbp2make is a plugin already in our C::B's code repo, so I can simply build it or use the nightly build version.  :(

Sorry about the noise.

EDIT:

cbp2make.exe is an standalone program, so I can directly call it.
« Last Edit: August 26, 2024, 04:29:25 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7846
Re: cbp2make - makefile generation tool
« Reply #122 on: March 16, 2025, 10:54:32 pm »
I have added cbp2make to the msys2 mingw codeblocks package; so, the cbp2make.exe will in a few days be part of the codeblocks msys2 mingw package.
C Programmer working to learn more about C++.
On Windows 11 64 bit using MSys2 UCRT64.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mirai

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: cbp2make - makefile generation tool
« Reply #123 on: Yesterday at 02:51:44 pm »
There's a repo on Github where I publish newer revisions of cbp2make https://github.com/mirai-computing/cbp2make
Recently it's mostly bigfixes and small improvements, but you still may want to check it out.

Offline mirai

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: cbp2make - makefile generation tool
« Reply #124 on: Today at 11:50:10 am »
Three years later... built-in variables time again!

I've reviewed the code again and it looks like where I'm stuck with built-ins is applying the macro replacement, more precisely with understanding where those replacements may and may not occur.
In C::B sources everything is built around MacrosManager and it's doing a lot of different things inside for different purposes so it's hard to figure out what interactions with MacrosManager are related to built-in variables and probably user variables too.

Here's a quote from C::B wiki
Quote
Code::Blocks treats the following functionally identical character sequences
inside pre-build, post-build, or build steps as variables:

$VARIABLE
$(VARIABLE)
${VARIABLE}
%VARIABLE%

Variable names must consist of alphanumeric characters and are not case-sensitive.
Variables starting with a single hash sign (#) are interpreted as global compiler
variables. The names listed below are interpreted as builtin types.

Variables which are neither global user variables nor builtin types are replaced
with a value provided in the project file, or with an environment variable if the
latter should fail.

Per-target definitions have precedence over per-project definitions.

It's pretty clear how to process with pre-build and post-build steps as these are just user provided scripts.
However it is not clear to me what should I do about build steps.

The main question is where built-in and user variables may and may not appear?
I'm already setting up all variables I know how to define but I can't decide where exactly should I apply macro expansion.
Should it be every GNU Make macro value and every build instruction in every rule?