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)
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 stdout output is
18 # sufficiently complete. This currently only works for GNU make and
19 # BSD make implementations that support the `.MAKE' special target.
21 # This test exercises the GCS-mandated targets (except for dist)
22 # as well as tags, TAGS.
24 # Please keep this test in sync with sister test maken3.test.
33 cat >> configure.
in << 'END'
34 AC_CONFIG_FILES
([sub
/Makefile sub
2/Makefile
])
38 cat > Makefile.am
<<'END'
67 @: > stamp-installcheck
69 @: > stamp-mostlyclean
70 maintainer-clean-local:
71 @: > stamp-maintainer-clean
73 cat >sub
/Makefile.am
<<'END'
77 @: > stamp-install-sub
79 @: > stamp-uninstall-sub
83 @: > stamp-distclean-sub
97 @: > stamp-installcheck-sub
103 @: > stamp-mostlyclean-sub
104 maintainer-clean-local:
105 @: > stamp-maintainer-clean-sub
107 cat >sub
2/Makefile.am
<<'END'
108 all install uninstall clean check:
109 @: > sub2-$@-should-not-be-executed
111 @: > sub2-$@-should-not-be-executed
113 @: > sub2-$@-should-not-be-executed
114 install-info install-html install-dvi install-pdf install-ps:
115 @: > sub2-$@-should-not-be-executed
116 installcheck installdirs tags TAGS mostlyclean:
117 @: > sub2-$@-should-not-be-executed
118 ## These targets cannot be overridden like this:
119 ## install-strip distclean maintainer-clean
129 all
install install-strip uninstall clean distclean check \
130 info html dvi pdf ps \
131 install-info install-html install-dvi install-pdf install-ps \
132 installcheck installdirs tags TAGS mostlyclean maintainer-clean
134 $MAKE -n $target >stdout ||
{ cat stdout
; Exit
1; }
137 install-
* | installdirs | tags | TAGS
) ;;
139 grep "stamp-$target$" stdout || Exit
1
140 test ! -f "stamp-$target$" || Exit
1
144 install-
* | installdirs
) ;;
146 grep "stamp-$target-sub" stdout || Exit
1
147 test ! -f "sub/stamp-$target-sub" || Exit
1
151 distclean | maintainer-clean
) ;;
153 grep "should-not-be-executed" stdout || Exit
1
154 test ! -f "sub2/sub2-$target-should-not-be-executed" || Exit
1
160 $AUTOMAKE -Wno-override
162 check_targets || Exit
1
164 # Now, introduce BUILT_SOURCES into the toplevel Makefile
165 # TODO: add BUILT_SOURCES to sub2, fix fallout.
166 sed 's/##//' < Makefile.am
> t
168 $AUTOMAKE -Wno-override --force Makefile
170 check_targets || Exit
1