Revert Automake license to GPLv2+.
[automake.git] / tests / maken3.test
blobb839d0da92f752fbf5e57513046dde98eb1c9a28
1 #! /bin/sh
2 # Copyright (C) 2009 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, see <http://www.gnu.org/licenses/>.
17 # Test `make -n' for various targets, to ensure that no files or
18 # directories are created.
20 # This test exercises the GCS-mandated targets (except for dist)
21 # as well as tags, TAGS.
23 # Please keep this test in sync with sister test maken4.test.
25 . ./defs || Exit 1
27 set -e
29 mkdir sub sub2
31 cat >> configure.in << 'END'
32 AC_CONFIG_FILES([sub/Makefile sub2/Makefile])
33 AC_OUTPUT
34 END
36 cat > Makefile.am <<'END'
37 TESTS = foo.test
38 SUBDIRS = sub sub2
39 ##BUILT_SOURCES = foo
40 foo:
41 foo.test:
42 all-local:
43 @: > stamp-all
44 install-data-local:
45 @: > stamp-install
46 uninstall-local:
47 @: > stamp-uninstall
48 clean-local:
49 @: > stamp-clean
50 distclean-local:
51 @: > stamp-distclean
52 info-local:
53 @: > stamp-info
54 html-local:
55 @: > stamp-html
56 dvi-local:
57 @: > stamp-dvi
58 ps-local:
59 @: > stamp-ps
60 pdf-local:
61 @: > stamp-pdf
62 check-local:
63 @: > stamp-check
64 installcheck-local:
65 @: > stamp-installcheck
66 mostlyclean-local:
67 @: > stamp-mostlyclean
68 maintainer-clean-local:
69 @: > stamp-maintainer-clean
70 END
71 cat >sub/Makefile.am <<'END'
72 all-local:
73 @: > stamp-all-sub
74 install-data-local:
75 @: > stamp-install-sub
76 uninstall-local:
77 @: > stamp-uninstall-sub
78 clean-local:
79 @: > stamp-clean-sub
80 distclean-local:
81 @: > stamp-distclean-sub
82 info-local:
83 @: > stamp-info-sub
84 html-local:
85 @: > stamp-html-sub
86 dvi-local:
87 @: > stamp-dvi-sub
88 ps-local:
89 @: > stamp-ps-sub
90 pdf-local:
91 @: > stamp-pdf-sub
92 check-local:
93 @: > stamp-check-sub
94 installcheck-local:
95 @: > stamp-installcheck-sub
96 tags:
97 @: > stamp-tags-sub
98 TAGS:
99 @: > stamp-TAGS-sub
100 mostlyclean-local:
101 @: > stamp-mostlyclean-sub
102 maintainer-clean-local:
103 @: > stamp-maintainer-clean-sub
105 cat >sub2/Makefile.am <<'END'
106 all install uninstall clean check:
107 @: > sub2-$@-should-not-be-executed
108 info dvi pdf ps:
109 @: > sub2-$@-should-not-be-executed
110 html:
111 @: > sub2-$@-should-not-be-executed
112 install-info install-html install-dvi install-pdf install-ps:
113 @: > sub2-$@-should-not-be-executed
114 installcheck installdirs tags TAGS mostlyclean:
115 @: > sub2-$@-should-not-be-executed
116 ## These targets cannot be overridden like this:
117 ## install-strip distclean maintainer-clean
120 $ACLOCAL
121 $AUTOCONF
123 check_targets ()
125 set -e
126 for target in \
127 all install install-strip uninstall clean distclean check \
128 info html dvi pdf ps \
129 install-info install-html install-dvi install-pdf install-ps \
130 installcheck installdirs tags TAGS mostlyclean maintainer-clean
132 $MAKE -n $target >stdout || { cat stdout; Exit 1; }
133 cat stdout
134 case $target in
135 install-* | installdirs | tags | TAGS ) ;;
137 test ! -f "stamp-$target$" || Exit 1
139 esac
140 case $target in
141 install-* | installdirs ) ;;
143 test ! -f "sub/stamp-$target-sub" || Exit 1
145 esac
146 case $target in
147 distclean | maintainer-clean ) ;;
149 test ! -f "sub2/sub2-$target-should-not-be-executed" || Exit 1
151 esac
152 done
155 $AUTOMAKE -Wno-override
156 ./configure
157 check_targets || Exit 1
159 # Now, introduce BUILT_SOURCES into the toplevel Makefile
160 # TODO: add BUILT_SOURCES to sub2, fix fallout.
161 sed 's/##//' < Makefile.am > t
162 mv -f t Makefile.am
163 $AUTOMAKE -Wno-override --force Makefile
164 ./configure
165 check_targets || Exit 1
167 Exit 0