DOCUMENT=IKT-bok IMAGE= GET_CHARSET=head -25 $(DOCUMENT).$*.po | grep "Content-Type" | sed -e "s/.*charset=\(.*\)/\1/" -e 's/\\.//' -e 's/"//' -e "s%\\\\\n%%g" CHARSET=`$(GET_CHARSET)` # # HOWTO make changes to the documentation # 1. make your changes in the $(DOCUMENT).en.sgml masterfile # 2. run 'make master-update' to push the changes to the translators, # and regenerate the english files # # # HOWTO add a translation: # 1. add a prerequisite for your langue to the "all" and "potfile" rules # 2. run 'make $(DOCUMENT)..po' to create the initial .po file for the new language # 3. translate the po file with the usual means # 4. run 'make' to create the sgml, html, txt, ps, and pdf versions of your translation # # # HOWTO (re)generate all files for a language: # 1. run 'make CC-update' where CC is the language code # (e.g. nl-update regenerates all arkitektur.nl.* files) all: master-update nb-update nl-update de-update lyxes # regenerate .pot file and merge changes into .po files #master-update: $(DOCUMENT).en.pot $(DOCUMENT).en.html $(DOCUMENT).en.txt $(DOCUMENT).en.ps $(DOCUMENT).en.pdf master-update: $(DOCUMENT).en.pot $(DOCUMENT).en.html $(DOCUMENT).en.pdf \ $(DOCUMENT).de.po $(DOCUMENT).nb.po $(DOCUMENT).nl.po echo ; # given the .po file generate all files for the language % %-update: make $(DOCUMENT).$*.po; if ( (test $* != nb) ); then \ make $(DOCUMENT).$*.sgml; \ make $(DOCUMENT).$*.pdf; \ make $(DOCUMENT).$*.html; \ fi; # make $(DOCUMENT).$*.ps; # make $(DOCUMENT).$*.txt; echo ; ####################### # files for translation ####################### $(DOCUMENT).en.pot: $(DOCUMENT).en.sgml xml2pot $< > $@.new && mv $@.new $@ $(DOCUMENT).%.po: $(DOCUMENT).en.pot if test -e $@; then msgmerge $@ $< | iconv --verbose -f utf-8 -t `$(GET_CHARSET)` > $@.new && cat $@.new | sed "s/charset=UTF-8/charset=`$(GET_CHARSET)`/" > $@; rm $@.new; else cp $< $@; fi; #$(DOCUMENT).%.po: $(DOCUMENT).en.sgml $(DOCUMENT).%.sgml # split2po $(DOCUMENT).en.sgml $(DOCUMENT).$*.sgml > $@.new && mv $@.new $@ ####################### # po->generated formats ####################### # make sure we don't attempt to generate $(DOCUMENT).en.sgml $(DOCUMENT).en.sgml: ; $(DOCUMENT).%.sgml: $(DOCUMENT).%.po $(DOCUMENT).en.sgml cat $< | iconv -f `$(GET_CHARSET)` -t utf-8 > tmp.po po2xml $(DOCUMENT).en.sgml tmp.po | iconv -f utf-8 -t `$(GET_CHARSET)` | sed -e 's/lang="en"/lang="$*"/g' -e 's/_en/_$*/g'> $@ sed -i "s/ASCII/$(CHARSET)/" $@ rm tmp.po $(DOCUMENT).%.html: $(DOCUMENT).%.sgml # Using xsltproc and a stylesheet from ldp-docbook-xsl to make HTML # Ugly sed after call is to get around some xsltproc-produced weirdness that makes iconv barf # xsltproc /usr/share/xml/docbook/stylesheet/ldp/html/tldp-one-page.xsl $(DOCUMENT).$*.sgml | sed -e 's/â€.//g' | iconv -f utf-8 -t `$(GET_CHARSET)` | sed "s/UTF-8/$(CHARSET)/" > $(DOCUMENT).$*.html xsltproc /usr/share/xml/docbook/stylesheet/ldp/html/tldp-one-page.xsl $(DOCUMENT).$*.sgml > $(DOCUMENT).$*.html #docbook2html $(DOCUMENT).$*.sgml $(HTMLOPTS) #if [ -n "$*" ]; then mv $(DOCUMENT).$*.html $(DOCUMENT).html.$*; fi aid: cat IKT-bok.html.de | $(DOCUMENT).%.pdf: $(DOCUMENT).%.sgml docbook2pdf $(DOCUMENT).$*.sgml $(DOCUMENT).%.ps: $(DOCUMENT).%.sgml docbook2ps $(DOCUMENT).$*.sgml $(DOCUMENT).%.txt: $(DOCUMENT).%.html ln -s $(DOCUMENT).$*.html tmp.html; w3m -dump tmp.html > $@; rm tmp.html; ######### # Cleanup ######### # Temporary files and all generated formats distclean: clean $(RM) $(DOCUMENT).*.pdf $(DOCUMENT).*.ps $(DOCUMENT).html.* $(DOCUMENT).*.txt $(IMAGE)_*.png en-distclean: clean $(RM) $(DOCUMENT).$*.pdf $(DOCUMENT).$*.ps $(DOCUMENT).html.$* $(DOCUMENT).$*.txt %-distclean: clean $(RM) $(DOCUMENT).$*.sgml $(DOCUMENT).$*.pdf $(DOCUMENT).$*.ps $(DOCUMENT).html.$* $(DOCUMENT).$*.txt # Only temporary files clean: $(RM) *.log *.aux *.bak *~ *.dvi *.new *.tex # # include makefile for bugrap_howto.lyx, ldap_admin.lyx, and Rammekrav.lyx # include Makefile.lyx