[MPlayer-DOCS] CVS: homepage Makefile,1.2,1.3

Torinthiel CVS syncmail at mplayerhq.hu
Mon May 23 14:59:35 CEST 2005


CVS change done by Torinthiel CVS

Update of /cvsroot/mplayer/homepage
In directory mail:/var2/tmp/cvs-serv16193

Modified Files:
	Makefile 
Log Message:
Easier extensible build system.
Note: PRobably won't work with make 3.80


Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/homepage/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile	14 May 2005 13:38:48 -0000	1.2
+++ Makefile	23 May 2005 12:59:32 -0000	1.3
@@ -1,40 +1,41 @@
 DESIGNS := design7 design6 design5 design4 design3
 TRANSLATIONS := es hu pl
+SRCDIRS=src essays/src
 pl_ENCODING := iso-8859-2
 hu_ENCODING := iso-8859-2
 
 ifeq ($(INTERNAL),yes)
 
 SRC2HTML = $(addsuffix $(2).html, $(notdir $(basename $(basename $(1)))))
-PAGES := $(wildcard ../src/*.src.en)
-ESSAYS := $(wildcard ../essays/src/*.src.en)
 
 all: en $(TRANSLATIONS)
 
 # The English homepage requires some special treatment
-en: $(call SRC2HTML, $(PAGES) $(ESSAYS))
-$(call SRC2HTML, $(PAGES)): %.html : ../src/%.src.en src/upper src/selector src/lower
-	cat src/upper src/selector $< src/lower > $@
-
-$(call SRC2HTML, $(ESSAYS)): %.html : ../essays/src/%.src.en src/upper src/selector src/lower
-	cat src/upper src/selector $< src/lower > $@
+en: $(call SRC2HTML, $(foreach dir, $(SRCDIRS), $(wildcard ../$(dir)/*.src.en)))
 
+define en-dir-def
+$(call SRC2HTML, $(wildcard ../$(1)/*.src.en)):  %.html : ../$(1)/%.src.en src/upper src/selector src/lower
+	cat src/upper src/selector $$< src/lower > $$@
+endef
+	
 # And the rest of languages...
 define lang-def
-$(1): $(if $(wildcard src/selector-$(1)),$(call SRC2HTML, $(wildcard ../src/*.src.$(1)) $(wildcard ../essays/src/*.src.$(1)),-$(1)))
-$(call SRC2HTML, $(PAGES),-$(1)): %-$(1).html : ../src/%.src.$(1) src/upper src/selector-$(1) src/lower
-	$(if $($(1)_ENCODING),\
-	sed -e '/text\/html/s/iso-8859-1/$($(1)_ENCODING)/' src/upper | \
-	cat - src/selector-$(1) $$< src/lower > $$@,\
-	cat src/upper src/selector-$(1) $$< src/lower > $$@)
-$(call SRC2HTML, $(ESSAYS),-$(1)): %-$(1).html : ../essays/src/%.src.$(1) src/upper src/selector-$(1) src/lower
+#$(1): $(if $(wildcard src/selector-$(1)),$(call SRC2HTML, $(wildcard ../src/*.src.$(1)) $(wildcard ../essays/src/*.src.$(1)),-$(1)))
+$(1): $(if $(wildcard src/selector-$(1)),$(call SRC2HTML, $(foreach dir,$(SRCDIRS),$(wildcard ../$(dir)/*.src.$(1))),-$(1)))
+endef
+
+define lang-dir-def
+$(call SRC2HTML, $(wildcard ../$(2)/*.src.$(1)),-$(1)): %-$(1).html : ../$(2)/%.src.$(1) src/upper src/selector-$(1) src/lower
 	$(if $($(1)_ENCODING),\
 	sed -e '/text\/html/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))))
+$(foreach lang, $(TRANSLATIONS), $(foreach dir,$(SRCDIRS),$(eval $(call lang-dir-def,$(lang),$(dir)))))
+$(foreach dir, $(SRCDIRS),$(eval $(call en-dir-def,$(dir))))
 
 ifneq ($(INTERNAL),yes)
 
@@ -48,4 +49,3 @@
 	make -C $@ -f $(if $(filter-out Makefile,$(MAKEFILE_LIST)), $(MAKEFILE_LIST), ../Makefile) INTERNAL=yes
 
 endif
-




More information about the MPlayer-DOCS mailing list