Bonjour à tous,
Mon problème initial :
A partir des fichiers xml du “Guide avancé d’écriture des scripts Bash”, je voulais générer les fichiers html puis le pdf de leur dernière traduction française…
J’ai donc récupéré, à priori, tout ce qu’il fallait… dont le makefile que voici :
[code]VERSION := $(shell grep “” abs-book.xml | tr -d "[a-z]<>/ ")
BASEDIR := $(HOME)/ABS-$(VERSION)
PDF_OUTPUT := abs-$(VERSION).pdf
NOCHUNKS_OUTPUT := abs-$(VERSION).html
CHUNK_QUIET=0
XSLROOTDIR=/usr/share/xml/docbook/stylesheet/nwalsh
VPATH = $(BASEDIR)
src = *.xml *.sh
all: html pdf
html: index.html
index.html: $(src)
[ -d $(BASEDIR) ] || mkdir $(BASEDIR)
xsltproc --xinclude --nonet -stringparam profile.condition html
-stringparam profile.attribute “standalone” -stringparam profile.value “no”
-stringparam chunk.quietly $(CHUNK_QUIET)
-stringparam base.dir $(BASEDIR)/
stylesheets/abs-chunked.xsl abs-book.xml
[ -d $(BASEDIR)/stylesheets ] || mkdir $(BASEDIR)/stylesheets
cp stylesheets/*.css $(BASEDIR)/stylesheets
[ -d $(BASEDIR)/images ] || mkdir $(BASEDIR)/images
cp images/*.png $(BASEDIR)/images
cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
for filename in `find $(BASEDIR) -name "*.html"`; do \
tidy -config tidy.conf $$filename; \
true; \
sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
done;
pdf: $(PDF_OUTPUT)
$(PDF_OUTPUT): $(src)
[ -d $(BASEDIR) ] || mkdir $(BASEDIR)
xsltproc --xinclude --nonet --stringparam profile.condition pdf
–output $(BASEDIR)/abs-pdf.xml stylesheets/abs-profile.xsl abs-book.xml
xsltproc --nonet --output $(BASEDIR)/abs-pdf.fo stylesheets/abs-pdf.xsl
$(BASEDIR)/abs-pdf.xml
sed -i -e “s/inherit/all/” $(BASEDIR)/abs-pdf.fo
fop.sh $(BASEDIR)/abs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
rm $(BASEDIR)/abs-pdf.xml $(BASEDIR)/abs-pdf.fo
nochunks: $(NOCHUNKS_OUTPUT)
$(NOCHUNKS_OUTPUT): $(src)
[ -d $(BASEDIR) ] || mkdir $(BASEDIR)
xsltproc --xinclude --nonet -stringparam profile.condition html
–output $(BASEDIR)/$(NOCHUNKS_OUTPUT)
stylesheets/abs-nochunks.xsl abs-book.xml
tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
sed -i -e "s@text/html@application/xhtml+xml@g" \
$(BASEDIR)/$(NOCHUNKS_OUTPUT)
validate:
xmllint --noout --nonet --xinclude --postvalid abs-book.xml
[/code]
et qui lors d’un :
(comme indiqué ici) me donne l’erreur suivante :
N’ayant aucune connaissance sur make, j’ai cherché un peu sur le Net ici, là ou encore là, mais j’avoue ne pas y comprendre grand chose à ces histoires de tabulation ! (il semble pourtant y en avoir dans ce makefile, non ?)
Je suis un newbie en Linux (et pas du tout programmeur) : je cherchais justement à apprendre le langage Bash grâce à ce guide…
Quelqu’un peut-il avoir la gentillesse de m’expliquer, svp, ou de me donner la solution afin que ce make fonctionne correctement ???
Merci beaucoup d’avance !
@+
Eric.