Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Post-Build Step
Post-Build Step [message #185571] Wed, 21 February 2007 16:08 Go to next message
Eclipse UserFriend
Originally posted by: jonathan.orditz.selectron.ch

Hi,

I want to use the Post-Build Step in order to modify some things on my
executable.

To make these changes I need to call different tools, but I can only write
one line in the Post-Build Step ! So the question: it is possible to write
more than one line for the Post-Build Step:
Command1.exe
Command2.exe, etc...

I have tried to call a batch File but then the ${variables} are not
replaced by their values...

Could someone help me to solve this problem ?

Thanks in advance...

Jonathan
Re: Post-Build Step [message #185588 is a reply to message #185571] Wed, 21 February 2007 17:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

You need to separate commands with a semi-colon:
command one ; command two ; command three etc

--
Derek


Jonathan wrote:
> Hi,
>
> I want to use the Post-Build Step in order to modify some things on my
> executable.
>
> To make these changes I need to call different tools, but I can only
> write one line in the Post-Build Step ! So the question: it is possible
> to write more than one line for the Post-Build Step:
> Command1.exe
> Command2.exe, etc...
>
> I have tried to call a batch File but then the ${variables} are not
> replaced by their values...
>
> Could someone help me to solve this problem ?
>
> Thanks in advance...
>
> Jonathan
>
Re: Post-Build Step [message #185676 is a reply to message #185588] Thu, 22 February 2007 09:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jonathan.orditz.selectron.ch

Hi,

I tried to separate the commands with a semi-colon but it does not work
because the semi-colon is considered as an argument for my command and
therefore an error is sent...

My example for Post-Build (as written in the makefile):
gohc166 -o ${ProjName}_l.hex ${ProjName}.abs ; HexFilt.exe
${ProjName}_l.hex

but I would need two lines in the makefile because of the arguments of the
commands:

gohc166 -o ${ProjName}_l.hex ${ProjName}.abs
HexFilt.exe ${ProjName}_l.hex

It is possible to get this in my Makefile ?
It is possible to give in a Line-Feed and Carriage Return ???

Because I do not know how I could tell my command (gohc166) that my list
of arguments is finished at the semi-colon and that a second command has
to be executed. Because I cannot modify gohc166 (this is a third party
software).

Using a batch file with all the commands is a problem for me because the
Eclipse Environment is not set in the Batch-file (PATH, ${variables},
etc...)

Do you have an idea how I can solve this problem ?

Thanks in advance !

Jonathan
Re: Post-Build Step [message #185692 is a reply to message #185676] Thu, 22 February 2007 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

Are you using a Standard Make project or a Managed Make project?

If you are using Managed Make, then select the properties for your project,
select 'C/C++ Build' from the list and click on the 'Build Steps' tab. Here you
will find 'Command' text fields - you can enter semi-colon separated commands here.

If you are using a Standard Make project you will need to edit your makefile.
You will need to create an additional dependency on your target and then add you
commands on that dependency.

For example

all: target.exe additional

target.exe: target.o
$(CC) ...

additional: (add any dependencies here)
(add you first command here)
(add your second command here)

Note that there is a tab character before each additional command. I suggest you
read a book on Make...


--
Derek


Jonathan wrote:
> Hi,
>
> I tried to separate the commands with a semi-colon but it does not work
> because the semi-colon is considered as an argument for my command and
> therefore an error is sent...
>
> My example for Post-Build (as written in the makefile):
> gohc166 -o ${ProjName}_l.hex ${ProjName}.abs ; HexFilt.exe
> ${ProjName}_l.hex
>
> but I would need two lines in the makefile because of the arguments of
> the commands:
>
> gohc166 -o ${ProjName}_l.hex ${ProjName}.abs
> HexFilt.exe ${ProjName}_l.hex
>
> It is possible to get this in my Makefile ?
> It is possible to give in a Line-Feed and Carriage Return ???
>
> Because I do not know how I could tell my command (gohc166) that my list
> of arguments is finished at the semi-colon and that a second command has
> to be executed. Because I cannot modify gohc166 (this is a third party
> software).
>
> Using a batch file with all the commands is a problem for me because the
> Eclipse Environment is not set in the Batch-file (PATH, ${variables},
> etc...)
>
> Do you have an idea how I can solve this problem ?
>
> Thanks in advance !
>
> Jonathan
>
Re: Post-Build Step [message #185723 is a reply to message #185692] Thu, 22 February 2007 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jonathan.orditz.selectron.ch

Hi,

I am using Managed Make project (so I think I do not need a book on Make
:-).
Until now I had only one command in the field "Command" from "Post-Build
Step" and it worked. But now I need to add one command more.

I tried your solution with the semi-colon but it does not seem to work in
my Eclipse 3.2.1. Do you have a newer version of Eclipse ?

When I use the ";" how has the managed Makefile to look like ? (to your
mind ?). Because my managed Makefile looks like this:

post-build:
-@echo ''
gohc166 -o TEST.hex TEST.abs ; HexFilt.exe TEST.hex
@echo ' '

And this cannot work... I am awaiting a managed Makefile which looks like
this:

post-build:
-@echo ''
gohc166 -o TEST.hex TEST.abs
HexFilt.exe TEST.hex
@echo ' '

Does your Eclipse Version works properly and generate the right post-build
? Have you tried it ?

Many thanks in advance !

Jonathan
Re: Post-Build Step [message #185730 is a reply to message #185723] Thu, 22 February 2007 14:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

This works perfectly for me on Windows XP... Which platform are you running?
Which version of Make?

I have added "command 1; command 2; command 3" to the post build step (as
described in my previous email). This works for CDT 3.0.x and 3.1.x.

--
Derek


Jonathan wrote:
> Hi,
>
> I am using Managed Make project (so I think I do not need a book on Make
> :-).
> Until now I had only one command in the field "Command" from "Post-Build
> Step" and it worked. But now I need to add one command more.
>
> I tried your solution with the semi-colon but it does not seem to work
> in my Eclipse 3.2.1. Do you have a newer version of Eclipse ?
>
> When I use the ";" how has the managed Makefile to look like ? (to your
> mind ?). Because my managed Makefile looks like this:
>
> post-build:
> -@echo ''
> gohc166 -o TEST.hex TEST.abs ; HexFilt.exe TEST.hex
> @echo ' '
>
> And this cannot work... I am awaiting a managed Makefile which looks
> like this:
>
> post-build:
> -@echo ''
> gohc166 -o TEST.hex TEST.abs HexFilt.exe TEST.hex
> @echo ' '
>
> Does your Eclipse Version works properly and generate the right
> post-build ? Have you tried it ?
>
> Many thanks in advance !
>
> Jonathan
>
>
>
>
Re: Post-Build Step [message #185737 is a reply to message #185730] Thu, 22 February 2007 15:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jonathan.orditz.selectron.ch

But how do your generated managed make look like ?

Do you have one line for the post build step ? (i.e command1 ; command2 ;
...)
Or do you have different lines ?
(i.e
command 1
command 2
command 3).

So I could see if the problem comes from the generation of the Makefile or
if it comes from my Make command...

Thanks,

Jonathan
Re: Post-Build Step [message #185753 is a reply to message #185737] Thu, 22 February 2007 15:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

in the generated makefile, I have:

post-build:
command1 ; command2 ; command 3 ...

That is, a single line, semi-colon separated, exactly as I typed it in.

This is why I am asking which platform, which make etc. You might have a
platform or a make that does not like that form.

--
Derek


Jonathan wrote:
> But how do your generated managed make look like ?
>
> Do you have one line for the post build step ? (i.e command1 ; command2
> ; ..)
> Or do you have different lines ?
> (i.e
> command 1
> command 2
> command 3).
>
> So I could see if the problem comes from the generation of the Makefile
> or if it comes from my Make command...
>
> Thanks,
>
> Jonathan
>
Re: Post-Build Step [message #186011 is a reply to message #185753] Mon, 26 February 2007 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jonathan.orditz.selectron.ch

Hi Derek,

I am under Windows XP with MinGW32 (newest Version).
Do you tried 3 different commands which write three different texts in a
file ?
You will see that only the first command is executed properly and the
other commands are "ignored".

I do not know if this comes from my platform but I do not think so...

I am waiting for your answer...

Many thanks !

Jonathan



Derek Morris wrote:

> in the generated makefile, I have:

> post-build:
> command1 ; command2 ; command 3 ...

> That is, a single line, semi-colon separated, exactly as I typed it in.

> This is why I am asking which platform, which make etc. You might have a
> platform or a make that does not like that form.
Re: Post-Build Step [message #186017 is a reply to message #186011] Mon, 26 February 2007 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

Jonathan,

I too use XP, but I am using the make from unxutils
(http://unxutils.sourceforge.net).

All 3 of my commands are executed correctly.

I strongly suspect it is your make utility. Try the unxutils version (you will
need make.exe, sh.exe echo.exe and rm.exe from unxutils)

--
Derek


jonathan wrote:
> Hi Derek,
>
> I am under Windows XP with MinGW32 (newest Version).
> Do you tried 3 different commands which write three different texts in a
> file ?
> You will see that only the first command is executed properly and the
> other commands are "ignored".
>
> I do not know if this comes from my platform but I do not think so...
>
> I am waiting for your answer...
>
> Many thanks !
>
> Jonathan
>
>
>
> Derek Morris wrote:
>
>> in the generated makefile, I have:
>
>> post-build:
>> command1 ; command2 ; command 3 ...
>
>> That is, a single line, semi-colon separated, exactly as I typed it in.
>
>> This is why I am asking which platform, which make etc. You might have
>> a platform or a make that does not like that form.
>
>
>
Re: Post-Build Step [message #186039 is a reply to message #186017] Mon, 26 February 2007 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jonathan.orditz.selectron.ch

Derek,

I used your UnxUtils tools and now it works.
But do you know the differences between MinGW32 and the Make utility from
UnxUtils ? Is Eclipse always tested with UnxUtils ? Or also with Cygwin,
MinGW32, etc... ?

I hope I will not have other problems using UnxUtils Make that I did not
had with MinGW32...

Many Thanks for your help and advices !

Best regards,

Jonathan
Re: Post-Build Step [message #186046 is a reply to message #186039] Mon, 26 February 2007 15:17 Go to previous message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

AFAIK, in the past, Eclipse has been tested with Cygwin and associated tools. I
understand that is changing with CDT4.0 as Cygwin is becoming less tolerant of
Windows-isms. I think testing with other makes is dependent on users.

Anyway, I'm glad you're now going. Glad to be of assistance.

--
Derek


Jonathan wrote:
> Derek,
>
> I used your UnxUtils tools and now it works.
> But do you know the differences between MinGW32 and the Make utility
> from UnxUtils ? Is Eclipse always tested with UnxUtils ? Or also with
> Cygwin, MinGW32, etc... ?
>
> I hope I will not have other problems using UnxUtils Make that I did not
> had with MinGW32...
>
> Many Thanks for your help and advices !
>
> Best regards,
>
> Jonathan
>
>
>
Previous Topic:Extending configuration question
Next Topic:Shared libraries issue
Goto Forum:
  


Current Time: Thu Mar 28 21:00:13 GMT 2024

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

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

Back to the top