[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help with loop in a Make file
From: |
Jacques Menu Muzhic |
Subject: |
Re: help with loop in a Make file |
Date: |
Wed, 31 Aug 2016 08:49:32 +0200 |
Hello Federico,
The actual syntax for a loop in Make is different that that of bash, as is its
meaning by the way, see:
https://www.gnu.org/software/make/manual/html_node/Foreach-Function.html.
But what you need is probably a pattern like this, where ‘%’ is a place holder
as explained in:
https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html#index-_0025_002c-in-pattern-rules
https://www.gnu.org/software/make/manual/html_node/Pattern-Examples.html#Pattern-Examples
# In the actions:
# $@ is the target to be built
# $< is the first prerequisite
intervista_%.pdf : pdf2ps $@
JM
> Le 31 août 2016 à 08:38, Federico Bruni <address@hidden> a écrit :
>
> I have a slightly OT question about Make.
> I'm using Make to generate several EPS file to be included in a LilyPond file.
> The three commands below work fine on the terminal but do not work when I
> launch make:
>
> ### Make snippet ###
>
> SHELL=/usr/bin/bash
>
> %.pdf %.ps %.eps: %.tex
> latexmk -xelatex intervista.tex && \
> pdf-stapler split intervista.pdf && \
> for f in intervista_*.pdf; do pdf2ps $f; done
>
> intervista: intervista.pdf
>
> ### end Make snippet ###
>
> The first two commands work fine. The problem is in the loop.
> Do you have an idea of what might be wrong?
>
> Here's the error message:
>
>
> Output written on intervista.pdf (7 pages).
> Transcript written on intervista.log.
> Latexmk: Log file says output to 'intervista.pdf'
> Latexmk: All targets (intervista.pdf) are up-to-date
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Usage: pdf2ps [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf
> [output.ps]
> Makefile:32: recipe for target 'intervista.pdf' failed
> make: *** [intervista.pdf] Error 1
>
>
> Thanks in advance
> Federico
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user