* COPYING, ChangeLog, ChangeLog.00, ChangeLog.01, ChangeLog.02,
[platform/upstream/automake.git] / lib / am / texi-vers.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
3 ## Free Software Foundation, Inc.
4
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
9
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301, USA.
19
20 DIST_COMMON += %VTEXI% %STAMPVTI%
21
22 ## Don't give this rule a command (even `@:').
23 ## %STAMPVTI% is always newer than %VTEXI%, so this rule is always
24 ## triggered.  If you equip this rule with a command, GNU make will
25 ## assume %VTEXI% has been rebuild in the current directory and
26 ## discard any %VTEXI% file found in a VPATH search.
27 %VTEXI%: %MAINTAINER-MODE% %STAMPVTI%
28
29 ## Depend on configure so that version number updates cause a rebuild.
30 ## (Not configure.ac, because not all setups define the version number
31 ## in this file.)
32 %STAMPVTI%: %TEXI% $(top_srcdir)/configure
33 ## It is wrong to have %STAMPVTI% dependent on %DIRSTAMP%, because
34 ## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file
35 ## should never be dependent upon a non-distributed built file.
36 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
37 ?DIRSTAMP?      test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
38         @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
39         set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
40         echo "@set UPDATED $$1 $$2 $$3"; \
41         echo "@set UPDATED-MONTH $$2 $$3"; \
42         echo "@set EDITION $(VERSION)"; \
43         echo "@set VERSION $(VERSION)") > %VTI%.tmp
44 ## Use cp and rm here because some older "mv"s can't move across
45 ## filesystems.  Furthermore, GNU "mv" in the AmigaDOS environment
46 ## can't handle this.
47         @cmp -s %VTI%.tmp %VTEXI% \
48           || (echo "Updating %VTEXI%"; \
49               cp %VTI%.tmp %VTEXI%)
50         -@rm -f %VTI%.tmp
51         @cp %VTEXI% $@
52
53 mostlyclean-am: mostlyclean-%VTI%
54 mostlyclean-%VTI%:
55         -rm -f %VTI%.tmp
56
57 maintainer-clean-am: maintainer-clean-%VTI%
58 maintainer-clean-%VTI%:
59 %MAINTAINER-MODE%       -rm -f %STAMPVTI% %VTEXI%
60
61 .PHONY: mostlyclean-%VTI% maintainer-clean-%VTI%