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