# $Id: testcase-kBuild-define.kmk 2549 2011-11-09 01:22:04Z bird $ ## @file # kBuild - testcase for the kBuild-define-* directives. # # # Copyright (c) 2011 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 3 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, see # # DEPTH = ../.. #include $(PATH_KBUILD)/header.kmk kBuild-define-target MyTarget _TEMPLATE = MyTemplate _SOURCES = MySourceFile.c kBuild-endef-target MyTarget $(if "$(MyTarget_TEMPLATE)" == "MyTemplate",,$(error MyTarget's _TEMPLATE wasn't set correctly in the global space)) $(if "$(MyTarget_SOURCES)" == "MySourceFile.c",,$(error MyTarget's _TEMPLATE wasn't set correctly in the global space)) INDIRECT_NAME = MyTarget$(strip $1) kBuild-define-target $(call INDIRECT_NAME, 2) local _TEMPLATE = MyTemplate2 _SOURCES = MySourceFile2.c kBuild-endef-target $(call INDIRECT_NAME, 2) $(if "$(_TEMPLATE)" == "",,$(error _TEMPLATE has leaked out into the global space)) all_recursive: #$(ECHO) "kBuild-define-xxxx works fine"