Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / lex-subobj-nodep.test
1 #! /bin/sh
2 # Copyright (C) 2011 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Ensure subdirs for subdir scanners are generated when subdir-objects
18 # are used, even when dependency tracking is disabled.
19
20 required=flex
21 . ./defs || Exit 1
22
23 set -e
24
25 cat >>configure.in <<\END
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 AC_PROG_LEX
29 AC_OUTPUT
30 END
31
32 cat >Makefile.am <<\END
33 AUTOMAKE_OPTIONS = subdir-objects
34 bin_PROGRAMS = p1 p2
35 p1_SOURCES = sub1/s1.l
36 p2_SOURCES = sub2/s2.l
37 p2_CPPFLAGS = -DWHATEVER
38 END
39
40 mkdir sub1 sub2
41
42 cat >sub1/s1.l <<\END
43 %%
44 "END"   return EOF;
45 .
46 %%
47 int main (void)
48 {
49   while (yylex () != EOF)
50     ;
51   return 0;
52 }
53
54 int yywrap(void)
55 {
56   return 0;
57 }
58 END
59
60 cp sub1/s1.l sub2/s2.l
61
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE -a
65 mkdir build
66 cd build
67 ../configure --disable-dependency-tracking
68 $MAKE sub1/s1.c
69 $MAKE sub2/s2.c
70 rm -rf sub1 sub2
71 $MAKE
72
73 :