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