summaryrefslogtreecommitdiffstats
path: root/tests/inherit-bld/Makefile.kmk
blob: 919f5c2073930b0f937c8ca637212c30c8c062d7 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# $Id: Makefile.kmk 2413 2010-09-11 17:43:04Z bird $
## @file
# Test - Build Type Inheritance.
#

#
# Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
#
# This file is part of kBuild.
#
# kBuild 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 of the License, or
# (at your option) any later version.
#
# kBuild 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 kBuild; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#
#


DEPTH = ../..
include $(PATH_KBUILD)/header.kmk


# Plain setup just for a reality check.
PROGRAMS += inherit-bld1
inherit-bld1_TEMPLATE = TST
inherit-bld1_DEFS = X=y
inherit-bld1_SOURCES = ../dummy_defined_X.c

# Test that the BLD_TYPE feature works.
PROGRAMS += inherit-bld2
inherit-bld2_TEMPLATE = TST
inherit-bld2_BLD_TYPE = debug
inherit-bld2_DEFS.debug = X=y
inherit-bld2_SOURCES = ../dummy_defined_X.c

# Test that an simple alternative build type works.
PROGRAMS += inherit-bld3
inherit-bld3_TEMPLATE = TST
inherit-bld3_BLD_TYPE = dbgbld3
inherit-bld3_DEFS.dbgbld3 = X=y
inherit-bld3_SOURCES = ../dummy_defined_X.c

# Test that default build type inheritance works - dbgbld4 extends dbgbld3.
PROGRAMS += inherit-bld4
inherit-bld4_TEMPLATE = TST
inherit-bld4_BLD_TYPE = dbgbld4
inherit-bld4_DEFS.dbgbld3 = X=y
inherit-bld4_SOURCES = ../dummy_defined_X.c

# Test that appending build type inheritance works - dbgbld5 extends dbgbld3.
PROGRAMS += inherit-bld5
inherit-bld5_TEMPLATE = TST
inherit-bld5_BLD_TYPE = dbgbld5
inherit-bld5_DEFS.dbgbld3 = X=y y=0
inherit-bld5_DEFS.dbgbld5 = y=42
inherit-bld5_SOURCES = ../dummy_defined_X.c

# Test that prepending build type inheritance works - dbgbld6 extends dbgbld3.
PROGRAMS += inherit-bld6
inherit-bld6_TEMPLATE = TST
inherit-bld6_BLD_TYPE = dbgbld6
inherit-bld6_DEFS.dbgbld3 = X=y y=42
inherit-bld6_DEFS.dbgbld6 = y=0
inherit-bld6_SOURCES = ../dummy_defined_X.c


#
# Tests where we inherit from a target and force build type which
# relies on inheritance. These are the fine points...
#
PROGRAMS += inherit-bld10
inherit-bld10_TEMPLATE = TST
inherit-bld10_BLD_TYPE = dbgbld11
inherit-bld10_DEFS = X=y
inherit-bld10_DEFS.dbgbld10 = y=42
inherit-bld10_SOURCES = ../dummy_defined_X.c

# Tests that target and build inheriting works together.
PROGRAMS += inherit-bld11
inherit-bld11_EXTENDS = inherit-bld10

# Tests that dbgbld11 is picked from the target rather than the parent.
PROGRAMS += inherit-bld12
inherit-bld12_EXTENDS = inherit-bld10
inherit-bld12_DEFS = y=0
inherit-bld12_DEFS.dbgbld11 = X=z z=42

# Tests that prepending works.
PROGRAMS += inherit-bld20
inherit-bld20_TEMPLATE = TST
inherit-bld20_BLD_TYPE = dbgbld21
inherit-bld20_DEFS = X=y
inherit-bld20_DEFS.dbgbld20 = y=42
inherit-bld20_DEFS.dbgbld21 = y=0
#inherit-bld20_DEFS.dbgbld21 = y=0 y=42 <-- expected result.
inherit-bld20_SOURCES = ../dummy_defined_X.c

# Tests that prepending + target inheritance works as expected. funky!
PROGRAMS += inherit-bld21
inherit-bld21_EXTENDS = inherit-bld20
inherit-bld21_DEFS.dbgbld20 = Y=y
#inherit-bld21_DEFS.dbgbld21 = y=0 y=42 Y=y <-- expected result; dbgbld21 from parent + our dbgbld20.
inherit-bld21_SOURCES = ../dummy_defined_Y.c


include $(FILE_KBUILD_FOOTER)