[FFmpeg-devel] [PATCH] web: Copy FFmpeg Logo by Makefile instead of cronjob

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Apr 5 18:19:23 CEST 2012


On Thu, Apr 05, 2012 at 05:08:22PM +0200, Michael Niedermayer wrote:
> +DATE = $(shell date +%m%d)

Also for the others, but especially here I think you want to use :=,
otherwise you risk getting a different value between different uses.

> +LOGO_STANDARD = $(shell ls src/logik/$(DATE)-standard)
> +LOGO_DAY      = $(shell ls src/logik/$(DATE).png)

$(wildcard src/logik/$(DATE)-standard)
etc. is a nicer way to do this.

> +ifneq ($(LOGO_STANDARD),)
> +    LOGO_SRC = htdocs/FFmpeg_standard.png
> +endif
> +ifneq ($(LOGO_DAY),)
> +    LOGO_SRC = $(LOGO_DAY)
> +endif

Not sure if it is really nicer, but I think this could be done as
ifneq ($(wildcard src/logik/$(DATE)-standard),)
LOGO_SRC := htdocs/FFmpeg_standard.png
endif
LOGO_SRC ?= $(wildcard src/logik/$(DATE).png)

> +ifneq ($(LOGO_SRC),)
> +logo:
> +	cmp $(LOGO_SRC) htdocs/ffmpeg-logo.png || cp $(LOGO_SRC) htdocs/ffmpeg-logo.png
> +endif

I think it would be preferable to have this as a proper make rule, i.e.
htdocs/ffmpeg-logo.png: $(LOGO_SRC)
	cmp $^ $@ || cp $^ $@
As long as you add htdocs/ffmpeg-logo.png to .PHONY it will still be
executed regardless of the age of the files.

> -all: $(TARGETS)
>  
> @@ -37,4 +52,4 @@ X' >> $@
>  	echo '</rss>' >> $@
>  
>  
> -.PHONY: all clean
> +.PHONY: all clean logo

If you remove the "all" target I guess you should remove it from .PHONY,
too.


More information about the ffmpeg-devel mailing list