VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/variables/must_make@ 2634

Last change on this file since 2634 was 2413, checked in by bird, 14 years ago

copyright year update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1# $Id: must_make 2413 2010-09-11 17:43:04Z bird $ -*-perl-*-
2## @file
3# .MUST_MAKE target variable.
4#
5
6#
7# Copyright (c) 2008-2010 knut st. osmundsen <[email protected]>
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 3 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, see <http://www.gnu.org/licenses/>
23#
24#
25
26$description = "Tests the .MUST_MAKE target variable";
27
28$details = "The .MUST_MAKE target variable is expanded when make is deciding
29whether a file needs to be made or not. If it returns a non-empty string,
30when stripped, it will force the file to be made. If it returns an empty
31string GNU make decides the normal way. Note that .MUST_MAKE does NOT have
32to be expanded if make already knows the file needs building. Also, note
33that for multi target rules it may be invoked for each file.";
34
35if ($is_kmk) {
36
37 # TEST #0 - check to see that it gets called and is made.
38 # -------------------------------------------------------
39 &touch('foobar.1');
40 run_make_test('
41
42foobar.1: .MUST_MAKE = $(info mustmake:{@=$@,<=$<})FORCE
43foobar.1: ;touch $@
44',
45'',
46'mustmake:{@=foobar.1,<=}
47touch foobar.1'
48);
49 unlink('foobar.1');
50
51 # TEST #1 - check to see that it gets called and isn't made.
52 # ----------------------------------------------------------
53 &touch('foobar.1');
54 run_make_test('
55
56foobar.1: .MUST_MAKE = $(info mustmake:{@=$@,<=$<})
57foobar.1: ;touch $@
58',
59'',
60'mustmake:{@=foobar.1,<=}
61#MAKE#: `foobar.1\' is up to date.'
62);
63 unlink('foobar.1');
64
65 # TEST #2 - check to see that it doesn't get called unnecessary.
66 # --------------------------------------------------------------
67 run_make_test('
68foobar.1: .MUST_MAKE = $(info mustmake:{@=$@,<=$})FORCE
69foobar.1: ;@echo making $@
70',
71'',
72'making foobar.1');
73
74}
75
76
77
78# Indicate that we're done.
791;
80
81
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette