| 1 | # $Id: Makefile.kmk 2413 2010-09-11 17:43:04Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | # Test - Build Type Inheritance.
|
|---|
| 4 | #
|
|---|
| 5 |
|
|---|
| 6 | #
|
|---|
| 7 | # Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
|
|---|
| 8 | #
|
|---|
| 9 | # This file is part of kBuild.
|
|---|
| 10 | #
|
|---|
| 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.
|
|---|
| 15 | #
|
|---|
| 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.
|
|---|
| 20 | #
|
|---|
| 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
|
|---|
| 24 | #
|
|---|
| 25 | #
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | DEPTH = ../..
|
|---|
| 29 | include $(PATH_KBUILD)/header.kmk
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 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
|
|---|
| 37 |
|
|---|
| 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
|
|---|
| 44 |
|
|---|
| 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
|
|---|
| 51 |
|
|---|
| 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
|
|---|
| 58 |
|
|---|
| 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
|
|---|
| 66 |
|
|---|
| 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
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | #
|
|---|
| 77 | # Tests where we inherit from a target and force build type which
|
|---|
| 78 | # relies on inheritance. These are the fine points...
|
|---|
| 79 | #
|
|---|
| 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
|
|---|
| 86 |
|
|---|
| 87 | # Tests that target and build inheriting works together.
|
|---|
| 88 | PROGRAMS += inherit-bld11
|
|---|
| 89 | inherit-bld11_EXTENDS = inherit-bld10
|
|---|
| 90 |
|
|---|
| 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
|
|---|
| 96 |
|
|---|
| 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
|
|---|
| 106 |
|
|---|
| 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
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 | include $(FILE_KBUILD_FOOTER)
|
|---|
| 116 |
|
|---|