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 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.
31 cat >> configure.
in << 'END'
32 AC_CONFIG_FILES
([sub
/Makefile sub
2/Makefile
])
36 cat > Makefile.am
<<'END'
65 @: > stamp-installcheck
67 @: > stamp-mostlyclean
68 maintainer-clean-local:
69 @: > stamp-maintainer-clean
71 cat >sub
/Makefile.am
<<'END'
75 @: > stamp-install-sub
77 @: > stamp-uninstall-sub
81 @: > stamp-distclean-sub
95 @: > stamp-installcheck-sub
101 @: > stamp-mostlyclean-sub
102 maintainer-clean-local:
103 @: > stamp-maintainer-clean-sub
105 cat >sub
2/Makefile.am
<<'END'
106 all install uninstall clean check:
107 @: > sub2-$@-should-not-be-executed
109 @: > sub2-$@-should-not-be-executed
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
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; }
135 install-
* | installdirs | tags | TAGS
) ;;
137 test ! -f "stamp-$target$" || Exit
1
141 install-
* | installdirs
) ;;
143 test ! -f "sub/stamp-$target-sub" || Exit
1
147 distclean | maintainer-clean
) ;;
149 test ! -f "sub2/sub2-$target-should-not-be-executed" || Exit
1
155 $AUTOMAKE -Wno-override
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
163 $AUTOMAKE -Wno-override --force Makefile
165 check_targets || Exit
1