diff options
Diffstat (limited to 'tests/remake12.test')
-rwxr-xr-x | tests/remake12.test | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/tests/remake12.test b/tests/remake12.test index fe14885b7..d6c1ef20f 100755 --- a/tests/remake12.test +++ b/tests/remake12.test @@ -17,13 +17,27 @@ # Test basic remake rules for Makefiles with non-default names # and/or with multiple sources. -required=GNUmake . ./defs || Exit 1 magic1=::MagicStringOne:: magic2=__MagicStringTwo__ magic3=%%MagicStringThree%% +# See if the user's make implementation support an include directive. +# We need it in this test. +echo 'all:; @echo include is supported' > incl.mk +echo 'include incl.mk' > gnu-style.mk +echo '.include "incl.mk"' > bsd-style.mk +if $MAKE -f gnu-style.mk | grep 'include is supported'; then + echo "$me: GNU make include style supported" + include_zardoz='include zardoz' +elif $MAKE -f bsd-style.mk | grep 'include is supported'; then + echo "$me: BSD make include style supported" + include_zardoz='.include "zardoz"' +else + skip_ "make doesn't support any \"include\" directive" +fi + cat > configure.in <<END AC_INIT([$me], [1.0]) AM_INIT_AUTOMAKE @@ -38,7 +52,7 @@ EXTRA_DIST = Makefile END cat > Makefile <<END -include zardoz +$include_zardoz nil: .PHONY: nil END @@ -49,7 +63,11 @@ $AUTOMAKE ./configure -$MAKE nil +if using_gmake; then + $MAKE nil +else + $MAKE Makefile +fi grep '^#H:' zardoz.in # for debugging $FGREP $magic1 zardoz $FGREP $magic1 zardoz.in @@ -84,7 +102,11 @@ check-local: my-check END mv -f t zardoz.am cat zardoz.am # for debugging -$MAKE nil +if using_gmake; then + $MAKE nil +else + $MAKE zardoz +fi $FGREP my-check zardoz # sanity check $FGREP $magic1 zardoz zardoz.in && Exit 1 $FGREP $magic2 zardoz @@ -101,6 +123,7 @@ sed '/^#H:/d' zardoz.am > quux.am echo 'FOO = dummy' >> quux.am echo 'BAR = $(BAZ)' > top.in echo "BAZ = $magic3" > bot.in +is_gmake || $MAKE zardoz $MAKE test $FGREP my-check zardoz # sanity check $FGREP $magic3 quux.in && Exit 1 @@ -110,11 +133,14 @@ $FGREP $magic2 zardoz && Exit 1 # After the remake above, the files `zardoz.am' and `zardoz.in' # should be no more needed echo 'endif' > zardoz.am # put in syntax error +is_gmake || $MAKE zardoz $MAKE test rm -f zardoz.in zardoz.am # get rid of them +is_gmake || $MAKE zardoz $MAKE test echo 'FOO = $(BAR)' >> quux.am +is_gmake || $MAKE zardoz $MAKE distcheck : |