[MPlayer-DOCS] homepage build system

Torinthiel torinthiel at megapolis.pl
Mon Nov 8 09:16:50 CET 2004


On Sun, Nov 07, 2004 at 08:28:20AM -0600, Josh Varner wrote:
> Taking a second look at the one that works the first eval foreach is
> not inside the definition for lang-def so that may be the key:

I've tried removing the $(eval) within define, move eval out of
parenthesis, and later even moving $(call lang-def) to a separate loop,
with no effect (well, not exactly. It changed how soon it would crash).
Attached is a quick hack that works and is single file. I know it's
ugly, but I need something that supports changing encoding in resulting
files, as Polish homepage now looks really ugly.
And if anyone wonders why the $(foreach) is outside ifeq, like
ifeq ...
...
endif
$(foreach ...)

ifneq ...
...
endif

and not
ifeq ...
...
else
...
endif

then it's because make complained for missing 'endif' on this line all
the time.
Torinthiel

-- 
 Waclaw "Torinthiel" Schiller       GG#: 542916, 3073512
   torinthiel(at)megapolis(dot)pl
   gpg: B06901F1 fpr: FAA3 559F CAE9 34DE CDC8  7346 2B6E 39F2 B069 01F1
 "No classmates may be used during this examination"
-------------- next part --------------
DESIGNS := design3 design4 design5 design6 design7
SOURCES := $(wildcard src/*.src.*)
TRANSLATIONS := es hu pl
pl_ENCODING := iso-8859-2

ifeq ($(INTERNAL),yes)

SRC2HTML = $(addsuffix $(2).html, $(notdir $(basename $(basename $(1)))))

all: en $(TRANSLATIONS)

# The English homepage requires some special treatment
en: $(call SRC2HTML, $(wildcard ../src/*.src.en))
$(call SRC2HTML, $(wildcard ../src/*.src.en)): %.html : ../src/%.src.en src/upper src/selector src/lower
	cat src/upper src/selector $< src/lower > $@

# And the rest of languages...
define lang-def
$(1): $(if $(wildcard src/selector-$(1)),$(call SRC2HTML, $(wildcard ../src/*.src.$(1)),-$(1)))
$(call SRC2HTML, $(wildcard ../src/*.src.en),-$(1)): %-$(1).html : ../src/%.src.$(1) src/upper src/selector-$(1) src/lower
	$(if $($(1)_ENCODING),\
	sed -e 's/iso-8859-1/$($(1)_ENCODING)/' src/upper | \
	cat - src/selector-$(1) $$< src/lower > $$@,\
	cat src/upper src/selector-$(1) $$< src/lower > $$@)
endef
endif
$(foreach lang, $(TRANSLATIONS),$(eval $(call lang-def,$(lang))))

ifneq ($(INTERNAL),yes)

.PHONY: all clean $(DESIGNS)
all: $(DESIGNS)

clean:
	rm -f $(foreach des, $(DESIGNS), $(wildcard $(des)/*.html))

$(DESIGNS):
	make -C $@ -f ../Makefile INTERNAL=yes

endif

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-docs/attachments/20041108/d9589fc8/attachment.pgp>


More information about the MPlayer-DOCS mailing list