# $Id: Makefile.kmk 2413 2010-09-11 17:43:04Z bird $ ## @file # Test - Build Type Inheritance. # # # Copyright (c) 2008-2010 knut st. osmundsen # # 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)