3 # Test - Build Type Inheritance.
7 # Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
9 # This file is part of kBuild.
11 # kBuild is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # kBuild is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with kBuild; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 include $(PATH_KBUILD
)/header.kmk
32 # Plain setup just for a reality check.
33 PROGRAMS
+= inherit-bld1
34 inherit-bld1_TEMPLATE
= TST
35 inherit-bld1_DEFS
= X
=y
36 inherit-bld1_SOURCES
= ..
/dummy_defined_X.c
38 # Test that the BLD_TYPE feature works.
39 PROGRAMS
+= inherit-bld2
40 inherit-bld2_TEMPLATE
= TST
41 inherit-bld2_BLD_TYPE
= debug
42 inherit-bld2_DEFS.debug
= X
=y
43 inherit-bld2_SOURCES
= ..
/dummy_defined_X.c
45 # Test that an simple alternative build type works.
46 PROGRAMS
+= inherit-bld3
47 inherit-bld3_TEMPLATE
= TST
48 inherit-bld3_BLD_TYPE
= dbgbld3
49 inherit-bld3_DEFS.dbgbld3
= X
=y
50 inherit-bld3_SOURCES
= ..
/dummy_defined_X.c
52 # Test that default build type inheritance works - dbgbld4 extends dbgbld3.
53 PROGRAMS
+= inherit-bld4
54 inherit-bld4_TEMPLATE
= TST
55 inherit-bld4_BLD_TYPE
= dbgbld4
56 inherit-bld4_DEFS.dbgbld3
= X
=y
57 inherit-bld4_SOURCES
= ..
/dummy_defined_X.c
59 # Test that appending build type inheritance works - dbgbld5 extends dbgbld3.
60 PROGRAMS
+= inherit-bld5
61 inherit-bld5_TEMPLATE
= TST
62 inherit-bld5_BLD_TYPE
= dbgbld5
63 inherit-bld5_DEFS.dbgbld3
= X
=y y
=0
64 inherit-bld5_DEFS.dbgbld5
= y
=42
65 inherit-bld5_SOURCES
= ..
/dummy_defined_X.c
67 # Test that prepending build type inheritance works - dbgbld6 extends dbgbld3.
68 PROGRAMS
+= inherit-bld6
69 inherit-bld6_TEMPLATE
= TST
70 inherit-bld6_BLD_TYPE
= dbgbld6
71 inherit-bld6_DEFS.dbgbld3
= X
=y y
=42
72 inherit-bld6_DEFS.dbgbld6
= y
=0
73 inherit-bld6_SOURCES
= ..
/dummy_defined_X.c
77 # Tests where we inherit from a target and force build type which
78 # relies on inheritance. These are the fine points...
80 PROGRAMS
+= inherit-bld10
81 inherit-bld10_TEMPLATE
= TST
82 inherit-bld10_BLD_TYPE
= dbgbld11
83 inherit-bld10_DEFS
= X
=y
84 inherit-bld10_DEFS.dbgbld10
= y
=42
85 inherit-bld10_SOURCES
= ..
/dummy_defined_X.c
87 # Tests that target and build inheriting works together.
88 PROGRAMS
+= inherit-bld11
89 inherit-bld11_EXTENDS
= inherit-bld10
91 # Tests that dbgbld11 is picked from the target rather than the parent.
92 PROGRAMS
+= inherit-bld12
93 inherit-bld12_EXTENDS
= inherit-bld10
94 inherit-bld12_DEFS
= y
=0
95 inherit-bld12_DEFS.dbgbld11
= X
=z z
=42
97 # Tests that prepending works.
98 PROGRAMS
+= inherit-bld20
99 inherit-bld20_TEMPLATE
= TST
100 inherit-bld20_BLD_TYPE
= dbgbld21
101 inherit-bld20_DEFS
= X
=y
102 inherit-bld20_DEFS.dbgbld20
= y
=42
103 inherit-bld20_DEFS.dbgbld21
= y
=0
104 #inherit-bld20_DEFS.dbgbld21 = y=0 y=42 <-- expected result.
105 inherit-bld20_SOURCES
= ..
/dummy_defined_X.c
107 # Tests that prepending + target inheritance works as expected. funky!
108 PROGRAMS
+= inherit-bld21
109 inherit-bld21_EXTENDS
= inherit-bld20
110 inherit-bld21_DEFS.dbgbld20
= Y
=y
111 #inherit-bld21_DEFS.dbgbld21 = y=0 y=42 Y=y <-- expected result; dbgbld21 from parent + our dbgbld20.
112 inherit-bld21_SOURCES
= ..
/dummy_defined_Y.c
115 include $(FILE_KBUILD_FOOTER
)