summaryrefslogtreecommitdiff
path: root/t/local-targets.sh
blob: 28f01888d9240b2b2a312e7e3901e5c27833b320 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/sh
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# The 'all-local', 'check-local' and 'installdirs-local' targets can
# also be defined by included or wrapper Makefiles that Automake never
# sees, as well as through GNU make constructs that Automake does not
# parse.

. test-init.sh

cat >> configure.ac << 'END'
AC_SUBST([SafeInclude], [include])
AC_OUTPUT
END

cat > Makefile.am <<'END'
@SafeInclude@ ./inc.mk
$(foreach x,all check installdirs,$(eval $(x)-local: ; : > main-$(x)))
END

cat > inc.mk << 'END'
all-local check-local installdirs-local: %-local: %-incl
all-incl check-incl installdirs-incl: %-incl:
	: > incl-$*
END

cat > GNUmakefile << 'END'
include ./Makefile
all-local check-local installdirs-local: %-local: %-wrap
all-wrap check-wrap installdirs-wrap: %-wrap:
	: > wrap-$*
END

$ACLOCAL
$AUTOCONF
$AUTOMAKE

./configure

$MAKE check installdirs
test -f wrap-all
test -f wrap-check
test -f wrap-installdirs
test -f incl-all
test -f incl-check
test -f incl-installdirs
test -f main-all
test -f main-check
test -f main-installdirs

: