Skip to main content

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

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.
   
------------------------------
Message: 3
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