Print this page
cw: give cw(1onbld) a new interface allowing for multiple arbitrary shadows
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/Makefile
+++ new/usr/src/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 #
23 23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 25 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
26 26 # Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
27 27 # Copyright 2016 Toomas Soome <tsoome@me.com>
28 28 # Copyright 2017 Joyent, Inc.
29 29 #
30 30
31 31 #
32 32 # Makefile for system source
33 33 #
34 34 # include global definitions
35 35 include Makefile.master
36 36 #
37 37 # the Targetdirs file is the AT&T target.dirs file in a makefile format.
38 38 # it defines TARGETDIRS and ROOTDIRS.
39 39 include Targetdirs
40 40
41 41 COMMON_SUBDIRS= data uts lib cmd ucblib ucbcmd psm man test
42 42 sparc_SUBDIRS= stand
43 43 i386_SUBDIRS= grub boot
44 44
45 45 #
46 46 # sparc needs to build stand before psm
47 47 #
48 48 $(SPARC_BLD)psm: stand
49 49
50 50 SUBDIRS= $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
51 51
52 52 HDRSUBDIRS= uts head lib cmd
53 53
54 54 # UCB headers are bug-for-bug compatible and not checkable against the header
55 55 # standards.
56 56 #
57 57 CHKHDRSUBDIRS= head uts lib
58 58
59 59 #
60 60 # Headers that can be built in parallel
61 61 #
62 62 PARALLEL_HEADERS = sysheaders userheaders libheaders cmdheaders
63 63
64 64 #
65 65 # Directories that can be built in parallel
66 66 #
67 67 PARALLEL_DIRS = data uts lib man
68 68
69 69 # The check target also causes smf(5) service manifests to be validated.
70 70 CHKMFSTSUBDIRS= cmd
71 71
72 72 # And man page formats
73 73 CHKMANSUBDIRS = man
74 74
75 75 MSGSUBDIRS= cmd ucbcmd lib data
76 76 DOMAINS= \
77 77 SUNW_OST_ADMIN \
78 78 SUNW_OST_NETRPC \
79 79 SUNW_OST_OSCMD \
80 80 SUNW_OST_OSLIB \
81 81 SUNW_OST_UCBCMD \
82 82 SUNW_OST_ZONEINFO
83 83
84 84 MSGDDIRS= $(DOMAINS:%=$(MSGROOT)/%)
85 85 MSGDIRS= $(MSGROOT) $(MSGDDIRS) $(MSGROOT)/LC_TIME
86 86
87 87 all := TARGET= all
88 88 install := TARGET= install
89 89 install1 := TARGET= install
90 90 install2 := TARGET= install
91 91 install_h := TARGET= install_h
92 92 clean := TARGET= clean
93 93 clobber := TARGET= clobber
94 94 check := TARGET= check
95 95
96 96 .KEEP_STATE:
97 97
98 98 #
99 99 # Note: install does not cause a build in pkg. To build packages,
100 100 # cd pkg and do a 'make install'
101 101 #
102 102
103 103 all: mapfiles closedbins sgs .WAIT $(SUBDIRS) pkg
104 104
105 105 #
106 106 # The _msg build is a two-step process. First, the _msg dependency
107 107 # causes recursive makes in $(MSGSUBDIRS), which stages raw message
108 108 # files in $(ROOT)/catalog. Second, the action from the install
109 109 # target rule causes those messages to be post-processed from where
110 110 # they were staged in $(ROOT)/catalog, and the results placed into the
111 111 # proto area.
112 112 #
113 113 # The stage-licenses target causes the license files needed for
114 114 # packaging to be pulled from $(SRC) and $(CLOSED) and staged in
115 115 # $(ROOT)/licenses.
116 116 #
117 117 install: install1 install2 _msg stage-licenses
118 118 @cd msg; pwd; $(MAKE) _msg
119 119 @rm -rf "$(ROOT)/catalog"
120 120
121 121 stage-licenses: install2
122 122 @cd pkg; pwd; $(MAKE) stage-licenses
123 123
124 124 install1: mapfiles closedbins sgs
125 125
126 126 install2: install1 .WAIT $(SUBDIRS)
127 127
128 128 _msg: _msgdirs rootdirs FRC
129 129 @for m in $(MSGSUBDIRS); do \
130 130 cd $$m; pwd; $(MAKE) _msg; cd ..; \
131 131 done
132 132
133 133 mapfiles: bldtools
134 134 @cd common/mapfiles; pwd; $(MAKE) install
135 135
136 136 clean: $(SUBDIRS) head pkg
137 137 clobber: $(SUBDIRS) head pkg clobber_local
138 138 clobber_local:
139 139 @cd tools; pwd; $(MAKE) clobber
140 140 @cd common/mapfiles; pwd; $(MAKE) clobber
141 141 @cd msg; pwd; $(MAKE) clobber
142 142
143 143 # If the tarballs are included inside ON_CLOSED_BINS, use those to extract and
144 144 # preserve the permissions (in case a distro ships them).
145 145
146 146 closedbins: bldtools $(ROOTDIRS) FRC
147 147 @CLOSED_ROOT="$$ON_CLOSED_BINS/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
148 148 if [ -f "$$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2" ]; then \
149 149 $(ECHO) "Extracting tarball $$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2"; \
150 150 (cd $(CODEMGR_WS); \
151 151 $(TAR) xjpf $$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2); \
152 152 CLOSED_ROOT="$(CODEMGR_WS)/closed/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
153 153 fi; \
154 154 if [ ! -d "$$CLOSED_ROOT" ]; then \
155 155 $(ECHO) "Error: ON_CLOSED_BINS must point to closed" \
156 156 "binaries."; \
157 157 $(ECHO) "root_$(MACH)$${RELEASE_BUILD+-nd} is not" \
158 158 "present in $$ON_CLOSED_BINS."; \
159 159 exit 1; \
160 160 fi; \
161 161 $(ECHO) "Copying closed binaries from $$CLOSED_ROOT"; \
162 162 (cd $$CLOSED_ROOT; \
163 163 $(TAR) cfX - $(CODEMGR_WS)/exception_lists/closed-bins .) | \
164 164 (cd $(ROOT); $(TAR) xBpf -); \
165 165 ( cd $(ROOT); $(CTFSTRIP) $$(cd $$CLOSED_ROOT; $(FIND) \
166 166 ./kernel ./usr/kernel ./platform/*/kernel -type f -a -perm -u+x | \
167 167 $(EGREP) -vf $(CODEMGR_WS)/exception_lists/closed-bins) )
168 168
169 169 #
170 170 # Declare what parts can be built in parallel
171 171 # DUMMY at the end is used in case macro expansion produces an empty string to
172 172 # prevent everything going in parallel
173 173 #
174 174 .PARALLEL: $(PARALLEL_HEADERS) DUMMY
175 175 .PARALLEL: $(PARALLEL_DIRS) DUMMY
176 176
177 177 $(SUBDIRS) head pkg: FRC
178 178 @cd $@; pwd; $(MAKE) $(TARGET)
179 179
180 180 # librpcsvc has a dependency on headers installed by
181 181 # userheaders, hence the .WAIT before libheaders.
182 182 sgs: rootdirs .WAIT sysheaders userheaders .WAIT \
183 183 libheaders cmdheaders
184 184
185 185 #
186 186 # Top-level setup target to setup the development environment that includes
187 187 # headers, tools and generated mapfiles. For open-only builds (i.e.: source
188 188 # trees w/o usr/closed), this also depends on the closedbins target (above)
189 189 # in order to properly seed the proto area. Note, although the tools are
190 190 # dependent on a number of constant mapfiles, the tools themselves are
191 191 # required to build the generated mapfiles.
192 192 #
193 193 setup: closedbins bldtools sgs mapfiles
194 194
195 195 bldtools:
196 196 @cd tools; pwd; $(MAKE) install
197 197
198 198 # /var/mail/:saved is a special case because of the colon in the name.
199 199 #
200 200 rootdirs: $(ROOTDIRS)
201 201 $(INS) -d -m 775 $(ROOT)/var/mail/:saved
202 202
203 203 lint: FRC
204 204 $(MAKE) -f Makefile.lint
205 205
206 206 _msgdirs: $(MSGDIRS)
207 207
208 208 $(ROOTDIRS) $(MSGDIRS):
209 209 $(INS.dir)
210 210
211 211 userheaders: FRC
212 212 @cd head; pwd; $(MAKE) install_h
213 213
214 214 libheaders: bldtools
215 215 @cd lib; pwd; $(MAKE) install_h
216 216
217 217 sysheaders: FRC
218 218 @cd uts; pwd; $(MAKE) install_h
219 219
220 220 cmdheaders: FRC
221 221 @cd cmd/devfsadm; pwd; $(MAKE) install_h
222 222 @cd cmd/fm; pwd; $(MAKE) install_h
223 223 @cd cmd/mdb; pwd; $(MAKE) install_h
224 224
225 225 check: $(CHKHDRSUBDIRS) $(CHKMFSTSUBDIRS) $(CHKMANSUBDIRS)
226 226
227 227 #
228 228 # Cross-reference customization: skip all of the subdirectories that
229 229 # don't contain actual source code.
230 230 #
231 231 XRPRUNE = pkg prototypes
232 232 XRINCDIRS = uts/common head ucbhead
233 233
↓ open down ↓ |
233 lines elided |
↑ open up ↑ |
234 234 cscope.out tags: FRC
235 235 $(XREF) -f -x $@
236 236
237 237 FRC:
238 238
239 239 #
240 240 # Targets for reporting compiler versions; nightly uses these.
241 241 #
242 242
243 243 cc-version:
244 - @if $($(MACH)_CC) -_versions >/dev/null 2>/dev/null; then \
245 - $(ECHO) 32-bit compiler; \
246 - $(ECHO) $($(MACH)_CC); \
247 - $($(MACH)_CC) -_versions 2>&1 | \
248 - $(EGREP) '^(cw|cc|gcc|primary|shadow)'; \
249 - else \
250 - __COMPILER=`$($(MACH)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
251 - if [ -z "$$__COMPILER" ]; then \
252 - $(ECHO) No 32-bit compiler found; \
253 - exit 1; \
254 - else \
255 - $(ECHO) 32-bit compiler; \
256 - $(ECHO) $($(MACH)_CC); \
257 - $(ECHO) $$__COMPILER; \
258 - $($(MACH)_CC) -V 2>&1 | head -1; \
259 - fi; \
260 - fi
244 + @$(ECHO) 32-bit compiler; \
245 + $(ECHO) $($(MACH)_CC); \
246 + $(CW) --versions $(CW_CC_COMPILERS) 2>&1
261 247
262 248 cc64-version:
263 - @if $($(MACH64)_CC) -_versions >/dev/null 2>/dev/null; then \
264 - $(ECHO) 64-bit compiler; \
265 - $(ECHO) $($(MACH64)_CC); \
266 - $($(MACH64)_CC) -_versions 2>&1 | \
267 - $(EGREP) '^(cw|cc|gcc|primary|shadow)'; \
268 - else \
269 - __COMPILER=`$($(MACH64)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
270 - if [ -z "$$__COMPILER" ]; then \
271 - $(ECHO) No 64-bit compiler found; \
272 - exit 1; \
273 - else \
274 - $(ECHO) 64-bit compiler; \
275 - $(ECHO) $($(MACH64)_CC); \
276 - $(ECHO) $$__COMPILER; \
277 - $($(MACH64)_CC) -V 2>&1 | head -1; \
278 - fi; \
279 - fi
249 + @$(ECHO) 64-bit compiler; \
250 + $(ECHO) $($(MACH)_CC); \
251 + $(CW) --versions $(CW_CC_COMPILERS) 2>&1
280 252
281 253 java-version:
282 254 @if [ -x "$(JAVAC)" ]; then \
283 255 $(ECHO) $(JAVAC); \
284 256 $(JAVA_ROOT)/bin/java -fullversion 2>&1 | head -1; \
285 257 else \
286 258 $(ECHO) No Java compiler found; \
287 259 exit 1; \
288 260 fi
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX