Print this page
7661 illumos should provide 64bit perl modules (for omni)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/pkg/Makefile
+++ new/usr/src/pkg/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
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
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) 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
25 25 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
26 +# Copyright 2016 RackTop Systems.
26 27 #
27 28
28 29 include $(SRC)/Makefile.master
29 30 include $(SRC)/Makefile.buildnum
30 31
31 32 #
32 33 # Make sure we're getting a consistent execution environment for the
33 34 # embedded scripts.
34 35 #
35 36 SHELL= /usr/bin/ksh93
36 37
37 38 #
38 39 # To suppress package dependency generation on any system, regardless
39 40 # of how it was installed, set SUPPRESSPKGDEP=true in the build
40 41 # environment.
41 42 #
42 43 SUPPRESSPKGDEP= false
43 44
44 45 #
45 46 # Comment this line out or set "PKGDEBUG=" in your build environment
46 47 # to get more verbose output from the make processes in usr/src/pkg
47 48 #
48 49 PKGDEBUG= @
49 50
50 51 #
51 52 # Cross platform packaging notes
52 53 #
53 54 # By default, we package the proto area from the same architecture as
54 55 # the packaging build. In other words, if you're running nightly or
55 56 # bldenv on an x86 platform, it will take objects from the x86 proto
56 57 # area and use them to create x86 repositories.
57 58 #
58 59 # If you want to create repositories for an architecture that's
59 60 # different from $(uname -p), you do so by setting PKGMACH in your
60 61 # build environment.
61 62 #
62 63 # For this to work correctly, the following must all happen:
63 64 #
64 65 # 1. You need the desired proto area, which you can get either by
65 66 # doing a gatekeeper-style build with the -U option to
66 67 # nightly(1), or by using rsync. If you don't do this, you will
67 68 # get packaging failures building all packages, because pkgsend
68 69 # is unable to find the required binaries.
69 70 # 2. You need the desired tools proto area, which you can get in the
70 71 # same ways as the normal proto area. If you don't do this, you
71 72 # will get packaging failures building onbld, because pkgsend is
72 73 # unable to find the tools binaries.
73 74 # 3. The remainder of this Makefile should never refer directly to
74 75 # $(MACH). Instead, $(PKGMACH) should be used whenever an
75 76 # architecture-specific path or token is needed. If this is done
76 77 # incorrectly, then packaging will fail, and you will see the
77 78 # value of $(uname -p) instead of the value of $(PKGMACH) in the
78 79 # commands that fail.
79 80 # 4. Each time a rule in this Makefile invokes $(MAKE), it should
80 81 # pass PKGMACH=$(PKGMACH) explicitly on the command line. If
81 82 # this is done incorrectly, then packaging will fail, and you
82 83 # will see the value of $(uname -p) instead of the value of
83 84 # $(PKGMACH) in the commands that fail.
84 85 #
85 86 # Refer also to the convenience targets defined later in this
86 87 # Makefile.
87 88 #
88 89 PKGMACH= $(MACH)
89 90
90 91 #
91 92 # ROOT, TOOLS_PROTO, and PKGARCHIVE should be set by nightly or
92 93 # bldenv. These macros translate them into terms of $PKGMACH, instead
93 94 # of $ARCH.
94 95 #
95 96 PKGROOT.cmd= print $(ROOT) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
96 97 PKGROOT= $(PKGROOT.cmd:sh)
97 98 TOOLSROOT.cmd= print $(TOOLS_PROTO) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
98 99 TOOLSROOT= $(TOOLSROOT.cmd:sh)
99 100 PKGDEST.cmd= print $(PKGARCHIVE) | sed -e s:/$(MACH)/:/$(PKGMACH)/:
100 101 PKGDEST= $(PKGDEST.cmd:sh)
101 102
102 103 EXCEPTIONS= packaging
103 104
104 105 PKGMOGRIFY= pkgmogrify
105 106
106 107 #
107 108 # Always build the redistributable repository, but only build the
108 109 # nonredistributable bits if we have access to closed source.
109 110 #
110 111 # Some objects that result from the closed build are still
111 112 # redistributable, and should be packaged as part of an open-only
112 113 # build. Access to those objects is provided via the closed-bins
113 114 # tarball. See usr/src/tools/scripts/bindrop.sh for details.
114 115 #
115 116 REPOS= redist
116 117
117 118 #
118 119 # The packages directory will contain the processed manifests as
119 120 # direct build targets and subdirectories for package metadata extracted
120 121 # incidentally during manifest processing.
121 122 #
122 123 # Nothing underneath $(PDIR) should ever be managed by SCM.
123 124 #
124 125 PDIR= packages.$(PKGMACH)
125 126
126 127 #
127 128 # The tools proto must be specified for dependency generation.
128 129 # Publication from the tools proto area is managed in the
129 130 # publication rule.
130 131 #
131 132 $(PDIR)/developer-build-onbld.dep:= PKGROOT= $(TOOLSROOT)
132 133
133 134 PKGPUBLISHER= $(PKGPUBLISHER_REDIST)
134 135
135 136 #
136 137 # To get these defaults, manifests should simply refer to $(PKGVERS).
137 138 #
138 139 PKGVERS_COMPONENT= 0.$(RELEASE)
139 140 PKGVERS_BUILTON= $(RELEASE)
140 141 PKGVERS_BRANCH= 0.$(ONNV_BUILDNUM)
141 142 PKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
142 143
143 144 #
144 145 # The ARCH32 and ARCH64 macros are used in the manifests to express
145 146 # architecture-specific subdirectories in the installation paths
146 147 # for isaexec'd commands.
147 148 #
148 149 # We can't simply use $(MACH32) and $(MACH64) here, because they're
149 150 # only defined for the build architecture. To do cross-platform
150 151 # packaging, we need both values.
151 152 #
152 153 i386_ARCH32= i86
153 154 sparc_ARCH32= sparcv7
154 155 i386_ARCH64= amd64
155 156 sparc_ARCH64= sparcv9
156 157
157 158 #
158 159 # macros and transforms needed by pkgmogrify
159 160 #
160 161 # If you append to this list using target-specific assignments (:=),
161 162 # be very careful that the targets are of the form $(PDIR)/pkgname. If
162 163 # you use a higher level target, or a package list, you'll trigger a
163 164 # complete reprocessing of all manifests because they'll fail command
164 165 # dependency checking.
165 166 #
166 167 PM_TRANSFORMS= common_actions publish restart_fmri facets defaults \
167 168 extract_metadata
168 169 PM_INC= transforms manifests
169 170
170 171 PKGMOG_DEFINES= \
171 172 i386_ONLY=$(POUND_SIGN) \
172 173 sparc_ONLY=$(POUND_SIGN) \
173 174 $(PKGMACH)_ONLY= \
174 175 ARCH=$(PKGMACH) \
↓ open down ↓ |
139 lines elided |
↑ open up ↑ |
175 176 ARCH32=$($(PKGMACH)_ARCH32) \
176 177 ARCH64=$($(PKGMACH)_ARCH64) \
177 178 PKGVERS_COMPONENT=$(PKGVERS_COMPONENT) \
178 179 PKGVERS_BUILTON=$(PKGVERS_BUILTON) \
179 180 PKGVERS_BRANCH=$(PKGVERS_BRANCH) \
180 181 PKGVERS=$(PKGVERS) \
181 182 PERL_ARCH=$(PERL_ARCH) \
182 183 PERL_ARCH64=$(PERL_ARCH64) \
183 184 PERL_VERSION=$(PERL_VERSION) \
184 185 PERL_PKGVERS=$(PERL_PKGVERS) \
186 + 64BIT_PERL=$(ENABLE_64BIT_PERL) \
185 187 PYTHON_VERSION=$(PYTHON_VERSION) \
186 188 PYTHON_PKGVERS=$(PYTHON_PKGVERS)
187 189
188 190 PKGDEP_TOKENS_i386= \
189 191 'PLATFORM=i86hvm' \
190 192 'PLATFORM=i86pc' \
191 193 'PLATFORM=i86xpv' \
192 194 'ISALIST=amd64' \
193 195 'ISALIST=i386'
194 196 PKGDEP_TOKENS_sparc= \
195 197 'PLATFORM=sun4u' \
196 198 'PLATFORM=sun4v' \
197 199 'ISALIST=sparcv9' \
198 200 'ISALIST=sparc'
199 201 PKGDEP_TOKENS= $(PKGDEP_TOKENS_$(PKGMACH))
200 202
201 203 #
202 204 # The package lists are generated with $(PKGDEP_TYPE) as their
203 205 # dependency types, so that they can be included by either an
204 206 # incorporation or a group package.
205 207 #
206 208 $(PDIR)/osnet-redist.mog := PKGDEP_TYPE= require
207 209 $(PDIR)/osnet-incorporation.mog:= PKGDEP_TYPE= incorporate
208 210
209 211 PKGDEP_INCORP= \
210 212 depend fmri=consolidation/osnet/osnet-incorporation type=require
211 213
212 214 #
213 215 # All packaging build products should go into $(PDIR), so they don't
214 216 # need to be included separately in CLOBBERFILES.
215 217 #
216 218 CLOBBERFILES= $(PDIR) proto_list_$(PKGMACH) install-$(PKGMACH).out \
217 219 license-list
218 220
219 221 #
220 222 # By default, PKGS will list all manifests. To build and/or publish a
221 223 # subset of packages, override this on the command line or in the
222 224 # build environment and then reference (implicitly or explicitly) the all
223 225 # or install targets. Using ls -1 (that's a one) or print or echo to
224 226 # get the list of manifests is a little hackish, but avoids having a
225 227 # 900+ line file to explicitly list them all.
226 228 #
227 229 # We want some manifests to optionally built based on environment
228 230 # options, so those are excluded and optionally added back in.
229 231 # We also want a relatively easy way to add files to the list of
230 232 # manifests given special treatment. Add any other special ones
231 233 # to the SPECIAL_MANIFESTS vaiable. It can contain wildcards in
232 234 # regexp form, i.e. SUNW.* as one useful example.
233 235 #
234 236 SPECIAL_MANIFESTS = "SUNWippl print-lp-ipp-ipp-listener.mf"
235 237 LIST_MANIFESTS_CMD = (cd manifests ; /usr/bin/ls -1 *.mf |\
236 238 $(SED) $(SPECIAL_MANIFESTS:%=-e '/^%$$/d') )
237 239 MANIFESTS = $(LIST_MANIFESTS_CMD:sh)
238 240
239 241 # Conditionally add back lp-ipp
240 242 $(ENABLE_IPP_PRINTING) MANIFESTS += "print-lp-ipp-ipp-listener.mf SUNWippl"
241 243
242 244 PKGS= $(MANIFESTS:%.mf=%)
243 245 DEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
244 246 PROC_PKGS= $(PKGS:%=$(PDIR)/%.mog)
245 247
246 248 #
247 249 # Track the synthetic manifests separately so we can properly express
248 250 # build rules and dependencies. The synthetic and real packages use
249 251 # different sets of transforms and macros for pkgmogrify.
250 252 #
251 253 SYNTH_PKGS= osnet-incorporation osnet-redist
252 254 DEP_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.dep)
253 255 PROC_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.mog)
254 256
255 257 #
256 258 # Root of pkg image to use for dependency resolution
257 259 # Normally / on the machine used to build the binaries
258 260 #
259 261 PKGDEP_RESOLVE_IMAGE = /
260 262
261 263 #
262 264 # For each package, we determine the target repository based on
263 265 # manifest-embedded metadata. Because we make that determination on
264 266 # the fly, the publication target cannot be expressed as a
265 267 # subdirectory inside the unknown-by-the-makefile target repository.
266 268 #
267 269 # In order to limit the target set to real files in known locations,
268 270 # we use a ".pub" file in $(PDIR) for each processed manifest, regardless
269 271 # of content or target repository.
270 272 #
271 273 PUB_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.pub) $(PKGS:%=$(PDIR)/%.pub)
272 274
273 275 #
274 276 # Any given repository- and status-specific package list may be empty,
275 277 # but we can only determine that dynamically, so we always generate all
276 278 # lists for each repository we're building.
277 279 #
278 280 # The meanings of each package status are as follows:
279 281 #
280 282 # PKGSTAT meaning
281 283 # ---------- ----------------------------------------------------
282 284 # noincorp Do not include in incorporation or group package
283 285 # obsolete Include in incorporation, but not group package
284 286 # renamed Include in incorporation, but not group package
285 287 # current Include in incorporation and group package
286 288 #
287 289 # Since the semantics of the "noincorp" package status dictate that
288 290 # such packages are not included in the incorporation or group packages,
289 291 # there is no need to build noincorp package lists.
290 292 #
291 293 PKGLISTS= \
292 294 $(REPOS:%=$(PDIR)/packages.%.current) \
293 295 $(REPOS:%=$(PDIR)/packages.%.renamed) \
294 296 $(REPOS:%=$(PDIR)/packages.%.obsolete)
295 297
296 298 .KEEP_STATE:
297 299
298 300 .PARALLEL: $(PKGS) $(PROC_PKGS) $(DEP_PKGS) \
299 301 $(PROC_SYNTH_PKGS) $(DEP_SYNTH_PKGS) $(PUB_PKGS)
300 302
301 303 #
302 304 # For a single manifest, the dependency chain looks like this:
303 305 #
304 306 # raw manifest (mypkg.mf)
305 307 # |
306 308 # | use pkgmogrify to process raw manifest
307 309 # |
308 310 # processed manifest (mypkg.mog)
309 311 # |
310 312 # * | use pkgdepend generate to generate dependencies
311 313 # |
312 314 # manifest with TBD dependencies (mypkg.dep)
313 315 # |
314 316 # % | use pkgdepend resolve to resolve dependencies
315 317 # |
316 318 # manifest with dependencies resolved (mypkg.res)
317 319 # |
318 320 # | use pkgsend to publish the package
319 321 # |
320 322 # placeholder to indicate successful publication (mypkg.pub)
321 323 #
322 324 # * This may be suppressed via SUPPRESSPKGDEP. The resulting
323 325 # packages will install correctly, but care must be taken to
324 326 # install all dependencies, because pkg will not have the input
325 327 # it needs to determine this automatically.
326 328 #
327 329 # % This is included in this diagram to make the picture complete, but
328 330 # this is a point of synchronization in the build process.
329 331 # Dependency resolution is actually done once on the entire set of
330 332 # manifests, not on a per-package basis.
331 333 #
332 334 # The full dependency chain for generating everything that needs to be
333 335 # published, without actually publishing it, looks like this:
334 336 #
335 337 # processed synthetic packages
336 338 # | |
337 339 # package lists synthetic package manifests
338 340 # |
339 341 # processed real packages
340 342 # | |
341 343 # package dir real package manifests
342 344 #
343 345 # Here, each item is a set of real or synthetic packages. For this
344 346 # portion of the build, no reference is made to the proto area. It is
345 347 # therefore suitable for the "all" target, as opposed to "install."
346 348 #
347 349 # Since each of these steps is expressed explicitly, "all" need only
348 350 # depend on the head of the chain.
349 351 #
350 352 # From the end of manifest processing, the publication dependency
351 353 # chain looks like this:
352 354 #
353 355 # repository metadata (catalogs and search indices)
354 356 # |
355 357 # | pkgrepo refresh
356 358 # |
357 359 # published packages
358 360 # | |
359 361 # | | pkgsend publish
360 362 # | |
361 363 # repositories resolved dependencies
362 364 # | |
363 365 # pkgsend | | pkgdepend resolve
364 366 # create-repository |
365 367 # | generated dependencies
366 368 # repo directories |
367 369 # | pkgdepend
368 370 # |
369 371 # processed manifests
370 372 #
371 373
372 374 ALL_TARGETS= $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
373 375
374 376 all: $(ALL_TARGETS)
375 377
376 378 #
377 379 # This will build the directory to contain the processed manifests
378 380 # and the metadata symlinks.
379 381 #
380 382 $(PDIR):
381 383 @print "Creating $(@)"
382 384 $(PKGDEBUG)$(INS.dir)
383 385
384 386 #
385 387 # This rule resolves dependencies across all published manifests.
386 388 #
387 389 # We shouldn't have to ignore the error from pkgdepend, but until
388 390 # 16012 and its dependencies are resolved, pkgdepend will always exit
389 391 # with an error.
390 392 #
391 393 $(PDIR)/gendeps: $(DEP_SYNTH_PKGS) $(DEP_PKGS)
392 394 -$(PKGDEBUG)if [ "$(SUPPRESSPKGDEP)" = "true" ]; then \
393 395 print "Suppressing dependency resolution"; \
394 396 for p in $(DEP_PKGS:%.dep=%); do \
395 397 $(CP) $$p.dep $$p.res; \
396 398 done; \
397 399 else \
398 400 print "Resolving dependencies"; \
399 401 pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve \
400 402 -m $(DEP_SYNTH_PKGS) $(DEP_PKGS); \
401 403 for p in $(DEP_SYNTH_PKGS:%.dep=%) $(DEP_PKGS:%.dep=%); do \
402 404 if [ "$$(print $$p.metadata.*)" = \
403 405 "$$(print $$p.metadata.noincorp.*)" ]; \
404 406 then \
405 407 print "Removing dependency versions from $$p"; \
406 408 $(PKGMOGRIFY) $(PKGMOG_VERBOSE) \
407 409 -O $$p.res -I transforms \
408 410 strip_versions $$p.dep.res; \
409 411 $(RM) $$p.dep.res; \
410 412 else \
411 413 $(MV) $$p.dep.res $$p.res; \
412 414 fi; \
413 415 done; \
414 416 fi
415 417 $(PKGDEBUG)$(TOUCH) $(@)
416 418
417 419 install: $(ALL_TARGETS) repository-metadata
418 420
419 421 repository-metadata: publish_pkgs
420 422 $(PKGDEBUG)for r in $(REPOS); do \
421 423 pkgrepo refresh -s $(PKGDEST)/repo.$$r; \
422 424 done
423 425
424 426 #
425 427 # Since we create zero-length processed manifests for a graceful abort
426 428 # from pkgmogrify, we need to detect that here and make no effort to
427 429 # publish the package.
428 430 #
429 431 # For all other packages, we publish them regardless of status. We
430 432 # derive the target repository as a component of the metadata-derived
431 433 # symlink for each package.
432 434 #
433 435 publish_pkgs: $(REPOS:%=$(PKGDEST)/repo.%) $(PDIR)/gendeps .WAIT $(PUB_PKGS)
434 436
435 437 #
436 438 # Before publishing, we want to pull the license files from $CODEMGR_WS
437 439 # into the proto area. This allows us to NOT pass $SRC (or
438 440 # $CODEMGR_WS) as a basedir for publication.
439 441 #
440 442 $(PUB_PKGS): stage-licenses
441 443
442 444 #
443 445 # Initialize the empty on-disk repositories
444 446 #
445 447 $(REPOS:%=$(PKGDEST)/repo.%):
446 448 @print "Initializing $(@F)"
447 449 $(PKGDEBUG)$(INS.dir)
448 450 $(PKGDEBUG)pkgsend -s file://$(@) create-repository \
449 451 --set-property publisher.prefix=$(PKGPUBLISHER)
450 452
451 453 #
452 454 # rule to process real manifests
453 455 #
454 456 # To allow redistributability and package status to change, we must
455 457 # remove not only the actual build target (the processed manifest), but
456 458 # also the incidental ones (the metadata-derived symlinks).
457 459 #
458 460 # If pkgmogrify exits cleanly but fails to create the specified output
459 461 # file, it means that it encountered an abort directive. That means
460 462 # that this package should not be published for this particular build
461 463 # environment. Since we can't prune such packages from $(PKGS)
462 464 # retroactively, we need to create an empty target file to keep make
463 465 # from trying to rebuild it every time. For these empty targets, we
464 466 # do not create metadata symlinks.
465 467 #
466 468 # Automatic dependency resolution to files is also done at this phase of
467 469 # processing. The skipped packages are skipped due to existing bugs
468 470 # in pkgdepend.
469 471 #
470 472 # The incorporation dependency is tricky: it needs to go into all
471 473 # current and renamed manifests (ie all incorporated packages), but we
472 474 # don't know which those are until after we run pkgmogrify. So
473 475 # instead of expressing it as a transform, we tack it on ex post facto.
474 476 #
475 477 # Implementation notes:
476 478 #
477 479 # - The first $(RM) must not match other manifests, or we'll run into
478 480 # race conditions with parallel manifest processing.
479 481 #
480 482 # - The make macros [ie $(MACRO)] are evaluated when the makefile is
481 483 # read in, and will result in a fixed, macro-expanded rule for each
482 484 # target enumerated in $(PROC_PKGS).
483 485 #
484 486 # - The shell variables (ie $$VAR) are assigned on the fly, as the rule
485 487 # is executed. The results may only be referenced in the shell in
486 488 # which they are assigned, so from the perspective of make, all code
487 489 # that needs these variables needs to be part of the same line of
488 490 # code. Hence the use of command separators and line continuation
489 491 # characters.
490 492 #
491 493 # - The extract_metadata transforms are designed to spit out shell
492 494 # variable assignments to stdout. Those are published to the
493 495 # .vars temporary files, and then used as input to the eval
494 496 # statement. This is done in stages specifically so that pkgmogrify
495 497 # can signal failure if the manifest has a syntactic or other error.
496 498 # The eval statement should begin with the default values, and the
497 499 # output from pkgmogrify (if any) should be in the form of a
498 500 # variable assignment to override those defaults.
499 501 #
500 502 # - When this rule completes execution, it must leave an updated
501 503 # target file ($@) in place, or make will reprocess the package
502 504 # every time it encounters it as a dependency. Hence the "touch"
503 505 # statement to ensure that the target is created, even when
504 506 # pkgmogrify encounters an abort in the publish transforms.
505 507 #
506 508
507 509 .SUFFIXES: .mf .mog .dep .res .pub
508 510
509 511 $(PDIR)/%.mog: manifests/%.mf
510 512 @print "Processing manifest $(<F)"
511 513 @env PKGFMT_OUTPUT=v1 pkgfmt -c $<
512 514 $(PKGDEBUG)$(RM) $(@) $(@:%.mog=%) $(@:%.mog=%.nodepend) \
513 515 $(@:%.mog=%.lics) $(PDIR)/$(@F:%.mog=%).metadata.* $(@).vars
514 516 $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
515 517 $(PKGMOG_DEFINES:%=-D %) -P $(@).vars -O $(@) \
516 518 $(<) $(PM_TRANSFORMS)
517 519 $(PKGDEBUG)eval REPO=redist PKGSTAT=current NODEPEND=$(SUPPRESSPKGDEP) \
518 520 `$(CAT) -s $(@).vars`; \
519 521 if [ -f $(@) ]; then \
520 522 if [ "$$NODEPEND" != "false" ]; then \
521 523 $(TOUCH) $(@:%.mog=%.nodepend); \
522 524 fi; \
523 525 $(LN) -s $(@F) \
524 526 $(PDIR)/$(@F:%.mog=%).metadata.$$PKGSTAT.$$REPO; \
525 527 if [ \( "$$PKGSTAT" = "current" \) -o \
526 528 \( "$$PKGSTAT" = "renamed" \) ]; \
527 529 then print $(PKGDEP_INCORP) >> $(@); \
528 530 fi; \
529 531 print $$LICS > $(@:%.mog=%.lics); \
530 532 else \
531 533 $(TOUCH) $(@) $(@:%.mog=%.lics); \
532 534 fi
533 535 $(PKGDEBUG)$(RM) $(@).vars
534 536
535 537 $(PDIR)/%.dep: $(PDIR)/%.mog
536 538 @print "Generating dependencies for $(<F)"
537 539 $(PKGDEBUG)$(RM) $(@)
538 540 $(PKGDEBUG)if [ ! -f $(@:%.dep=%.nodepend) ]; then \
539 541 pkgdepend generate -m $(PKGDEP_TOKENS:%=-D %) $(<) \
540 542 $(PKGROOT) > $(@); \
541 543 else \
542 544 $(CP) $(<) $(@); \
543 545 fi
544 546
545 547 #
546 548 # The full chain implies that there should be a .dep.res suffix rule,
547 549 # but dependency generation is done on a set of manifests, rather than
548 550 # on a per-manifest basis. Instead, see the gendeps rule above.
549 551 #
550 552
551 553 $(PDIR)/%.pub: $(PDIR)/%.res
552 554 $(PKGDEBUG)m=$$(basename $(@:%.pub=%).metadata.*); \
553 555 r=$${m#$(@F:%.pub=%.metadata.)+(?).}; \
554 556 if [ -s $(<) ]; then \
555 557 print "Publishing $(@F:%.pub=%) to $$r repository"; \
556 558 pkgsend -s file://$(PKGDEST)/repo.$$r publish \
557 559 -d $(PKGROOT) -d $(TOOLSROOT) \
558 560 -d license_files -d $(PKGROOT)/licenses \
559 561 --fmri-in-manifest --no-index --no-catalog $(<) \
560 562 > /dev/null; \
561 563 fi; \
562 564 $(TOUCH) $(@);
563 565
564 566 #
565 567 # rule to build the synthetic manifests
566 568 #
567 569 # This rule necessarily has PKGDEP_TYPE that changes according to
568 570 # the specific synthetic manifest. Rather than escape command
569 571 # dependency checking for the real manifest processing, or failing to
570 572 # express the (indirect) dependency of synthetic manifests on real
571 573 # manifests, we simply split this rule out from the one above.
572 574 #
573 575 # The implementation notes from the previous rule are applicable
574 576 # here, too.
575 577 #
576 578 $(PROC_SYNTH_PKGS): $(PKGLISTS) $$(@F:%.mog=%.mf)
577 579 @print "Processing synthetic manifest $(@F:%.mog=%.mf)"
578 580 $(PKGDEBUG)$(RM) $(@) $(PDIR)/$(@F:%.mog=%).metadata.* $(@).vars
579 581 $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) -I transforms -I $(PDIR) \
580 582 $(PKGMOG_DEFINES:%=-D %) -D PKGDEP_TYPE=$(PKGDEP_TYPE) \
581 583 -P $(@).vars -O $(@) $(@F:%.mog=%.mf) \
582 584 $(PM_TRANSFORMS) synthetic
583 585 $(PKGDEBUG)eval REPO=redist PKGSTAT=current `$(CAT) -s $(@).vars`; \
584 586 if [ -f $(@) ]; then \
585 587 $(LN) -s $(@F) \
586 588 $(PDIR)/$(@F:%.mog=%).metadata.$$PKGSTAT.$$REPO; \
587 589 else \
588 590 $(TOUCH) $(@); \
589 591 fi
590 592 $(PKGDEBUG)$(RM) $(@).vars
591 593
592 594 $(DEP_SYNTH_PKGS): $$(@:%.dep=%.mog)
593 595 @print "Skipping dependency generation for $(@F:%.dep=%)"
594 596 $(PKGDEBUG)$(CP) $(@:%.dep=%.mog) $(@)
595 597
596 598 clean:
597 599
598 600 clobber: clean
599 601 $(RM) -r $(CLOBBERFILES)
600 602
601 603 #
602 604 # This rule assumes that all links in the $PKGSTAT directories
603 605 # point to valid manifests, and will fail the make run if one
604 606 # does not contain an fmri.
605 607 #
606 608 # We do this in the BEGIN action instead of using pattern matching
607 609 # because we expect the fmri to be at or near the first line of each input
608 610 # file, and this way lets us avoid reading the rest of the file after we
609 611 # find what we need.
610 612 #
611 613 # We keep track of a failure to locate an fmri, so we can fail the
612 614 # make run, but we still attempt to process each package in the
613 615 # repo/pkgstat-specific subdir, in hopes of maybe giving some
614 616 # additional useful info.
615 617 #
616 618 # The protolist is used for bfu archive creation, which may be invoked
617 619 # interactively by the user. Both protolist and PKGLISTS targets
618 620 # depend on $(PROC_PKGS), but protolist builds them recursively.
619 621 # To avoid collisions, we insert protolist into the dependency chain
620 622 # here. This has two somewhat subtle benefits: it allows bfu archive
621 623 # creation to work correctly, even when -a was not part of NIGHTLY_OPTIONS,
622 624 # and it ensures that a protolist file here will always correspond to the
623 625 # contents of the processed manifests, which can vary depending on build
624 626 # environment.
625 627 #
626 628 $(PKGLISTS): $(PROC_PKGS)
627 629 $(PKGDEBUG)sdotr=$(@F:packages.%=%); \
628 630 r=$${sdotr%.+(?)}; s=$${sdotr#+(?).}; \
629 631 print "Generating $$r $$s package list"; \
630 632 $(RM) $(@); $(TOUCH) $(@); \
631 633 $(AWK) 'BEGIN { \
632 634 if (ARGC < 2) { \
633 635 exit; \
634 636 } \
635 637 retcode = 0; \
636 638 for (i = 1; i < ARGC; i++) { \
637 639 do { \
638 640 e = getline f < ARGV[i]; \
639 641 } while ((e == 1) && (f !~ /name=pkg.fmri/)); \
640 642 close(ARGV[i]); \
641 643 if (e == 1) { \
642 644 l = split(f, a, "="); \
643 645 print "depend fmri=" a[l], \
644 646 "type=$$(PKGDEP_TYPE)"; \
645 647 } else { \
646 648 print "no fmri in " ARGV[i] >> "/dev/stderr"; \
647 649 retcode = 2; \
648 650 } \
649 651 } \
650 652 exit retcode; \
651 653 }' `find $(PDIR) -type l -a \( $(PKGS:%=-name %.metadata.$$s.$$r -o) \
652 654 -name NOSUCHFILE \)` >> $(@)
653 655
654 656 #
655 657 # rules to validate proto area against manifests, check for safe
656 658 # file permission modes, and generate a faux proto list
657 659 #
658 660 # For the check targets, the dependencies on $(PROC_PKGS) is specified
659 661 # as a subordinate make process in order to suppress output.
660 662 #
661 663 makesilent:
662 664 @$(MAKE) -e $(PROC_PKGS) PKGMACH=$(PKGMACH) \
663 665 SUPPRESSPKGDEP=$(SUPPRESSPKGDEP) > /dev/null
664 666
665 667 #
666 668 # The .lics files were created during pkgmogrification, and list the
667 669 # set of licenses to pull from $SRC for each package. Because
668 670 # licenses may be duplicated between packages, we uniquify them as
669 671 # well as aggregating them here.
670 672 #
671 673 license-list: makesilent
672 674 $(PKGDEBUG)( for l in `cat $(PROC_PKGS:%.mog=%.lics)`; \
673 675 do print $$l; done ) | sort -u > $@
674 676
675 677 #
676 678 # Staging the license and description files in the proto area allows
677 679 # us to do proper unreferenced file checking of both license and
678 680 # description files without blanket exceptions, and to pull license
679 681 # content without reference to $CODEMGR_WS during publication.
680 682 #
681 683 stage-licenses: license-list FRC
682 684 $(PKGDEBUG)$(MAKE) -e -f Makefile.lic \
683 685 PKGDEBUG=$(PKGDEBUG) LICROOT=$(PKGROOT)/licenses \
684 686 `$(AWK) '{ \
685 687 print "$(PKGROOT)/licenses/" $$0; \
686 688 print "$(PKGROOT)/licenses/" $$0 ".descrip"; \
687 689 }' license-list` > /dev/null;
688 690
689 691 protocmp: makesilent
690 692 @validate_pkg -a $(PKGMACH) -v \
691 693 $(EXCEPTIONS:%=-e $(CODEMGR_WS)/exception_lists/%) \
692 694 -m $(PDIR) -p $(PKGROOT) -p $(TOOLSROOT)
693 695
694 696 pmodes: makesilent
695 697 @validate_pkg -a $(PKGMACH) -M -m $(PDIR) \
696 698 -e $(CODEMGR_WS)/exception_lists/pmodes
697 699
698 700 check: protocmp pmodes
699 701
700 702 protolist: proto_list_$(PKGMACH)
701 703
702 704 proto_list_$(PKGMACH): $(PROC_PKGS)
703 705 @validate_pkg -a $(PKGMACH) -L -m $(PDIR) > $(@)
704 706
705 707 $(PROC_PKGS): $(PDIR)
706 708
707 709 #
708 710 # This is a convenience target to allow package names to function as
709 711 # build targets. Generally, using it is only useful when iterating on
710 712 # development of a manifest.
711 713 #
712 714 # When processing a manifest, use the basename (without extension) of
713 715 # the package. When publishing, use the basename with a ".pub"
714 716 # extension.
715 717 #
716 718 # Other than during manifest development, the preferred usage is to
717 719 # avoid these targets and override PKGS on the make command line and
718 720 # use the provided all and install targets.
719 721 #
720 722 $(PKGS) $(SYNTH_PKGS): $(PDIR)/$$(@:%=%.mog)
721 723
722 724 $(PKGS:%=%.pub) $(SYNTH_PKGS:%=%.pub): $(PDIR)/$$(@)
723 725
724 726 #
725 727 # This is a convenience target to resolve dependencies without publishing
726 728 # packages.
727 729 #
728 730 gendeps: $(PDIR)/gendeps
729 731
730 732 #
731 733 # These are convenience targets for cross-platform packaging. If you
732 734 # want to build any of "the normal" targets for a different
733 735 # architecture, simply use "arch/target" as your build target.
734 736 #
735 737 # Since the most common use case for this is "install," the architecture
736 738 # specific install targets have been further abbreviated to elide "/install."
737 739 #
738 740 i386/% sparc/%:
739 741 $(MAKE) -e $(@F) PKGMACH=$(@D) SUPPRESSPKGDEP=$(SUPPRESSPKGDEP)
740 742
741 743 i386 sparc: $$(@)/install
742 744
743 745 FRC:
↓ open down ↓ |
549 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX