[1694] | 1 | # $Id: testcase-includedep.kmk 2413 2010-09-11 17:43:04Z bird $
|
---|
| 2 | ## @file
|
---|
| 3 | # kBuild - testcase for the includedep directive.
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | #
|
---|
[2413] | 7 | # Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
|
---|
[1694] | 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
|
---|
[2019] | 13 | # the Free Software Foundation; either version 3 of the License, or
|
---|
[1694] | 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
|
---|
[2019] | 22 | # along with kBuild. If not, see <http://www.gnu.org/licenses/>
|
---|
[1694] | 23 | #
|
---|
| 24 | #
|
---|
| 25 |
|
---|
| 26 | DEPTH = ../..
|
---|
| 27 | include $(PATH_KBUILD)/header.kmk
|
---|
| 28 |
|
---|
| 29 | ifdef testcase-includedep-sub.kmk
|
---|
| 30 | $(error testcase-includedep-sub.kmk is defined at the start of the testcase.)
|
---|
| 31 | endif
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | foo = testcase-includedep-sub
|
---|
| 35 | includedep $(foo).kmk
|
---|
| 36 | ifneq ($(testcase-includedep-sub.kmk),included)
|
---|
| 37 | $(error The first test failed.)
|
---|
| 38 | endif
|
---|
| 39 | testcase-includedep-sub.kmk :=
|
---|
| 40 | ifdef testcase-includedep-sub.kmk
|
---|
| 41 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.)
|
---|
| 42 | endif
|
---|
| 43 |
|
---|
| 44 |
|
---|
| 45 | foo = includedep
|
---|
| 46 | includedep testcase-$(foo)-sub.kmk
|
---|
| 47 | ifneq ($(testcase-includedep-sub.kmk),included)
|
---|
| 48 | $(error The second test failed.)
|
---|
| 49 | endif
|
---|
| 50 | testcase-includedep-sub.kmk :=
|
---|
| 51 | ifdef testcase-includedep-sub.kmk
|
---|
| 52 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.)
|
---|
| 53 | endif
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | foo = kmk
|
---|
| 57 | includedep testcase-includedep-sub.$(foo)
|
---|
| 58 | ifneq ($(testcase-includedep-sub.kmk),included)
|
---|
| 59 | $(error The thrid test failed.)
|
---|
| 60 | endif
|
---|
| 61 | testcase-includedep-sub.kmk :=
|
---|
| 62 | ifdef testcase-includedep-sub.kmk
|
---|
| 63 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.)
|
---|
| 64 | endif
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | includedep testcase-includedep-sub.kmk
|
---|
| 68 | ifneq ($(testcase-includedep-sub.kmk),included)
|
---|
| 69 | $(error The forth test failed.)
|
---|
| 70 | endif
|
---|
| 71 | testcase-includedep-sub.kmk :=
|
---|
| 72 | ifdef testcase-includedep-sub.kmk
|
---|
| 73 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.)
|
---|
| 74 | endif
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 | foo = asdf
|
---|
| 78 | includedep testcase-$(foo)-sub.kmk
|
---|
| 79 | ifeq ($(testcase-includedep-sub.kmk),included)
|
---|
| 80 | $(error The fifth test failed.)
|
---|
| 81 | endif
|
---|
| 82 | testcase-includedep-sub.kmk :=
|
---|
| 83 | ifdef testcase-includedep-sub.kmk
|
---|
| 84 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.)
|
---|
| 85 | endif
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | all_recursive:
|
---|
| 89 | $(ECHO) "includedep works fine"
|
---|
| 90 |
|
---|