From ca0bfe19f51db3207a8c4adcb8cf1cf0cff34234 Mon Sep 17 00:00:00 2001 From: toidinamai Date: Thu, 8 Jun 2006 12:51:42 +0000 Subject: [PATCH] some Makefile cleanups git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@383 31f61c52-7bfb-0310-b897-fc00f8a278f0 --- Makefile | 60 ++++++++++++++---------- content/static/{ => cgi-bin}/estseek.top | 0 scripts/gen_news.xml.sh | 1 + 3 files changed, 35 insertions(+), 26 deletions(-) rename content/static/{ => cgi-bin}/estseek.top (100%) diff --git a/Makefile b/Makefile index 15074bfa4..c4977704c 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ WWW_CCC_DE_UPDATES=chaosupdates.rdf ### Ziele ### # Dateinamen der zu erzeugenden html-Dateien: -CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(NEWSFILES) +CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(NEWSFILES) $(SEARCH_TMPL) # 'normale' Seiten: PAGES:=$(patsubst content/pages/%.xml, build/%.html, $(wildcard content/pages/*.xml)) @@ -45,11 +45,21 @@ NEWS_PAGES:=$(patsubst content/news/%.xml, build/news/%.html, $(wildcard content NEWSFILES:=build/news.html build/news-rss.xml build/news-atom.xml # Datenspuren-Seiten: DS_PAGES:=$(patsubst content/datenspuren/%.xml, build/datenspuren/%.html, $(wildcard content/datenspuren/*.xml)) build/datenspuren/schedule.html +# Suchseiten-Template +SEARCH_TMPL:=build/cgi-bin/search.html # Quellen NEWSITEMS:=$(wildcard content/news/*.xml) CLEAN=$(CONTENT) $(NEWSFILES) $(WWW_CCC_DE_UPDATES) $(DS_PAGES) +NOVALID_IGNORE:=false + +define xml_to_html + $(VALIDATOR) $(VFLAGS) $< + $(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) $< + $(VALIDATOR) $(VFLAGS) $@ || $(NOVALID_IGNORE) || { rm $@ ; exit 1 ; } +endef + ### Defaults ### @@ -63,38 +73,36 @@ export: www build/news.html: $(WWW_CCC_DE_UPDATES) build/news-rss.xml : STYLE=xsl/rss.xsl +build/news-rss.xml : NOVALID_IGNORE:=true build/news-atom.xml : STYLE=xsl/atom.xsl +build/news-atom.xml : NOVALID_IGNORE:=true -$(NEWSFILES): $(NAVIGATION) $(NEWSITEMS) - for item in $(NEWSITEMS) ; do \ - $(VALIDATOR) $(VFLAGS) $${item} || exit 1 ; \ - done +.INTERMEDIATE: news.xml +news.xml: $(NEWSITEMS) + sh scripts/gen_news.xml.sh $^ > $@ - sh scripts/gen_news.xml.sh $(NEWSITEMS) | $(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) - -# XXX: only check news.html - if [ $(STYLE) = xsl/xhtml.xsl ] ; then \ - $(VALIDATOR) $(VFLAGS) $@ || { rm $@ ; exit 1 ; } ;\ - fi +$(NEWSFILES): news.xml $(NAVIGATION) $(STYLE) + $(call xml_to_html) + +build/%.html: content/pages/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES) + $(call xml_to_html) + +build/news/%.html: content/news/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES) + $(call xml_to_html) + +build/cgi-bin/search.html: content/cgi-bin/search.xml $(STYLE) $(NAVIGATION) + $(call xml_to_html) + +# -- MNE-20060421: Lt. Astro geht Validierung noch nicht mit dem Fahrplan, +# daher fuer Datenspuren auskommentiert +build/datenspuren/%html : STYLE=$(DS_STYLE) +build/datenspuren/%html : NOVALID_IGNORE=true +build/datenspuren/%.html: content/datenspuren/%.xml $(DS_STYLE) + $(call xml_to_html) content/datenspuren/schedule.xml: content/static/datenspuren/fahrplan/days.de.html cp $< $@ -build/%.html: content/pages/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES) - $(VALIDATOR) $(VFLAGS) $< - $(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) $< - $(VALIDATOR) $(VFLAGS) $@ || { rm $@ ; exit 1 ; } - -build/datenspuren/%.html: content/datenspuren/%.xml $(DS_STYLE) - # -- MNE-20060421: Lt. Astro geht Validierung noch nicht mit dem Fahrplan, - # daher fuer Datenspuren auskommentiert - $(VALIDATOR) $(VFLAGS) $< - $(PROCESSOR) $(PFLAGS) -o $@ $(DS_STYLE) $< - -build/news/%.html: content/news/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES) - $(VALIDATOR) $(VFLAGS) $< - $(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) $< - $(VALIDATOR) $(VFLAGS) $@ || { rm $@ ; exit 1 ; } - dtd/catalog.xml: sh scripts/gen_catalog.xml.sh > $@ diff --git a/content/static/estseek.top b/content/static/cgi-bin/estseek.top similarity index 100% rename from content/static/estseek.top rename to content/static/cgi-bin/estseek.top diff --git a/scripts/gen_news.xml.sh b/scripts/gen_news.xml.sh index f9a4c896e..591e672fb 100644 --- a/scripts/gen_news.xml.sh +++ b/scripts/gen_news.xml.sh @@ -2,6 +2,7 @@ cat < + EOF