Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Problem with multiple outputType elements during incremental build

> I have a tool that has 1 inputType element(.cla) & 2 outputType
> elements(.o & dsevar_%.h).
> Both the outputTypes are produced with a single invocation of the tool.
> 
> A fresh make (after a clean) works perfectly, i.e. in a single
> invocation, both O/Ps are generated. Now, I make a small change in the
> .cla input and the incremental builder does:
> 
> tool.exe -c -oCLA_example.o ../CLA_example.cla
> tool.exe -c -odsevar_CLA_example.h ../CLA_example.cla
>     INSTEAD OF JUST
> 
> tool.exe -c -oCLA_example.o ../CLA_example.cla
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Generated make rules contain:
> %.o dsevar_%.h: $(ROOT)/%.cla
>  @echo 'Building file: $<'
>  @echo 'Invoking: toolABC'
>  @echo dseclasm -c -o$@ $<
>  @dseclasm -c -o$@ $<
>  @echo 'Finished building: $<'
>  @echo ' '
> 
> dsevar_CLA_example.h: CLA_example.o
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> I can't understand the reason for this behaviour.
> Any inputs would be appreciated.

Delicia,

I think the cause of the problem is that the rule:

%.o dsevar_%.h: $(ROOT)/%.cla
  <action>

equals writing down 2 separate rules:

%.o: $(ROOT)/%.cla
  <action>     in which $@ = %.o

dsevar_%.h: $(ROOT)/%.cla
  <action>     in which $@ = dsevar_%.h

but I cannot yet explain why both actions are executed in one make
invocation. I'd expect the first invocation to update both .o as well as
.h, and after that these dependencies should have been met?


BTW the dependency:
  dsevar_CLA_example.h: CLA_example.o
Is this generated build-time by the dependency generator for your abc compiler?

This because a difference between a fresh make (after clean) and a standard
make is that the clean throws away the configuration directory including
the dependency files. So in case of the fresh make the dsevar_CLA_example.h
dependency on CLA_example.o might not been present possibly explaining the
different behavior.

Regards,
  Wieant


Back to the top