[EMAIL PROTECTED] (Frank K�ster) writes:

> Boris Kolpackov <[EMAIL PROTECTED]> wrote:
>
> > [EMAIL PROTECTED] (Frank K�ster) writes:
> >
> >> all: fileB
> >>    echo "made $@"
> >>    -ls --full-time -l $<
> >>
> >> fileB: ../fileA
> >>    test -e $< && test $< -nt $@ && cp $< $@ || true
> >>
> >> ../fileA:
> >>    true
> >>
> >> This seems to go well, does anybody still see a problem?
> >
> > You don't really need the last rule, i.e.,
> >
> > all: fileB
> >     echo "made $@"
> >     -ls --full-time -l $<
> >
> > fileB:
> >     test -e $< && test $< -nt $@ && cp $< $@ || true
> >
> But if fileA does not exist, it gives an error:
>
> make: *** No rule to make target `../fileA', needed by `fileB'.  Stop.

It's because you haven't removed the dependency of fileB on fileA (as
in the example I gave above). Also note that you will need to use actual
file name instead of $< in the rule's command script, i.e.:

fileB:
        test -e ../fileA && test ../fileA -nt $@ && cp ../fileA $@ || true

hth,
-boris



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to