summaryrefslogtreecommitdiff
path: root/tests/pr204.test
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2004-08-01 17:31:22 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2004-08-01 17:31:22 +0000
commit16e08014a193dd5fadf043bcbdfa9f7735115af6 (patch)
treedd5b289a401e0df505bf35f408326e087c1ce282 /tests/pr204.test
parent96afbaa48766a2f37cee450f5e665cc368c80ea3 (diff)
downloadautomake-16e08014a193dd5fadf043bcbdfa9f7735115af6.tar.gz
Disable Lex and Yacc rules whenever possible if AM_MAINTAINER_MODE
is used and maintainer-mode disabled. * automake.in (Automake::struct): Define nodist_specific. Set it in languages yacc, yaccxx, lex, and lexxx. (register_language): Default nodist_specific to 0. (handle_single_transform): Honor nodist_specific. * lib/am/yacc.am (am__skipyacc): Define this in maintainer mode. (%EXT%%DERIVED-EXT%, %OBJ%): Use $(am__skipyacc) to disable these rules when needed. * lib/am/lex.am (am__skiplex): Define this in maintainer mode. (%EXT%%DERIVED-EXT%, %OBJ%): Use $(am__skiplex) to disable these rules when needed. * tests/mmodely.test: New file. * tests/pr204.test: Augment to check AM_MAINTAINER_MODE and nodist_ parsers. * tests/Makefile.am (TESTS): ADd mmodely.test. * doc/automake.texi (Yacc and Lex): Note dependence on maintainer mode.
Diffstat (limited to 'tests/pr204.test')
-rwxr-xr-xtests/pr204.test29
1 files changed, 21 insertions, 8 deletions
diff --git a/tests/pr204.test b/tests/pr204.test
index 26c861110..752800b66 100755
--- a/tests/pr204.test
+++ b/tests/pr204.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -29,6 +29,7 @@ set -e
cat > configure.in <<'EOF'
AC_INIT(pr204, 0.1)
AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_YACC
AC_CONFIG_FILES(Makefile)
@@ -43,6 +44,14 @@ AM_YFLAGS = -d
EXTRA_PROGRAMS = foo
PARSE2 = parse2.y
nodist_foo_SOURCES = parse.y $(PARSE2)
+
+distdirtest: distdir
+ test ! -f $(distdir)/parse.c
+ test ! -f $(distdir)/parse.y
+ test ! -f $(distdir)/parse.h
+ test ! -f $(distdir)/parse2.c
+ test ! -f $(distdir)/parse2.y
+ test ! -f $(distdir)/parse2.h
EOF
cat > parse.y << 'END'
@@ -60,12 +69,16 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE distdir
-test -f pr204-0.1/parse.c && exit 1
-test -f pr204-0.1/parse.y && exit 1
-test -f pr204-0.1/parse.h && exit 1
-test -f pr204-0.1/parse2.c && exit 1
-test -f pr204-0.1/parse2.y && exit 1
-test -f pr204-0.1/parse2.h && exit 1
+$MAKE distdirtest
# Make sure parse.c and parse2.c are still targets.
$MAKE parse.c parse2.c
+test -f parse.c
+test -f parse2.c
+
+# Ensure the rebuild rule works despite AM_MAINTAINER_MODE, because
+# it's a nodist_ parser.
+$sleep
+touch parse.y
+$sleep
+$MAKE parse.c parse2.c
+test `ls -1t parse.c parse.y | sed 1q` = parse.c