automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with dependencies


From: Stefano Lattarini
Subject: Re: Problem with dependencies
Date: Sun, 6 Nov 2011 17:15:32 +0100
User-agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; )

On Sunday 06 November 2011, Stefan  wrote:
> OK, here is my Makefile.am, which at this point works.
> But it does not include the data dependency:
>
Yes, but we'd like to see the one that is failing, otherwise
how can we see what's wrong? :-)

> @SET_MAKE@
> 
> ACLOCAL_AMFLAGS = -I share/misc/m4
> 
> SUFFIXES = .R .pdf
> 
> noinst_PLOTS = R_Double_new.pdf sample_distris.pdf
> noinst_DATA = R_Double_new.histo
> noinst_R = R_Double_new.R sample_distris.R
> noinst_SCRIPTS=
> if !CRB_NO_RSCRIPTS
>   noinst_SCRIPTS += R_Double_new sample_distris
> endif
> 
> CLEANFILES = $(noinst_SCRIPTS) $(noinst_PLOTS)
> 
> EXTRA_DIST = $(noinst_PLOTS) $(noinst_DATA) $(noinst_R)
> 
> do_subst = sed \
>   -e 's,address@hidden@],$(CRB_RSCRIPT),g' \
>   -e 's,address@hidden@],Generated from address@hidden; do not edit by 
> hand.,g'
> 
> .R:
>
>       rm -f $@ address@hidden
>       $(do_subst) $(srcdir)/address@hidden >address@hidden
>       chmod +x address@hidden
>       chmod a-w address@hidden
>       mv -f address@hidden $@
>
> .R.pdf:
>       ./$*
>
Here I can spot a first problem though: this rule doesn't ensure that
the script used to build the PDF file will be created before being
executed in the recipe.  Let's see a minimal example showing the issue:

  $ cat Makefile
  .SUFFIXES: .R .pdf
  .R:
        cp $< >$@ && chmod a+x
  .R.pdf:
        echo $* >address@hidden && mv address@hidden $@
  $ touch foo.R
  $ make foo.pdf; echo \$? = $?
  ./foo >foo.pdf.tmp && mv -f foo.pdf.tmp foo.pdf
  /bin/sh: ./foo: No such file or directory
  make: *** [foo.pdf] Error 127
  $? = 2
  # You have to explicitly create the `foo' script first, then
  # things will work.
  $ make foo && make foo.pdf; echo \$? = $?
  cp foo.R foo && chmod a+x foo
  ./foo >foo.pdf.tmp && mv -f foo.pdf.tmp foo.pdf
  $? = 0

> all-local: $(noinst_PLOTS)
> 
> greetings & thanks for looking at my stuff,
>
> Oh, and my Automake Version is 1.10.1.

But I asked your make version :-)  This is mostly a make issue, not
an automake one.
 
Regards,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]