Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4u/Makefile
+++ new/usr/src/uts/sun4u/Makefile
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.
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 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 25 # This makefile drives the production of all implementation architecture
26 26 # dependent modules for the sun4u architecture.
27 27 #
28 28
29 29 UTSBASE = ..
30 30
31 31 include Makefile.sun4u
32 32
33 33 #
34 34 # The following are SPARC specific (rather than sun4u) specific modules
35 35 # which are required for the sun4u kernel to completely lint. They are
36 36 # not involved in the build in any other way. In order to minimize
37 37 # build time, it is assumed that they are up to date. But since sun4u
38 38 # is really a separate architecture we cannot use the v7 sparc modules.
39 39 #
40 40 SPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
41 41
42 42 SPARC_LINTS =
43 43
44 44 #
45 45 #
46 46 #
47 47 LINT_LIBS = $(LINT_LIB) \
48 48 $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
49 49 $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
50 50 $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln)
51 51
52 52
53 53 def := TARGET= def
54 54 def.prereq := TARGET= def
55 55 all := TARGET= all
56 56 all.prereq := TARGET= all
57 57 install := TARGET= install
58 58 install.prereq := TARGET= all
59 59 install_h := TARGET= install_h
60 60 install_h.prere := TARGET= install_h
61 61 clean := TARGET= clean
62 62 clobber := TARGET= clobber
63 63 lint := TARGET= lint
64 64 lint.prereq := TARGET= lint
65 65 lintlib := TARGET= lintlib
66 66 modlintlib := TARGET= modlintlib
67 67 modlist := TARGET= modlist
68 68 modlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$
69 69 clean.lint := TARGET= clean.lint
70 70 check := TARGET= check
71 71
72 72 .KEEP_STATE:
73 73
74 74 .PARALLEL: $(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
75 75 $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \
76 76 modlist modlist.sparc
77 77
78 78 # Override for CPU_KMODS... they cannot be built
79 79 # in parallel
80 80 .NO_PARALLEL: $(CPU_KMODS)
81 81
82 82 def all clean clobber clean.lint: genassym unix .WAIT \
83 83 $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
84 84 $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
85 85
86 86 # list the modules under sun4u.
87 87 modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
88 88 $(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS)
89 89
90 90 # list the modules for Install -k sun4u.
91 91 modlist.karch: modlist modlist.sparc
92 92
93 93 modlist.sparc:
94 94 @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist
95 95
96 96 install: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \
97 97 $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
98 98
99 99 lintlib: unix
100 100
101 101 modlintlib: $(LINT_KMODS) $(CLOSED_LINT_KMODS)
102 102
103 103 genassym unix $(KMODS): FRC
104 104 @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
105 105
↓ open down ↓ |
105 lines elided |
↑ open up ↑ |
106 106 #
107 107 # Privilege constants
108 108 #
109 109 # NOTE: The rules for generating priv_const.c file are shared between all
110 110 # processor architectures and should be kept in sync. If they are changed in
111 111 # this file make sure that x86 rules are updated as well.
112 112 #
113 113 PRIVS_C = $(UTSBASE)/common/os/priv_const.c
114 114
115 115 $(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
116 - $(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
116 + $(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
117 117
118 118
119 119 #
120 120 # Prerequisites
121 121 #
122 122 # The uts/Makefile defines build parallelism for sun4 platforms such that sparc,
123 123 # sun4u and sun4v are all built in parallel. Also this Makefile specifies that
124 124 # all IMPLEMENTATIONS sun4u sub-platforms are built in parallel. This requires
125 125 # building certain parts before the parallel build can start. The uts/Makefile
126 126 # appends the '.prereq' string to the original target and executes this Makefile
127 127 # to build any prerequisites needed before the full parallel build can start.
128 128 # After that make continues with normal targets.
129 129 #
130 130 # Any build prerequisites for sun4 and IMPLEMENTATIONS builds should be
131 131 # described here.
132 132 #
133 133 # genassym is used to build dtrace and genunix, so it should be built first.
134 134 #
135 135 # priv_const.c is required to build genunix.
136 136 #
137 137 # genunix is used by everyone to ctfmerge with. Genunix is merged with sparc/ip
138 138 # so as a side effect this dependency builds sparc/ip as part of the
139 139 # prerequisites.
140 140 #
141 141 # unix is not required by itself but several sun4u platforms require
142 142 # sun4u/platmod to be present. The easiest way to achieve this is to build
143 143 # sun4u/unix first since sun4u/unix Makefile builds sun4u/platform correctly.
144 144 # This causes full sun4u/unix to be built before all sun4u platforms and
145 145 # before uts/sun4v and uts/sparc, but it acceptable since it is not spending
146 146 # too much time building sun4u/unix.
147 147 #
148 148 all.prereq def.prereq install.prereq: genassym genunix unix
149 149
150 150 #
151 151 # Various sun4u platforms expect proto/root_sparc/platform/sun4u/include to be
152 152 # present. This is handled by running make install_h in sun4u/unix directory
153 153 # first.
154 154 #
155 155 install_h.prereq: FRC
156 156 @cd sys; pwd; $(MAKE) $(TARGET)
157 157
158 158 #
159 159 # sun4u/unix and sun4u/genunix should be linted first since sparc does global
160 160 # cross-check with these lint libraries. The sun4u/unix and sun4u/genunix can be
161 161 # linted in parallel.
162 162 #
163 163 LINT_PREREQ = unix.lint genunix.lint
164 164 lint.prereq: $(LINT_PREREQ)
165 165
166 166 .PARALLEL: $(LINT_PREREQ)
167 167
168 168 $(LINT_PREREQ):
169 169 @cd $(@:%.lint=%); pwd; $(MAKE) $(TARGET)
170 170
171 171 #
172 172 # Nothing to do with any other prerequisites
173 173 #
174 174 %.prereq:
175 175
176 176 #
177 177 # Platform inter-dependencies
178 178 #
179 179 lw8: serengeti
180 180
181 181 quasar: darwin
182 182
183 183 #
184 184 # The genunix requires priv_const.c file to be generated first.
185 185 #
186 186 genunix: $(PRIVS_C)
187 187
188 188 #
189 189 # Rules
190 190 #
191 191
192 192 $(IMPLEMENTATIONS): FRC
193 193 @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET)
194 194
195 195 $(CLOSED_IMPLEMENTATIONS): FRC
196 196 cd $(CLOSED)/uts/sun4u/$@; pwd; \
197 197 THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET); \
198 198
199 199 $(XMODS): FRC
200 200 @if [ -f $@/Makefile ]; then \
201 201 cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
202 202 else \
203 203 true; \
204 204 fi
205 205
206 206 $(CLOSED_XMODS): FRC
207 207 @if [ -f $(CLOSED)/uts/sun4u/$@/Makefile ]; then \
208 208 cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
209 209 else \
210 210 true; \
211 211 fi
212 212
213 213 $(CLOSED_KMODS): FRC
214 214 cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
215 215
216 216 install_h check: install_platforms $(IMPLEMENTATIONS) \
217 217 $(CLOSED_IMPLEMENTATIONS) FRC
218 218 @cd sys; pwd; $(MAKE) $(TARGET)
219 219 @cd vm; pwd; $(MAKE) $(TARGET)
220 220
221 221 #
222 222 # Rules for the /platforms directories. This is hardwired here because
223 223 # the first stage of the project (KBI) only implements the userland
224 224 # changes, but the only reasonable place to record the aliases is
225 225 # here in kernel land.
226 226 #
227 227 $(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR)
228 228 -$(INS.dir)
229 229
230 230 #
231 231 # create directories in /usr/platform/ for the implementations that are
232 232 # defined in $(IMPLEMENTED_PLATFORM)
233 233 # (eg. SUNW,Ultra-1)
234 234 #
235 235 # Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
236 236 # that are linked to it.
237 237 #
238 238 $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR)
239 239 -$(INS.dir)
240 240
241 241 #
242 242 # create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
243 243 # to it's corresponding $(IMPLEMENTED_PLATFORM).
244 244 #
245 245 PLATFORMS = $(LINKED_PLATFORMS)
246 246
247 247 $(USR_PLAT_DIRS): $(USR_PLAT_DIR)
248 248 $(INS.slink3)
249 249
250 250 PLATFORMS += $(IMPLEMENTED_PLATFORM)
251 251
252 252 #
253 253 # Make the /platforms directories. This is hardwired here because
254 254 # the first stage of the project (KBI) only implements the userland
255 255 # changes, but the only reasonable place to record the aliases is
256 256 # here in kernel land.
257 257 #
258 258 install_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \
259 259 $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \
260 260 $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
261 261 $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
262 262
263 263 #
264 264 # rules for making include, sbin, lib dirs/links in
265 265 # /usr/platform/$(PLATFORM)/ for desktop platforms
266 266 #
267 267 $(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR)
268 268 $(INS.slink4)
269 269
270 270 $(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR)
271 271 $(INS.slink5)
272 272
273 273 $(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR)
274 274 -$(INS.dir)
275 275
276 276 #
277 277 # Full kernel lint target.
278 278 #
279 279 LINT_TARGET = globallint
280 280
281 281 globallint:
282 282 @pwd
283 283 @-$(ECHO) "\nSUN4U KERNEL: global crosschecks:"
284 284 @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
285 285
286 286 lint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
287 287 $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS)
288 288
289 289 # EXPORT DELETE START
290 290
291 291 EXPORT_SRC:
292 292 $(RM) Makefile+
293 293 sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
294 294 < Makefile > Makefile+
295 295 $(MV) Makefile+ Makefile
296 296 $(CHMOD) 444 Makefile
297 297
298 298 # EXPORT DELETE END
299 299
300 300 include ../Makefile.targ
301 301
302 302 #
303 303 # Cross-reference customization: build a cross-reference over all of the
304 304 # sun4u-related directories.
305 305 #
306 306 SHARED_XRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common
307 307 CLOSED_XRDIRS = $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
308 308 XRDIRS = $(SHARED_XRDIRS)
309 309 $(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=)
310 310
311 311 XRPRUNE = i86pc
312 312
313 313 cscope.out tags: FRC
314 314 $(XREF) -x $@
↓ open down ↓ |
188 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX