# # Makefile for the release notes, language subdirectory # # parallel compiling is not possible MAKEFLAGS=j1 manual := release-notes release := sarge currentlang := $(notdir $(CURDIR)) currentlangcn := $(subst _,-,$(shell echo $(currentlang) | tr A-Z a-z)) # locale for debiandoc-sgml ddencoding := $(subst ro,ro.utf-8,$(currentlang)) # this can and will be overriden by a higher level makefile PUBLISHDIR := /org/www.debian.org/www/releases/$(release) sources := $(manual).$(currentlang).sgml ../$(manual).ent ../dynamic.ent export LANG=C # stupid debiandoc stuff uses strings in another language otherwise all: html text ps pdf # create SGML from PO file if existent # see also ../project-history/Makefile for PO->SGML Makefile integration # No backup PO file export VERSION_CONTROL:=off ORIGINAL = ../en/$(manual).en.sgml POFILE = $(manual).$(currentlang).po IGNOREDINCLUSIONS = dynamicdata shareddata $(manual).%.sgml: $(ORIGINAL) $(manual).%.po \ $(wildcard addenda/*.add) ../dynamic.ent -po4a-translate -k 0 -f sgml -m $(ORIGINAL) \ -p $(manual).$*.po -l $(manual).$*.sgml \ -o ignore-inclusion="$(IGNOREDINCLUSIONS)" @if [ "$(ENCODING)" ] && iconv -f UTF-8 -t $(ENCODING) $(manual).$*.sgml > $(manual).$*.sgml.recoded; then \ mv $(manual).$*.sgml.recoded $(manual).$*.sgml; \ else \ rm -f $(manual).$*.sgml.recoded; \ fi # po4a ignores conditionals so we can use any architecture for ../dynamic.ent # "update-po: override architecture=i386" does not work update-po: $(ORIGINAL) if ! [ -e ../dynamic.ent ]; then $(MAKE) architecture=i386 ../dynamic.ent; fi po4a-updatepo -f sgml -m $(ORIGINAL) -p $(POFILE) \ -o ignore-inclusion="$(IGNOREDINCLUSIONS)"; \ stats: ../dynamic.ent -@echo -n "$(POFILE): " 1>&2; \ po4a-gettextize -f sgml -m $(ORIGINAL) \ -o ignore-inclusion="$(IGNOREDINCLUSIONS)" \ | sed -e "s/charset=CHARSET/charset=ascii/" \ | msgmerge -q $(POFILE) - \ | msgfmt -o /dev/null --statistics -; publish: all test -d $(PUBLISHDIR)/$(manual) || install -d -m 755 $(PUBLISHDIR)/$(manual) rm -f $(PUBLISHDIR)/$(manual)/*.$(currentlangcn).html install -p -m 644 $(manual).$(currentlang).html/*.html $(PUBLISHDIR)/$(manual) install -p -m 644 $(manual)*.txt $(manual)*.ps $(manual)*.pdf $(PUBLISHDIR)/$(manual) validate: $(manual).$(currentlang).sgml nsgmls -ges -wall $(manual).$(currentlang).sgml html: $(manual).$(currentlang).html/index.$(currentlangcn).html $(manual).$(currentlang).html/index.$(currentlangcn).html: $(sources) # debiandoc-sgml v1.2.8 supports -C (not installed on build host) debiandoc2html -c -l $(ddencoding) $< && \ for i in $(manual).$(currentlang).html/*.html; do \ sed 's/.utf-8.html/.html/' $$i > $$i.tmp && rm $$i && \ mv $$i.tmp $$(echo $$i | sed 's/.utf-8//'); \ done text: $(manual).$(currentlang).txt $(manual).$(currentlang).txt: $(sources) debiandoc2text -l $(ddencoding) $< $(manual).$(currentlang).info: $(sources) debiandoc2info -l $(ddencoding) $< # TODO: rename to .$(currentlang).info? $(manual).$(currentlang).ps $(manual).$(currentlang).dvi $(manual).$(currentlang).pdf: \ $(manual).$(currentlang).%: $(sources) debiandoc2latex$* -l $(ddencoding) $< ps dvi pdf info: %: $(manual).$(currentlang).% # generate entities which are dynamically defined by the settings of this # build run ../dynamic_$(architecture).ent: ifeq "$(architecture)" "" @echo architecture variable must be set exit 1 endif : > $@ # clear the file echo "" >> $@ echo "" >> $@ .PHONY: ../dynamic.ent ../dynamic.ent: ../dynamic_$(architecture).ent rm -f $@ ln -s $(notdir $<) $@ clean distclean: rm -rf $(manual)*.$(currentlang).html for ext in txt ps dvi pdf out tex-in info\* aux log man tex toc sasp\* tpt; do rm -f $(manual)*.$$ext; done rm -f head.tmp body.tmp rm -f *~ .*~ core tsa* $(patsubst %.po,%.sgml,$(wildcard *.??*.po)) .PHONY: all publish clean distclean validate