Makefile revision 6909
1378N/A# The contents of this file are subject to the terms of the 1378N/A# Common Development and Distribution License (the "License"). 1378N/A# You may not use this file except in compliance with the License. 1378N/A# See the License for the specific language governing permissions 1378N/A# and limitations under the License. 1378N/A# When distributing Covered Code, include this CDDL HEADER in each 1378N/A# If applicable, add the following below this CDDL HEADER, with the 1378N/A# fields enclosed by brackets "[]" replaced with your own identifying 1378N/A# information: Portions Copyright [yyyy] [name of copyright owner] 5680N/A# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 1378N/A# The golang build process just doesn't work with Parfait. 1378N/A# Go has a number of supplementary tools and packages that are located in 1378N/A# separate archives or source repositories. Because Go currently forces a 1586N/A# recompile of all packages whenever the compiler changes, building and 1586N/A# delivering them within the same build component build process is the best 1378N/A# The long-term plan for packaging Go is roughly as follows: 1378N/A# - when SPARC support is integrated into Go upstream, build upstream version 1586N/A# using system Go for x86, then build Go for SPARC using upstream version 5680N/A# just built for x86 (cross-compilation), package both at the same time 1586N/A# - after SPARC version has been available for at least a few builds in the 1378N/A# WOS, switch to building Go with system version for x86 and SPARC 1378N/A# Supplementary packages; these are delivered as source only for now as the 3817N/A# paths to the compiled packages are written directly into the binaries and 3817N/A# there's no way (currently) to fix that during the build process. # Desired "revision" of Go's "community" libraries; these are arbitrary # revisions chosen from the last commit to the respective repository at the # same time that this component was updated as there is no formal release # process for these packages. Whenever Go is updated, these should be as well. # Resulting hash of related git commit once archived. # Go package imports for lint are found in github directory. # Go's "not well-formed" elf objects confuse elfsign, which then causes # problems for RE. For now, we workaround this by adding the # We're x86-only for now. # Bake in where Go package will be installed. # Enable easier stack unwinding for debugging. # Install root for supplementary packages. # For convenience during installation of supplementary packages. # Simplify source copying for install by eliding patch detritus. # Enable local transforms. # Avoid some of the default transforms: # - facet.devel serves no useful purpose for a development package # - facet.doc wrongly assumes all things in a doc directory are documentation; # in Go's case, some are binaries # This requires completely redefining PUBLISH_TRANSFORMS for now. $(GSED) -e
's/^..\(.*\):.*$$/<transform file path=\1$$ -> \\\ # Building go from the source repository version requires that we set an # effective version and add some sort of unique identifier (in the case of # pre-release versions), so we use 'devel' + archive hash + date similar to how # Go internally determines one normally from git revision info. Uncomment the # block below when building from the upstream source repository: #COMPONENT_POST_UNPACK_ACTION= \ # $(MV) go-master $(COMPONENT_SRC) && \ # $(TOUCH) $(COMPONENT_SRC)/VERSION && \ # echo "devel $(shell digest -a md5 $(COMPONENT_ARCHIVE)) \ # $(shell date -u +'%a %b %e %T %Z %Y')" > \ # $(COMPONENT_SRC)/VERSION # We have to fiddle with the package archives to get them into the same source # directory so that we can use the standard build targets. We're effectively # building multiple components using a single target. # Fixup compressed data affected by patches. # Go doesn't have a standard Makefile-based build process, so override the # We can't do any ASLR'ing as the Go 6l linker has no understanding of the # -z aslr=... option. So just override where needed in the .p5m files. # The timestamp is generated immediately once when the Makefile is evaluated to # ensure every package gets the same one. # Make sure the source code and object files have identical timestamps so # the Go compiler doesn't try to rebuild them. # Extra macros for packaging convenience. # COMPONENT_MAJOR_VERSION suitable for use in regular expressions. # Go's test suite does not have deterministic output or order, and as such, # success can only be determined by exit code, not by output comparison. # clear COMPONENT_POST_INSTALL_ACTION so we can append PERL_SCRIPTS_PROCESS # Magic to deliver supplemental package source into proto area. # Install supplementary packages (this cannot be done one-by-one); install # tools/go/types first to avoid quirk with trimpath and dependencies. This is # technically a build and install, but go's build command won't "install" # results, it only verifies a target can be built and dumps it into a temporary # The -trimpath option used here ensures that the paths recorded in the # pre-built packages do not contain the containing directory; the result is a # path that Go will evaluate relative to $GOPATH and so will pass the "stale" # object checks that Go performs at build time allowing reuse of the pre-built # Go's test suite is currently designed to be run from the build area. # Go 1.5 now bootstraps itself using 1.5; 1.6 will bootstrap using 1.5 as well. # Required to build man pages. # There's a single test script which requires perl. # Used for cgo support at runtime; we don't add a package dependency since cgo