summaryrefslogtreecommitdiff
path: root/src/kmk/testcase-kBuild-define.kmk
blob: 970be895ec1b7b412b65a5ca96c65d0ac2e5364f (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
# $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 <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 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 <http://www.gnu.org/licenses/>
#
#

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"