Print this page
make: remove SCCS ident stuff
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/bin/make/common/depvar.cc
+++ new/usr/src/cmd/make/bin/make/common/depvar.cc
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 1995 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 -/*
26 - * @(#)depvar.cc 1.14 06/12/12
27 - */
28 -
29 -#pragma ident "@(#)depvar.cc 1.14 06/12/12"
30 25
31 26 /*
32 27 * Included files
33 28 */
34 29 #include <mk/defs.h>
35 30 #include <mksh/misc.h> /* getmem() */
36 31
37 32 /*
38 33 * This file deals with "Dependency Variables".
39 34 * The "-V var" command line option is used to indicate
40 35 * that var is a dependency variable. Used in conjunction with
41 36 * the -P option the user is asking if the named variables affect
42 37 * the dependencies of the given target.
43 38 */
44 39
45 40 struct _Depvar {
46 41 Name name; /* Name of variable */
47 42 struct _Depvar *next; /* Linked list */
48 43 Boolean cmdline; /* Macro defined on the cmdline? */
49 44 };
50 45
51 46 typedef struct _Depvar *Depvar;
52 47
53 48 static Depvar depvar_list;
54 49 static Depvar *bpatch = &depvar_list;
55 50 static Boolean variant_deps;
56 51
57 52 /*
58 53 * Add a name to the list.
59 54 */
60 55
61 56 void
62 57 depvar_add_to_list(Name name, Boolean cmdline)
63 58 {
64 59 Depvar dv;
65 60
66 61 #ifdef SUNOS4_AND_AFTER
67 62 dv = ALLOC(Depvar);
68 63 #else
69 64 dv = (Depvar) Malloc(sizeof(struct _Depvar));
70 65 #endif
71 66 dv->name = name;
72 67 dv->next = NULL;
73 68 dv->cmdline = cmdline;
74 69 *bpatch = dv;
75 70 bpatch = &dv->next;
76 71 }
77 72
78 73 /*
79 74 * The macro `name' has been used in either the left-hand or
80 75 * right-hand side of a dependency. See if it is in the
81 76 * list. Two things are looked for. Names given as args
82 77 * to the -V list are checked so as to set the same/differ
83 78 * output for the -P option. Names given as macro=value
84 79 * command-line args are checked and, if found, an NSE
85 80 * warning is produced.
86 81 */
87 82 void
88 83 depvar_dep_macro_used(Name name)
89 84 {
90 85 Depvar dv;
91 86
92 87 for (dv = depvar_list; dv != NULL; dv = dv->next) {
93 88 if (name == dv->name) {
94 89 #ifdef NSE
95 90 #ifdef SUNOS4_AND_AFTER
96 91 if (dv->cmdline) {
97 92 #else
98 93 if (is_true(dv->cmdline)) {
99 94 #endif
100 95 nse_dep_cmdmacro(dv->name->string);
101 96 }
102 97 #endif
103 98 variant_deps = true;
104 99 break;
105 100 }
106 101 }
107 102 }
108 103
109 104 #ifdef NSE
110 105 /*
111 106 * The macro `name' has been used in either the argument
112 107 * to a cd before a recursive make. See if it was
113 108 * defined on the command-line and, if so, complain.
114 109 */
115 110 void
116 111 depvar_rule_macro_used(Name name)
117 112 {
118 113 Depvar dv;
119 114
120 115 for (dv = depvar_list; dv != NULL; dv = dv->next) {
121 116 if (name == dv->name) {
122 117 #ifdef SUNOS4_AND_AFTER
123 118 if (dv->cmdline) {
124 119 #else
125 120 if (is_true(dv->cmdline)) {
126 121 #endif
127 122 nse_rule_cmdmacro(dv->name->string);
128 123 }
129 124 break;
130 125 }
131 126 }
132 127 }
133 128 #endif
134 129
135 130 /*
136 131 * Print the results. If any of the Dependency Variables
137 132 * affected the dependencies then the dependencies potentially
138 133 * differ because of these variables.
139 134 */
140 135 void
141 136 depvar_print_results(void)
142 137 {
143 138 if (variant_deps) {
144 139 printf(catgets(catd, 1, 234, "differ\n"));
145 140 } else {
146 141 printf(catgets(catd, 1, 235, "same\n"));
147 142 }
148 143 }
149 144
↓ open down ↓ |
110 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX