[clug] Tricky 'make' problem

Hal Ashburner hal.ashburner at gmail.com
Thu Jan 7 02:48:20 MST 2010


On 07/01/10 20:35, Paul Matthews wrote:
> On 07/01/10 19:54, Hal Ashburner wrote:
>    
>> does solaris make deal with implicit rules? eg something like
>>
>> %.skl:  %.jcl
>>          tailor  $^ -o $@
>>
>>
>>      
> It does appear so, but its not obvious how to use it to my advantage:
>
>      A target entry of the form:
>
>      tp%ts:dp%ds
>           rule
>
>      is a pattern matching rule, in which tp is a target prefix, ts is a
>      target suffix, dp is a dependency prefix, and ds is a dependency
>      suffix (any of which may be null). The `%' stands for a basename of
>      zero or more characters that is matched in the target, and is used
>      to construct the name of a dependency. When make encounters a match
>      in its search for an implicit rule, it uses the rule in that target
>      entry to build the target from the dependency file. Pattern-matching
>      implicit rules typically make use of the $@ and $<  dynamic macros as
>      placeholders for the target and dependency names. Other, regular
>      dependencies may occur in the dependency list; however, none of the
>      regular dependencies may contain `%'. An entry of the form:
>
>      tp%ts:[dependency ...] dp%ds[dependency ...]
>           rule
>
>      is a valid pattern matching rule.
>
> Don't know where to go from here....
>
>      all : skls \
>            jcls
>
>      clean:
>          rm -f ${STEPSKL}
>          rm -f ${STEPJCL}
>
>      .PHONEY: skls
>      skls :
>          ./generate
>
>      step%jcl: step%skl
>          ./tailor $<  $@
>
>      .PHONEY: jcls
>      jcls :
>              # Ummm
>
>
>
>
>    
something like

%.skl:
     ./generate #or whatever

%.jcl:    %.skl
     ./tailor $< $@


all:    %.jcl

might work for you??

Hal


More information about the linux mailing list