/[ddp]/manuals/trunk/release-notes/Makefile.common
ViewVC logotype

Contents of /manuals/trunk/release-notes/Makefile.common

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3936 - (show annotations) (download)
Thu Nov 9 14:33:51 2006 UTC (6 years, 6 months ago) by jseidel
File size: 3623 byte(s)
Do not abort if the committed SGML file has already the required encoding
instead of UTF-8.
1 #
2 # Makefile for the release notes, language subdirectory
3 #
4
5 manual := release-notes
6 release := sarge
7
8 currentlang := $(notdir $(CURDIR))
9 currentlangcn := $(subst _,-,$(shell echo $(currentlang) | tr A-Z a-z))
10
11 # this can and will be overriden by a higher level makefile
12 PUBLISHDIR := /org/www.debian.org/www/releases/$(release)
13
14 sources := $(manual).$(currentlang).sgml ../$(manual).ent ../dynamic.ent
15
16 export LANG=C
17 # stupid debiandoc stuff uses strings in another language otherwise
18
19 all: html text ps pdf
20
21 # create SGML from PO file if existent
22 # see also ../project-history/Makefile for PO->SGML Makefile integration
23 # No backup PO file
24 export VERSION_CONTROL:=off
25
26 ORIGINAL = ../en/$(manual).en.sgml
27 POFILE = $(manual).$(currentlang).po
28
29 IGNOREDINCLUSIONS = dynamicdata shareddata
30
31 $(manual).%.sgml: $(ORIGINAL) $(manual).%.po \
32 $(wildcard addenda/*.add) ../dynamic.ent
33 -po4a-translate -k 0 -f sgml -m $(ORIGINAL) \
34 -p $(manual).$*.po -l $(manual).$*.sgml \
35 -o ignore-inclusion="$(IGNOREDINCLUSIONS)"
36 @if [ "$(ENCODING)" ] && iconv -f UTF-8 -t $(ENCODING) $(manual).$*.sgml > $(manual).$*.sgml.recoded; then \
37 mv $(manual).$*.sgml.recoded $(manual).$*.sgml; \
38 else \
39 rm -f $(manual).$*.sgml.recoded; \
40 fi
41
42 # po4a ignores conditionals so we can use any architecture for ../dynamic.ent
43 # "update-po: override architecture=i386" does not work
44 update-po: $(ORIGINAL)
45 if ! [ -e ../dynamic.ent ]; then $(MAKE) architecture=i386 ../dynamic.ent; fi
46 po4a-updatepo -f sgml -m $(ORIGINAL) -p $(POFILE) \
47 -o ignore-inclusion="$(IGNOREDINCLUSIONS)"; \
48
49 stats: ../dynamic.ent
50 -@echo -n "$(POFILE): " 1>&2; \
51 po4a-gettextize -f sgml -m $(ORIGINAL) \
52 -o ignore-inclusion="$(IGNOREDINCLUSIONS)" \
53 | sed -e "s/charset=CHARSET/charset=ascii/" \
54 | msgmerge -q $(POFILE) - \
55 | msgfmt -o /dev/null --statistics -;
56
57 publish: all
58 test -d $(PUBLISHDIR)/$(manual) || install -d -m 755 $(PUBLISHDIR)/$(manual)
59 rm -f $(PUBLISHDIR)/$(manual)/*.$(currentlangcn).html
60 install -p -m 644 $(manual).$(currentlang).html/*.html $(PUBLISHDIR)/$(manual)
61 install -p -m 644 $(manual)*.txt $(manual)*.ps $(manual)*.pdf $(PUBLISHDIR)/$(manual)
62
63 validate: $(manual).$(currentlang).sgml
64 nsgmls -ges -wall $(manual).$(currentlang).sgml
65
66 html: $(manual).$(currentlang).html/index.$(currentlangcn).html
67 $(manual).$(currentlang).html/index.$(currentlangcn).html: $(sources)
68 debiandoc2html -c -l $(currentlang) $<
69
70 text: $(manual).$(currentlang).txt
71 $(manual).$(currentlang).txt: $(sources)
72 debiandoc2text -l $(currentlang) $<
73
74 $(manual).$(currentlang).info: $(sources)
75 debiandoc2info -l $(currentlang) $<
76 # TODO: rename to .$(currentlang).info?
77
78 $(manual).$(currentlang).ps $(manual).$(currentlang).dvi $(manual).$(currentlang).pdf: \
79 $(manual).$(currentlang).%: $(sources)
80 debiandoc2latex$* -l $(currentlang) $<
81
82 ps dvi pdf info: %: $(manual).$(currentlang).%
83
84 # generate entities which are dynamically defined by the settings of this
85 # build run
86 ../dynamic_$(architecture).ent:
87 ifeq "$(architecture)" ""
88 @echo architecture variable must be set
89 exit 1
90 endif
91 : > $@ # clear the file
92 echo "<!entity architecture \"$(architecture)\">" >> $@
93 echo "<!entity % $(architecture) \"INCLUDE\">" >> $@
94
95 .PHONY: ../dynamic.ent
96 ../dynamic.ent: ../dynamic_$(architecture).ent
97 rm -f $@
98 ln -s $(notdir $<) $@
99
100 clean distclean:
101 rm -rf $(manual)*.$(currentlang).html
102 for ext in txt ps dvi pdf info\* aux log man tex toc sasp\* tpt; do rm -f $(manual)*.$$ext; done
103 rm -f head.tmp body.tmp
104 rm -f *~ .*~ core tsa* #$(patsubst %.po,%.sgml,$(wildcard *.??*.po))
105
106 .PHONY: all publish clean distclean validate

  ViewVC Help
Powered by ViewVC 1.1.5