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

Thilo Borgmann thilo.borgmann at googlemail.com
Fri Apr 6 15:19:03 CEST 2012


Am 06.04.12 14:14, schrieb Reimar Döffinger:
> On Fri, Apr 06, 2012 at 02:11:42PM +0200, Reimar Döffinger wrote:
>> 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.

Indeed!

>> Also this looks like blatant misuse of the make syntax.

Hm I think that's exactly what phony targets are there for...

>> 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)
> 
> Not needed, but it must be -z, so
> test -z $^ || cmp $^ $@ || cp $^ $@

... but I agree that this would be the best way for logo copying only.
However, the idea is to control more than just the logo by files in src/logik.
And then I think we would end up with more variables and logic about
file-to-target transform.

I think this discussion is getting lengthy again for negligible benefit in the
Makefile. It's hard for me to argue for flexibility and against non-phony
targets for that first patch. I therefore attach both patches for you to see
what I think where the Makefile should go to. If you can find a better non-phony
version for the final Makefile I will be perfectly fine with it :)

-Thilo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Let-the-Makefile-copy-the-website-logo-according-to-.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120406/2e2ae775/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-Generate-a-hovertext-for-the-logo-based-on-src-logik.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120406/2e2ae775/attachment-0001.ksh>


More information about the ffmpeg-devel mailing list