Merge branch 'micro' into maint
[platform/upstream/automake.git] / lib / am / texi-vers.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2013 Free Software Foundation, Inc.
3
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.
8
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.
13
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 DIST_COMMON += %VTEXI% %STAMPVTI%
18
19 ## Don't give this rule a command (even '@:').
20 ## %STAMPVTI% is always newer than %VTEXI%, so this rule is always
21 ## triggered.  If you equip this rule with a command, GNU make will
22 ## assume %VTEXI% has been rebuild in the current directory and
23 ## discard any %VTEXI% file found in a VPATH search.
24 %VTEXI%: %MAINTAINER-MODE% %STAMPVTI%
25
26 ## Depend on configure so that version number updates cause a rebuild.
27 ## (Not configure.ac, because not all setups define the version number
28 ## in this file.)
29 %STAMPVTI%: %TEXI% $(top_srcdir)/configure
30 ## It is wrong to have %STAMPVTI% dependent on %DIRSTAMP%, because
31 ## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file
32 ## should never be dependent upon a non-distributed built file.
33 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
34 ?DIRSTAMP?      @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
35         @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
36         set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
37         echo "@set UPDATED $$1 $$2 $$3"; \
38         echo "@set UPDATED-MONTH $$2 $$3"; \
39         echo "@set EDITION $(VERSION)"; \
40         echo "@set VERSION $(VERSION)") > %VTI%.tmp
41 ## Use cp and rm here because some older "mv"s can't move across
42 ## filesystems.  Furthermore, GNU "mv" in the AmigaDOS environment
43 ## can't handle this.
44         @cmp -s %VTI%.tmp %VTEXI% \
45           || (echo "Updating %VTEXI%"; \
46               cp %VTI%.tmp %VTEXI%)
47         -@rm -f %VTI%.tmp
48         @cp %VTEXI% $@
49
50 mostlyclean-am: mostlyclean-%VTI%
51 mostlyclean-%VTI%:
52         -rm -f %VTI%.tmp
53
54 maintainer-clean-am: maintainer-clean-%VTI%
55 maintainer-clean-%VTI%:
56 %MAINTAINER-MODE%       -rm -f %STAMPVTI% %VTEXI%
57
58 .PHONY: mostlyclean-%VTI% maintainer-clean-%VTI%