fixed readme-alpha bug
[automake.git] / texinfos.am
blobd04b894afaedbe5bdb1bee91aafba874590f84ef
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; if not, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 ## 02111-1307, USA.
18 .texi.info:
19 ## We want to force the .info file to be built in srcdir.  This is
20 ## probably the simplest way.  However, at Cygnus .info files are
21 ## always put into the build directory.  So at runtime we select which
22 ## rule to use.
23 ## Note that we also remove the possible output files before running
24 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
25 ## using --no-split), you'll be left with some dead info files lying
26 ## around -- dead files which will end up in the distribution.
27 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
28 NOTCYGNUS       cd $(srcdir) \
29 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
30 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
31 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
33 .texi.dvi:
34         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
35 ## Must set MAKEINFO like this so that version.texi will be found even
36 ## if it is in srcdir.
37           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
39 .texi:
40 ## We want to force the .info file to be built in srcdir.  This is
41 ## probably the simplest way.  However, at Cygnus .info files are
42 ## always put into the build directory.  So at runtime we select which
43 ## rule to use.
44 ## Note that we also remove the possible output files before running
45 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
46 ## using --no-split), you'll be left with some dead info files lying
47 ## around -- dead files which will end up in the distribution.
48 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
49 NOTCYGNUS       cd $(srcdir) \
50 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
51 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
52 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
54 .texinfo.info:
55 ## We want to force the .info file to be built in srcdir.  This is
56 ## probably the simplest way.  However, at Cygnus .info files are
57 ## always put into the build directory.  So at runtime we select which
58 ## rule to use.
59 ## Note that we also remove the possible output files before running
60 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
61 ## using --no-split), you'll be left with some dead info files lying
62 ## around -- dead files which will end up in the distribution.
63 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
64 NOTCYGNUS       cd $(srcdir) \
65 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
66 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
67 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
69 .texinfo:
70 ## We want to force the .info file to be built in srcdir.  This is
71 ## probably the simplest way.  However, at Cygnus .info files are
72 ## always put into the build directory.  So at runtime we select which
73 ## rule to use.
74 ## Note that we also remove the possible output files before running
75 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
76 ## using --no-split), you'll be left with some dead info files lying
77 ## around -- dead files which will end up in the distribution.
78 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
79 NOTCYGNUS       cd $(srcdir) \
80 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
81 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
82 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
84 .texinfo.dvi:
85         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
86 ## Must set MAKEINFO like this so that version.texi will be found even
87 ## if it is in srcdir.
88           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
90 ## The way to make PostScript, for those who want it.
91 DVIPS = dvips
92 .dvi.ps:
93         $(DVIPS) $< -o $@
95 ## Look in both . and srcdir because the info pages might have been
96 ## rebuilt in the build directory.  Can't cd to srcdir; that might
97 ## break a possible install-sh reference.
98 ## Funny name due to --cygnus influence; we want to reserve
99 ## `install-info' for the user.
100 install-info-am: $(INFO_DEPS)
101         @$(NORMAL_INSTALL)
102         $(mkinstalldirs) $(infodir)
103         @for file in $(INFO_DEPS); do \
104 CYGNUS    if test -f $$file; then d=.; else d=$(srcdir); fi; \
105 NOTCYGNUS         d=$(srcdir); \
106 ## We use these strange circumlocutions because we want the "ifile" to
107 ## be relative, for the install.
108           for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
109             if test -f $$d/$$ifile; then \
110               echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
111               $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
112             else : ; fi; \
113           done; \
114         done
115         @$(POST_INSTALL)
116 ## Only run this code if install-info actually exists, and it is not
117 ## the Debian install-info.  FIXME: once Debian install-info goes
118 ## away, we can remove this hack.
119         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
120           for file in $(INFO_DEPS); do \
121 ## Run `:' after install-info in case install-info fails.  We really
122 ## don't care about failures here, because they can be spurious.  For
123 ## instance if you don't have a dir file, install-info will fail.  I
124 ## think instead it should create a new dir file for you.  This bug
125 ## causes the `make distcheck' target to fail reliably.
126             echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
127 ## Use `|| :' here because Sun make passes -e to sh; if install-info
128 ## fails then we'd fail if we used `;'.
129             install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
130           done; \
131         else : ; fi
133 uninstall-info:
134         $(PRE_UNINSTALL)
135 ## Run two loops here so that we can handle PRE_UNINSTALL and
136 ## NORMAL_UNINSTALL correctly.
137         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
138           ii=yes; \
139         else ii=; fi; \
140         for file in $(INFO_DEPS); do \
141           test -z "$ii" \
142             || install-info --info-dir=$(infodir) --remove $$file; \
143         done
144         $(NORMAL_UNINSTALL)
145         for file in $(INFO_DEPS); do \
146           (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
147         done
149 dist-info: $(INFO_DEPS)
150         for base in $(INFO_DEPS); do \
151 ## In Cygnus mode, allow info file to be in source or build dir.  In
152 ## other modes, allow only source dir.
153 NOTCYGNUS         d=$(srcdir); \
154 CYGNUS    if test -f $$base; then d=.; else d=$(srcdir); fi; \
155           for file in `cd $$d && eval echo $$base*`; do \
156             test -f $(distdir)/$$file \
157             || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
158             || cp -p $$d/$$file $(distdir)/$$file; \
159           done; \
160         done