User forums > Embedded development
Looking for example of "Post-build steps"
BlueHazzard:
--- Quote from: Pavel_47 on December 04, 2016, 05:28:48 pm ---One question remains: if there are multiple .o files in TARGET\src, how to modify the post-build command in order to take into account all .o files ?
--- End quote ---
You can use squirrel scripting for this: http://wiki.codeblocks.org/index.php/Scripting_Code::Blocks
http://wiki.codeblocks.org/index.php/Variable_expansion#Script_expansion
greetings
christobal:
--- Quote from: BlueHazzard on December 04, 2016, 07:06:05 pm ---
--- Quote from: Pavel_47 on December 04, 2016, 05:28:48 pm ---One question remains: if there are multiple .o files in TARGET\src, how to modify the post-build command in order to take into account all .o files ?
--- End quote ---
You can use squirrel scripting for this: http://wiki.codeblocks.org/index.php/Scripting_Code::Blocks
http://wiki.codeblocks.org/index.php/Variable_expansion#Script_expansion
greetings
--- End quote ---
That wouldn't be my preferred solution.
If you want assembly files for all compiled modules, just use the GCC compiler switch -save-temps and get rid of the post-build step.
Pavel_47:
--- Quote from: BlueHazzard on December 04, 2016, 07:06:05 pm ---
--- Quote from: Pavel_47 on December 04, 2016, 05:28:48 pm ---One question remains: if there are multiple .o files in TARGET\src, how to modify the post-build command in order to take into account all .o files ?
--- End quote ---
You can use squirrel scripting for this: http://wiki.codeblocks.org/index.php/Scripting_Code::Blocks
http://wiki.codeblocks.org/index.php/Variable_expansion#Script_expansion
greetings
--- End quote ---
Thanks. Quite tricky solution. Nevertheless I've made some attempts.
I didn't find a way how to integrate such script as a file and tried it "inline".
To see how it works I've just integrated a piece of code into pre-build section that prints all files in project.
It works fine, but for my task I need to access to target directory (i.e. default) to process .o files.
For the moment I didn't find a corresponding function from the list:
http://wiki.codeblocks.org/index.php/Scripting_commands
BlueHazzard:
it would be much more readable if you post the code and the log in code tags... Also it would save loading time/ data and space on the server
--- Quote ---I didn't find a way how to integrate such script as a file and tried it "inline".
--- End quote ---
you can try the dofile command: http://squirrel-lang.org/squirreldoc/stdlib/stdiolib.html#global-symbols But i am not sure if this is embedded in codeblocks
--- Quote ---t works fine, but for my task I need to access to target directory (i.e. default) to process .o files.
--- End quote ---
Can't you use hard coded paths? If you use standard templates from codeblocks the o files are always at the same sub direcotry... Or what exact information do you need?
hope this helps
greetings
Pavel_47:
--- Quote from: BlueHazzard on December 04, 2016, 11:14:16 pm ---Can't you use hard coded paths? If you use standard templates from codeblocks the o files are always at the same sub direcotry... Or what exact information do you need?
--- End quote ---
I didn't find any function that accept some kind of "coded path" as input parameter.
Otherwise how to iterate (i.e. execute for loop) trough the content of the target sub-directory where .o files are located ?
What information I need ...
Well, I need to get access to the target sub-directory and process all .o files that are located there with objdump command.
I see that script allows such kind of things. The problem is to obtain the handle to target sub-directory.
Actually, using GetProjectManager(), GetActiveProject(), I can obtain the handle to the project source files (.c, .S, .h), but not the obj (.o) ones.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version