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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Apr 6 14:11:42 CEST 2012


On Fri, Apr 06, 2012 at 01:23:13PM +0200, Thilo Borgmann wrote:
> +DATE := $(shell date +%m%d)
> +
> +LOGO_FILES := $(wildcard src/logik/$(DATE).*)
> +
> +ifeq ($(LOGO_FILES),)
> +LOGO_FILES := $(wildcard src/logik/$(DATE)-standard)
> +endif

Why not just
LOGO_FILES := $(wildcard src/logik/$(DATE).* src/logik/$(DATE)-standard)
Though honestly do we have to make it that messy? Why not just
making a symlink to htdocs/FFmpeg_standard.png instead of needing
special-casing for -standard?
Otherwise another option is to use
> +ifneq ($(wildcard src/logik/$(DATE)-standard),)
> +LOGO_FILES := htdocs/FFmpeg_standard.png
> +endif


> +src/logik/$(DATE)-standard:
> +	cmp cp htdocs/FFmpeg_standard.png htdocs/ffmpeg-logo.png || \
> +	cp htdocs/FFmpeg_standard.png htdocs/ffmpeg-logo.png
> +
> +src/logik/$(DATE).png:
> +	cmp $@ htdocs/ffmpeg-logo.png || cp $@ htdocs/ffmpeg-logo.png

There is a "cp" too much in the first one.
Also this looks like blatant misuse of the make syntax.
Why not
htdocs/ffmpeg-logo.png: $(LOGO_FILES)
	test -n "$^" || cmp $^ $@ || cp $^ $@
(note: I am not sure whether the first $^ needs quotes for the case
where no source files exist)


More information about the ffmpeg-devel mailing list