Files
fsfe-website/Makefile
T

67 lines
2.5 KiB
Makefile
Raw Normal View History

2001-04-26 20:37:29 +00:00
# Authors: Loic Dachary <loic@gnu.org> and Jaime Villate <villate@gnu.org>
#
2001-04-26 20:37:29 +00:00
# XML/XSLT processor (validator)
# -------------------------
#
# sablotron (sabcmd)
# apt-get install sablotron
#
# libxslt + libxml2 (xsltproc)
# http://www.xmlsoft.org/
#
XSLTPROC = xsltproc
2001-04-20 10:43:13 +00:00
FSFFRANCE = http://france.fsfeurope.org
FSFEUROPE = . # http://www.fsfeurope.org
FSF = http://www.fsf.org
GNU = http://www.gnu.org
2001-04-20 10:43:13 +00:00
XSLTOPTS = \
--param fsffrance $(FSFFRANCE) \
--param fsf $(FSF) \
--param gnu $(GNU)
2001-04-20 10:43:13 +00:00
2001-04-26 20:37:29 +00:00
ENPAGES = $(shell find * -path 'fr' -prune -o -regex '[^\.]*\.xhtml' -print | sed "s/xhtml$$/html/")
FRPAGES = $(shell find * -path 'fr' -prune -o -regex '.*\.fr\.xhtml' -print | sed "s/xhtml$$/html/")
DEPAGES = $(shell find * -path 'fr' -prune -o -regex '.*\.de\.xhtml' -print | sed "s/xhtml$$/html/")
all: $(ENPAGES) $(FRPAGES) $(DEPAGES)
$(ENPAGES): %.html: %.xhtml fsfe.xsl navigation.en.xsl
@echo "Building $@ ..."; \
2001-04-26 20:37:29 +00:00
path=$< ; \
base=`expr $$path : '\(.*\).xhtml'` ; \
filebase=`basename $$base` ; \
dir=`dirname $$path` ; \
root=`dirname $$path | perl -pe 'chop; s:([^/]+):..:g if($$_ ne ".")'` ; \
$(XSLTPROC) $(XSLTOPTS) '--param fsfeurope '$$root '--param filebase '$$filebase fsfe.xsl $$path > $$base.html-temp && (cat $$base.html-temp | perl -p -e '$$| = 1; s/\$$//g if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.html) ; \
2001-04-26 20:37:29 +00:00
rm -f $$base.html-temp
$(FRPAGES): %.html: %.xhtml fsfe.xsl navigation.fr.xsl
@echo "Building $@ ..."; \
2001-04-26 20:37:29 +00:00
path=$< ; \
base=`expr $$path : '\(.*\).xhtml'` ; \
filebase=`basename $$base` ; \
dir=`dirname $$path` ; \
root=`dirname $$path | perl -pe 'chop; s:([^/]+):..:g if($$_ ne ".")'` ; \
$(XSLTPROC) $(XSLTOPTS) '--param fsfeurope '$$root '--param filebase '$$filebase fsfe.xsl $$path > $$base.html-temp && (cat $$base.html-temp | perl -p -e '$$| = 1; s/\$$//g if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.html) ; \
2001-04-26 20:37:29 +00:00
rm -f $$base.html-temp
$(DEPAGES): %.html: %.xhtml fsfe.xsl navigation.de.xsl
@echo "Building $@ ..."; \
2001-04-26 20:37:29 +00:00
path=$< ; \
base=`expr $$path : '\(.*\).xhtml'` ; \
filebase=`basename $$base` ; \
dir=`dirname $$path` ; \
root=`dirname $$path | perl -pe 'chop; s:([^/]+):..:g if($$_ ne ".")'` ; \
$(XSLTPROC) $(XSLTOPTS) '--param fsfeurope='$$root '--param filebase='$$filebase fsfe.xsl $$path > $$base.html-temp && (cat $$base.html-temp | perl -p -e '$$| = 1; s/\$$//g if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.html) ; \
2001-04-26 20:37:29 +00:00
rm -f $$base.html-temp
# remove html files for which an xhtml version exists (exclude fr/)
clean:
rm -f $(ENPAGES) $(FRPAGES) $(DEPAGES)