Makefile revision 95c635efb7c3b86efc493e0447eaec7aecca3f0f
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# CDDL HEADER START
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# The contents of this file are subject to the terms of the
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu# Common Development and Distribution License (the "License").
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# You may not use this file except in compliance with the License.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# or http://www.opensolaris.org/os/licensing.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# See the License for the specific language governing permissions
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# and limitations under the License.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# When distributing Covered Code, include this CDDL HEADER in each
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# If applicable, add the following below this CDDL HEADER, with the
6c1f6e0b2f3a8d046525a8309e5448fdfb2d0714Christian Maeder# fields enclosed by brackets "[]" replaced with your own identifying
51f5e4646dd79be0844ceb0cc416e3fa3205a365Mihai Codescu# information: Portions Copyright [yyyy] [name of copyright owner]
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# CDDL HEADER END
e6427435181f3dc24b3548593e60e6fcdd996d49Christian Maeder# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
54ea981a0503c396c2923a1c06421c6235baf27fChristian Maeder# Copyright (c) 2012 by Delphix. All rights reserved.
c208973c890b8f993297720fd0247bc7481d4304Christian Maeder# Copyright 2014 Garrett D'Amore <garrett@damore.org>
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# Makefile for system source
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# include global definitions
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# the Targetdirs file is the AT&T target.dirs file in a makefile format.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# it defines TARGETDIRS and ROOTDIRS.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian MaederCOMMON_SUBDIRS= uts lib cmd ucblib ucbcmd psm man test
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# sparc needs to build stand before psm
e49fd57c63845c7806860a9736ad09f6d44dbaedChristian MaederSUBDIRS= $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# UCB headers are bug-for-bug compatible and not checkable against the header
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# Headers that can be built in parallel
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian MaederPARALLEL_HEADERS = sysheaders userheaders libheaders cmdheaders
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# Directories that can be built in parallel
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# The check target also causes smf(5) service manifests to be validated.
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# And man page formats
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian MaederMSGDIRS= $(MSGROOT) $(MSGDDIRS) $(MSGROOT)/LC_TIME
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# Note: install does not cause a build in pkg. To build packages,
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# cd pkg and do a 'make install'
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maederall: mapfiles closedbins sgs .WAIT $(SUBDIRS) pkg
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# The _msg build is a two-step process. First, the _msg dependency
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# causes recursive makes in $(MSGSUBDIRS), which stages raw message
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# files in $(ROOT)/catalog. Second, the action from the install
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# target rule causes those messages to be post-processed from where
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# they were staged in $(ROOT)/catalog, and the results placed into the
588aa1c4f05bd316cde3d7f93b24e3db3d1b6a0aMihai Codescu# The stage-licenses target causes the license files needed for
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# packaging to be pulled from $(SRC) and $(CLOSED) and staged in
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# $(ROOT)/licenses.
1cd0e77046ce5b6923b86f4b4a69d8c663928f99Christian Maeder @CLOSED_ROOT="$$ON_CLOSED_BINS/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
1cd0e77046ce5b6923b86f4b4a69d8c663928f99Christian Maeder if [ ! -d "$$CLOSED_ROOT" ]; then \
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder $(ECHO) "Error: ON_CLOSED_BINS must point to closed" \
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder "binaries."; \
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder $(ECHO) "root_$(MACH)$${RELEASE_BUILD+-nd} is not" \
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder "present in $$ON_CLOSED_BINS."; \
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder $(ECHO) "Copying closed binaries from $$CLOSED_ROOT"; \
1cd0e77046ce5b6923b86f4b4a69d8c663928f99Christian Maeder $(TAR) cfX - $(CODEMGR_WS)/exception_lists/closed-bins .) | \
e6427435181f3dc24b3548593e60e6fcdd996d49Christian Maeder ( cd $(ROOT); $(CTFSTRIP) $$(cd $$CLOSED_ROOT; $(FIND) \
e6427435181f3dc24b3548593e60e6fcdd996d49Christian Maeder ./kernel ./usr/kernel ./platform/*/kernel -type f -a -perm -u+x | \
e6427435181f3dc24b3548593e60e6fcdd996d49Christian Maeder $(EGREP) -vf $(CODEMGR_WS)/exception_lists/closed-bins) )
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# Declare what parts can be built in parallel
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# DUMMY at the end is used in case macro expansion produces an empty string to
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# prevent everything going in parallel
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# librpcsvc has a dependency on headers installed by
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# userheaders, hence the .WAIT before libheaders.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maedersgs: rootdirs .WAIT sysheaders userheaders .WAIT \
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# Top-level setup target to setup the development environment that includes
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# headers, tools and generated mapfiles. For open-only builds (i.e.: source
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# trees w/o usr/closed), this also depends on the closedbins target (above)
2e63df76296cdf828d87a2d03dd614219436e6f1Christian Maeder# in order to properly seed the proto area. Note, although the tools are
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# dependent on a number of constant mapfiles, the tools themselves are
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# required to build the generated mapfiles.
f4651a172fa4d00037b061fbe4df71abc69f12b5Christian Maeder# /var/mail/:saved is a special case because of the colon in the name.
588aa1c4f05bd316cde3d7f93b24e3db3d1b6a0aMihai Codescucheck: $(CHKHDRSUBDIRS) $(CHKMFSTSUBDIRS) $(CHKMANSUBDIRS)
588aa1c4f05bd316cde3d7f93b24e3db3d1b6a0aMihai Codescu# Cross-reference customization: skip all of the subdirectories that
588aa1c4f05bd316cde3d7f93b24e3db3d1b6a0aMihai Codescu# don't contain actual source code.
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder# Targets for reporting compiler versions; nightly uses these.
163ac7391de7fd3d6c46b22d291adaa7c766f105Christian Maeder @if $($(MACH)_CC) -_versions >/dev/null 2>/dev/null; then \
if [ -z "$$__COMPILER" ]; then \
if [ -z "$$__COMPILER" ]; then \