Am Freitag, 2. Januar 2004 16:24 schrieb Matej Cepl:
> Hi,
>
> this is for programmers on this list:
>
> I have a directory fill with small .lyx files (field notes with
> records of interviews) and I would love to keep .pdf files for
> each of them with make.
>
> To make rule is simple:
>
> .pdf.lyx:
>       lyx -e pdf2 $<
>
> However, I don't how to make rule "go through all .lyx files and
> make .pdf, if they don't have newer one" (so that it would work
> even for .lyx files without corresponding .pdf).


For GNU make (don't know if the functions are available in other make 
versions):


LYX_FILES = $(wildcard *.lyx)
PDF_FILES = $(patsubst %.lyx,%.pdf,$(LYX_FILES))

all: $(PDF_FILES)


Then a "make all" will rebuild all missing or outdated pdf files. The 
documentation of make has a reason why one should use $(wildcard *.lyx) and 
not just *.lyx, but I forgot it.



Georg


Reply via email to