Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Re: generateCommandLineInfo() ofIManagedCommandLineGenerator

Hi Mikhail,
 
    I tried using a semicolon as a command separator, so now my makefile has:
@echo exe1 $< $(<:.b=.es); sed 's/.type fr/.type f/g' $(<:.b=.es) > $(<:.b=.ei); exe2 -Dopo $(<:.b=.ei) > $(<:.b=.eo); exe3 --binary --pin-info  $@ $(<:.b=.eo)
@exe1 $< $(<:.b=.es); sed 's/.type fr/.type f/g' $(<:.b=.es) > $(<:.b=.ei); exe2 -Dopo $(<:.b=.ei) > $(<:.b=.eo); exe3 --binary --pin-info  $@ $(<:.b=.eo)
 
But yet, for the 'echo' part, the semicolon is reached, 'make' knows it's the end of that command, and tries to execute the 'sed...' command.
 
Any other way out?
I have currently put in a workaround:
- A wrapper shell script (with build steps) passed as an argument in the 'command' attribute of my tool
- commandLinePattern is set based on arguments expected & used by the shell script.
 
Another related question: Since I have a fixed rule for this tool, how can I 'disable/make non-editable' certain fields that I don't want the user to modify?
 
Thanks,
Delicia.
 

------------------------------
Message: 2
Date: Mon, 4 Sep 2006 15:11:01 +0400
From: "Sennikovsky, Mikhail" <mikhail.sennikovsky@xxxxxxxxx>
Subject: RE: [cdt-dev] Re: generateCommandLineInfo()
ofIManagedCommandLineGenerator
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Message-ID:
<B868AC247BCBC441B1B4F378A325E47D3EABF4@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"

Hi Delicia,

Try separating commands with semicolon (";") instead of new line.

Mikhail


________________________________
 
Message: 3
Date: Mon, 4 Sep 2006 15:33:45 +0530
From: "Delicia" <deliciap@xxxxxxxxxx>
Subject: [cdt-dev] Re: generateCommandLineInfo() of
IManagedCommandLineGenerator
To: <cdt-dev@xxxxxxxxxxx>
Message-ID: <2b7e01c6d009$6aaeee10$4301a8c0@xxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

  I made use of make pattern rules and got the expected output. I now have a different problem.

My build rule for "tool A" consists of:
    exe1 $< $(<:.b=.es)
    sed 's/.type fr/.type f/g' $(<:.b=.es) > $(<:.b=.ei)
    exe2 -Dopo $(<:.b=.ei) > $(<:.b=.eo)
    exe3 --binary --pin-info  $@ $(<:.b=.eo)

Apparently, the CDT makefile generator method: "addRuleForTool()" does:
buffer.append(TAB + AT + ECHO + WHITESPACE + buildCmd + NEWLINE);
buffer.append(TAB + AT + buildCmd);

As a result my generated makefile contains:
    @echo exe1 $< $(<:.b=.es)
    sed 's/.type fr/.type f/g' $(<:.b=.es) > $(<:.b=.ei)
    exe2 -Dopo $(<:.b=.ei) > $(<:.b=.eo)
    exe3 --binary --pin-info  $@ $(<:.b=.eo)

    @exe1 $< $(<:.b=.es)
    sed 's/.type fr/.type f/g' $(<:.b=.es) > $(<:.b=.ei)
    exe2 -Dopo $(<:.b=.ei) > $(<:.b=.eo)
    exe3 --binary --pin-info  $@ $(<:.b=.eo)

Since the 1st stmt is @echo, the .es file does not get generated, and then the 2nd 'sed' command gives an error.

Could someone give me some suggestions please?

Thankyou,
Delicia.

________________________________

Date: Fri, 1 Sep 2006 19:11:31 +0400
From: "Sennikovsky, Mikhail" <mikhail.sennikovsky@xxxxxxxxx>
Subject: RE: [cdt-dev] generateCommandLineInfo() of
IManagedCommandLineGenerator
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Message-ID:
<B868AC247BCBC441B1B4F378A325E47D3EA91B@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
 
Hi Delicia,
 
The GnuMakefileGenerator generates pattern rules when possible. That is
why make auto variables are passed to the command line generator, and
the generator is expected to generate the command suitable for the
pattern rule as well.
 
You might want to raise an enhancement request in bugzilla if your
integration requires more flexible command line generation processing.
 
As a work-around I suggest you to use make functions for extracting the
file extension from the given string in case the "$<" is passed as
inputResources.
 
The get the extension string you might use:
$(suffix $(notdir $<))
 
Regards,
Mikhail
 

________________________________
 
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Delicia
Sent: Friday, September 01, 2006 4:24 PM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] generateCommandLineInfo() of IManagedCommandLineGenerator
 
Hi,
 
    One of the tools in my toolchain has a more complicated build step.
 
Since it involves 4-5 steps to get the final output, I have written a class that implements
the "IManagedCommandLineGenerator" interface.
[This class is supplied to the 'commandLineGenerator' attribute of the 'tool'].
 
In my generateCommandLineInfo() method, I have 'String[] inputResources', which contains $<
But what I need, is the input filename (sans the extension), which I then use in subsequent build steps.
 
Could someone please tell me where/how to get this information.
 
Thankyou,
Delicia.

Back to the top