doc: update Vala documentation
[automake.git] / t / yflags-cmdline-override.sh
blob381511fcea44ad239f937e8e313e6b4454f23291
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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 <https://www.gnu.org/licenses/>.
17 # Check that automake can cope with user-redefinition of $(YFLAGS)
18 # at configure time and/or at make time.
20 required='cc yacc'
21 . test-init.sh
23 cat >> configure.ac <<'END'
24 AC_PROG_CC
25 AC_PROG_YACC
26 AC_OUTPUT
27 END
29 cat > Makefile.am <<'END'
30 AM_LFLAGS = --never-interactive
32 bin_PROGRAMS = foo
33 foo_SOURCES = foo.y
34 # A minor automake wart: automake doesn't generate code to clean
35 # '*.output' files generated by yacc (it's not even clear if that
36 # would be useful in general, so it's probably better to be
37 # conservative).
38 CLEANFILES = foo.output
39 # As the '-d' flag won't be given at automake time, automake won't
40 # be able to generate code to clean 'foo.h'. We can't really blame
41 # automake for that.
42 MAINTAINERCLEANFILES = foo.h
43 END
45 cat > foo.y << 'END'
47 int yylex () { return 0; }
48 void yyerror (const char *s) {}
49 int main () { return 0; }
52 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
53 END
55 $ACLOCAL
56 $AUTOMAKE -a
57 $AUTOCONF
59 ./configure YFLAGS='-d -v'
60 $MAKE
61 ls -l
62 test -f foo.c
63 test -f foo.h
64 test -f foo.output
66 $MAKE maintainer-clean
67 ls -l
69 ./configure YFLAGS='-v'
70 $MAKE
71 ls -l
72 test -f foo.c
73 test ! -e foo.h
74 test -f foo.output
76 $MAKE maintainer-clean
77 ls -l
79 ./configure YFLAGS='-v'
80 run_make YFLAGS=-d
81 ls -l
82 test -f foo.c
83 test -f foo.h
84 test ! -e foo.output
86 $MAKE maintainer-clean
87 ls -l