| 1 | # $Id: testcase-includedep.kmk 1694 2008-08-31 19:48:24Z bird $ | 
|---|
| 2 | ## @file | 
|---|
| 3 | # kBuild - testcase for the includedep directive. | 
|---|
| 4 | # | 
|---|
| 5 |  | 
|---|
| 6 | # | 
|---|
| 7 | # Copyright (c) 2008 knut st. osmundsen <bird-src-spam@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 | DEPTH = ../.. | 
|---|
| 28 | include $(PATH_KBUILD)/header.kmk | 
|---|
| 29 |  | 
|---|
| 30 | ifdef testcase-includedep-sub.kmk | 
|---|
| 31 | $(error testcase-includedep-sub.kmk is defined at the start of the testcase.) | 
|---|
| 32 | endif | 
|---|
| 33 |  | 
|---|
| 34 |  | 
|---|
| 35 | foo = testcase-includedep-sub | 
|---|
| 36 | includedep $(foo).kmk | 
|---|
| 37 | ifneq ($(testcase-includedep-sub.kmk),included) | 
|---|
| 38 | $(error The first test failed.) | 
|---|
| 39 | endif | 
|---|
| 40 | testcase-includedep-sub.kmk := | 
|---|
| 41 | ifdef testcase-includedep-sub.kmk | 
|---|
| 42 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.) | 
|---|
| 43 | endif | 
|---|
| 44 |  | 
|---|
| 45 |  | 
|---|
| 46 | foo = includedep | 
|---|
| 47 | includedep testcase-$(foo)-sub.kmk | 
|---|
| 48 | ifneq ($(testcase-includedep-sub.kmk),included) | 
|---|
| 49 | $(error The second test failed.) | 
|---|
| 50 | endif | 
|---|
| 51 | testcase-includedep-sub.kmk := | 
|---|
| 52 | ifdef testcase-includedep-sub.kmk | 
|---|
| 53 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.) | 
|---|
| 54 | endif | 
|---|
| 55 |  | 
|---|
| 56 |  | 
|---|
| 57 | foo = kmk | 
|---|
| 58 | includedep testcase-includedep-sub.$(foo) | 
|---|
| 59 | ifneq ($(testcase-includedep-sub.kmk),included) | 
|---|
| 60 | $(error The thrid test failed.) | 
|---|
| 61 | endif | 
|---|
| 62 | testcase-includedep-sub.kmk := | 
|---|
| 63 | ifdef testcase-includedep-sub.kmk | 
|---|
| 64 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.) | 
|---|
| 65 | endif | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|
| 68 | includedep testcase-includedep-sub.kmk | 
|---|
| 69 | ifneq ($(testcase-includedep-sub.kmk),included) | 
|---|
| 70 | $(error The forth test failed.) | 
|---|
| 71 | endif | 
|---|
| 72 | testcase-includedep-sub.kmk := | 
|---|
| 73 | ifdef testcase-includedep-sub.kmk | 
|---|
| 74 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.) | 
|---|
| 75 | endif | 
|---|
| 76 |  | 
|---|
| 77 |  | 
|---|
| 78 | foo = asdf | 
|---|
| 79 | includedep testcase-$(foo)-sub.kmk | 
|---|
| 80 | ifeq ($(testcase-includedep-sub.kmk),included) | 
|---|
| 81 | $(error The fifth test failed.) | 
|---|
| 82 | endif | 
|---|
| 83 | testcase-includedep-sub.kmk := | 
|---|
| 84 | ifdef testcase-includedep-sub.kmk | 
|---|
| 85 | $(error testcase-includedep-sub.kmk is persistent and does not want to be undefed.) | 
|---|
| 86 | endif | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 | all_recursive: | 
|---|
| 90 | $(ECHO) "includedep works fine" | 
|---|
| 91 |  | 
|---|