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