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