* doc/Makefile.am (addr2line.1): Depend on $(binutils_TEXINFOS).
[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 $(AM_MAKEINFOFLAGS)
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 AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty"
38
39 config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI)
40         rm -f config.texi
41         eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \
42           echo "@set VERSION $$VERSION" > $@
43         echo "@set UPDATED `date "+%B %Y"`" >> config.texi
44
45 # Man page generation from texinfo
46 addr2line.1:    $(binutils_TEXI) $(binutils_TEXINFOS)
47         touch $@
48         -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod
49         -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
50                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
51         rm -f addr2line.pod
52
53 ar.1:   $(binutils_TEXI) $(binutils_TEXINFOS)
54         touch $@
55         -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod
56         -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
57                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
58         rm -f ar.pod
59
60 dlltool.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
61         touch $@
62         -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod
63         -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
64                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
65         rm -f dlltool.pod
66
67 nlmconv.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
68         touch $@
69         -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
70         -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
71                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
72         rm -f nlmconv.pod
73
74 nm.1:   $(binutils_TEXI) $(binutils_TEXINFOS)
75         touch $@
76         -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod
77         -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
78                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
79         rm -f nm.pod
80
81 objcopy.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
82         touch $@
83         -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod
84         -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
85                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
86         rm -f objcopy.pod
87
88 objdump.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
89         touch $@
90         -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod
91         -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
92                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
93         rm -f objdump.pod
94
95 ranlib.1:       $(binutils_TEXI) $(binutils_TEXINFOS)
96         touch $@
97         -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod
98         -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
99                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
100         rm -f ranlib.pod
101
102 readelf.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
103         touch $@
104         -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod
105         -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
106                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
107         rm -f readelf.pod
108
109 size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
110         touch $@
111         -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod
112         -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
113                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
114         rm -f size.pod
115
116 strings.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
117         touch $@
118         -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod
119         -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
120                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
121         rm -f strings.pod
122
123 strip.1:        $(binutils_TEXI) $(binutils_TEXINFOS)
124         touch $@
125         -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod
126         -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
127                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
128         rm -f strip.pod
129
130 windres.1:      $(binutils_TEXI) $(binutils_TEXINFOS)
131         touch $@
132         -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod
133         -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
134                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
135         rm -f windres.pod
136
137 cxxfilt.man:    $(binutils_TEXI) $(binutils_TEXINFOS)
138         touch $@
139         -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod
140         -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
141                 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
142         rm -f $(DEMANGLER_NAME).pod
143
144 MAINTAINERCLEANFILES = config.texi
145 MOSTLYCLEANFILES     = $(DEMANGLER_NAME).1
146
147 $(DEMANGLER_NAME).1: cxxfilt.man Makefile
148         if test -f cxxfilt.man; then \
149           man=cxxfilt.man; \
150         else \
151           man=$(srcdir)/cxxfilt.man; \
152         fi; \
153         sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' \
154             -e 's/cxxfilt/$(DEMANGLER_NAME)/' < $$man \
155                 > $(DEMANGLER_NAME).1
156
157 # We want install to imply install-info as per GNU standards, despite the
158 # cygnus option.
159 install-data-local: install-info
160
161 html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
162
163 install-html: install-html-am
164
165 install-html-am: $(HTMLS)
166         @$(NORMAL_INSTALL)
167         test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
168         @list='$(HTMLS)'; for p in $$list; do \
169           if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
170           f=$(html__strip_dir) \
171           if test -d "$$d$$p"; then \
172             echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
173             $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
174             echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
175             $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
176           else \
177             echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
178             $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
179           fi; \
180         done
181
182 # Maintenance
183
184 # We need it for the taz target in ../../Makefile.in.
185 info-local: $(MANS)