some Makefile cleanups

git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@383 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
toidinamai 2006-06-08 12:51:42 +00:00
parent b8a52582f0
commit ca0bfe19f5
3 changed files with 35 additions and 26 deletions

View File

@ -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 > $@

View File

@ -2,6 +2,7 @@
cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page SYSTEM "http://www.c3d2.de/dtd/c3d2web.dtd">
<page title="News">
<news>
EOF