Merge branch 'micro' into maint
[platform/upstream/automake.git] / t / subobj5.sh
1 #! /bin/sh
2 # Copyright (C) 2001-2013 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 # Test of subdir make dist rules.
18 # From Robert Collins.
19
20 required=cc
21 . test-init.sh
22
23 cat >> configure.ac << 'END'
24 AC_CONFIG_FILES([generic/Makefile])
25 AC_PROG_CC
26 AC_OUTPUT
27 END
28
29 cat > Makefile.am << 'END'
30 AUTOMAKE_OPTIONS = subdir-objects
31 bin_PROGRAMS = wish
32 wish_SOURCES = generic/a.c
33
34 .PHONY: test-distdir test-build
35 test-distdir: distdir
36         ls -l $(distdir) $(distdir)/* ;: For debugging.
37         test ! -r $(distdir)/a.c
38         test -f $(distdir)/generic/a.c
39 test-build: all
40         ls -l . generic ;: For debugging.
41         test -f generic/a.$(OBJEXT)
42         test -f wish$(EXEEXT)
43         test ! -r a.$(OBJEXT)
44         test ! -r a$(EXEEXT)
45         test ! -r generic/wish$(EXEEXT)
46         test ! -r generic/a$(EXEEXT)
47 END
48
49 mkdir generic
50 : > generic/Makefile.am
51
52 cat > generic/a.c << 'END'
53 int main (void)
54 {
55   return 0;
56 }
57 END
58
59 $ACLOCAL
60 $AUTOCONF
61 $AUTOMAKE --include-deps --copy --add-missing
62
63 ./configure
64
65 $MAKE test-distdir
66 $MAKE dist
67 $MAKE test-build
68
69 :