Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » True post-build actions(How to setup a post-build action)
True post-build actions [message #1841671] Tue, 25 May 2021 12:43 Go to next message
Joel Loyer is currently offline Joel LoyerFriend
Messages: 2
Registered: May 2021
Junior Member
Hi,

I work on a C cross platform project using Eclipse 2020-06 (4.16.0) under Ubuntu 18.04..5.

The project is set to generate a flash image .bin from the .elf with the "Cross ARM GNU Create Flash Image" tools.

As I have an action to perform on the .bin file, I naively have added it in the post-build command.

After several trials, and a message always saying that the ".bin" file is missing, conclusion is that the post-build command is not a post-build command , but a post-elf-generation command.

How can I setup an automatic action as needed ?

Thanks for your help.
Re: True post-build actions [message #1841794 is a reply to message #1841671] Sun, 30 May 2021 07:41 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Actually, "post-build" is just another make target.
It has no prerequisites and is called as the last target of a make run.
When used, the makefile contains (using @echo "post build" as the post-build command):

all:  target-exe

target-exe:
	<link recipe>
	-$(MAKE) --no-print-directory post-build

post-build:
	-@echo "post build"
	-@echo ' '


Note that post-build is run at the end of the link step.
I would expect it should be used to create the bin file.

If you also have a pre-build step, the makefile becomes
all:
	$(MAKE) --no-print-directory pre-build
	$(MAKE) --no-print-directory main-build
Where "main-build" contains the recipe formerly used by "all".

You could run a batch file in the post-build that generates the bin then whatever else you want.

The makefile generated by CDT is more for run-of-the-mill builds.
You probably should consider writing your own makefile
or turn off makefile generation after the first build and modify the makefile.

This is for plain vanilla CDT.
If you are using a third party plugin then you should direct this question to its developers.

[Updated on: Sun, 30 May 2021 07:49]

Report message to a moderator

Re: True post-build actions [message #1841816 is a reply to message #1841794] Mon, 31 May 2021 07:07 Go to previous messageGo to next message
Joel Loyer is currently offline Joel LoyerFriend
Messages: 2
Registered: May 2021
Junior Member
Thanks for your answer David.
I will consider transferring the bin generation in the post-build step and compute it as I need.
Re: True post-build actions [message #1857796 is a reply to message #1841671] Sun, 26 February 2023 13:21 Go to previous message
gabi segev sarussi is currently offline gabi segev sarussiFriend
Messages: 1
Registered: February 2023
Junior Member
project->properties->c/C++ build->setting->build Steps:
Post-Build steps
Previous Topic:Build output parser misses some include paths
Next Topic:eclipse c/c++ IDE cannot compile when using iostream
Goto Forum:
  


Current Time: Tue Apr 23 17:38:56 GMT 2024

Powered by FUDForum. Page generated in 0.04366 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top