On 26.01.2011 11:46, ulugutz wrote:
Oleksandr Gavenko-2 wrote:
On 26.01.2011 9:20, ulugutz wrote:
Hi,
how can you for example do this
------------------------------------
PICS=%.pdf
all: PICS
PICS: $(@:pdf=.png)
do something
------------------------------------
i would really appreciate your help and sorry if it has been posted
already
but I only checked the newest pages of the forum
Why not use:
PNG_FILES := $(wildcard *.png)
PDF_FILES := $(PNG_FILES:.png=.pdf)
all: $(PDF_FILES)
%.pdf: %.png
png2pdf -o $@ $*.png
or last rule can be rewritten as:
$(PDF_FILES): %.pdf: %.png
png2pdf -o $@ $*.png
>
> that's more or less what I am currently using. but in this case he
rebuilds
> ALL pdf files if only one png changes
>
No. You wrong. Only that .pdf for which .png was changed.
Usually this happen then you place in dependency to pattern target
'.PHONY' target:
.PHONY: BADTARGET
BADTARGET:
command-for-BADTARGET
$(PDF_FILES): %.pdf: %.png BADTARGET
png2pdf -o $@ $*.png
In this case .pdf file was rebuilt as BADTARGET always was rebuilt.
Or may be 'png2pdf' command incorrect set last-modification time for .pdf
You can manually fix it by:
touch $@
Please check you Makefile.
--
С уважением, Александр Гавенко.
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make