binutils/
[platform/upstream/binutils.git] / binutils / doc / Makefile.am
1 ## Process this file with automake to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = cygnus
4
5 # What version of the manual you want; "all" includes everything
6 CONFIG=all
7
8 # Options to extract the man page from as.texinfo
9 MANCONF = -Dman
10
11 TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl
12
13 POD2MAN = pod2man --center="GNU Development Tools" \
14          --release="binutils-$(VERSION)" --section=1
15
16 # List of man pages generated from binutils.texi
17 man_MANS = \
18         addr2line.1 \
19         ar.1 \
20         dlltool.1 \
21         nlmconv.1 \
22         nm.1 \
23         objcopy.1 \
24         objdump.1 \
25         ranlib.1 \
26         readelf.1 \
27         size.1 \
28         strings.1 \
29         strip.1 \
30         windres.1 \
31         $(DEMANGLER_NAME).1
32
33 info_TEXINFOS = binutils.texi
34 binutils_TEXINFOS = config.texi
35 binutils_TEXI = $(srcdir)/binutils.texi
36
37 config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI)
38         rm -f config.texi
39         eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \
40           echo "@set VERSION $$VERSION" > $@
41         echo "@set UPDATED `date "+%B %Y"`" >> config.texi
42
43 # Man page generation from texinfo
44 addr2line.1:    $(binutils_TEXI)
45         touch $@
46         -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod
47         -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
48                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
49         rm -f addr2line.pod
50
51 ar.1:   $(binutils_TEXI)
52         touch $@
53         -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod
54         -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
55                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
56         rm -f ar.pod
57
58 dlltool.1:      $(binutils_TEXI)
59         touch $@
60         -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod
61         -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
62                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
63         rm -f dlltool.pod
64
65 nlmconv.1:      $(binutils_TEXI)
66         touch $@
67         -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
68         -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
69                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
70         rm -f nlmconv.pod
71
72 nm.1:   $(binutils_TEXI)
73         touch $@
74         -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod
75         -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
76                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
77         rm -f nm.pod
78
79 objcopy.1:      $(binutils_TEXI)
80         touch $@
81         -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod
82         -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
83                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
84         rm -f objcopy.pod
85
86 objdump.1:      $(binutils_TEXI)
87         touch $@
88         -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod
89         -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
90                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
91         rm -f objdump.pod
92
93 ranlib.1:       $(binutils_TEXI)
94         touch $@
95         -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod
96         -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
97                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
98         rm -f ranlib.pod
99
100 readelf.1:      $(binutils_TEXI)
101         touch $@
102         -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod
103         -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
104                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
105         rm -f readelf.pod
106
107 size.1: $(binutils_TEXI)
108         touch $@
109         -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod
110         -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
111                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
112         rm -f size.pod
113
114 strings.1:      $(binutils_TEXI)
115         touch $@
116         -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod
117         -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
118                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
119         rm -f strings.pod
120
121 strip.1:        $(binutils_TEXI)
122         touch $@
123         -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod
124         -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
125                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
126         rm -f strip.pod
127
128 windres.1:      $(binutils_TEXI)
129         touch $@
130         -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod
131         -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
132                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
133         rm -f windres.pod
134
135 cxxfilt.man:    $(binutils_TEXI)
136         touch $@
137         -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod
138         -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
139                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
140         rm -f $(DEMANGLER_NAME).pod
141
142 MAINTAINERCLEANFILES = config.texi
143 MOSTLYCLEANFILES     = $(DEMANGLER_NAME).1
144
145 $(DEMANGLER_NAME).1: cxxfilt.man Makefile
146         if test -f cxxfilt.man; then \
147           man=cxxfilt.man; \
148         else \
149           man=$(srcdir)/cxxfilt.man; \
150         fi; \
151         sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' \
152             -e 's/cxxfilt/$(DEMANGLER_NAME)/' < $$man \
153                 > $(DEMANGLER_NAME).1
154
155 # We want install to imply install-info as per GNU standards, despite the
156 # cygnus option.
157 install-data-local: install-info
158
159 # Maintenance
160
161 # We need it for the taz target in ../../Makefile.in.
162 info-local: $(MANS)