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