Makefile revision 95c635efb7c3b86efc493e0447eaec7aecca3f0f
f743002678eb67b99bbc29fee116b65d9530fec0wrowe#
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg# CDDL HEADER START
6736c640e65e06990ef33af71ee81fac4df4ff5fjim#
459eaf0826f995b73a0dc066f59ea10d2824e72dsf# The contents of this file are subject to the terms of the
459eaf0826f995b73a0dc066f59ea10d2824e72dsf# Common Development and Distribution License (the "License").
459eaf0826f995b73a0dc066f59ea10d2824e72dsf# You may not use this file except in compliance with the License.
459eaf0826f995b73a0dc066f59ea10d2824e72dsf#
6d6cd31bddca0b7d9cf9d18e46cd2361530e24f3sf# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6d6cd31bddca0b7d9cf9d18e46cd2361530e24f3sf# or http://www.opensolaris.org/os/licensing.
6d6cd31bddca0b7d9cf9d18e46cd2361530e24f3sf# See the License for the specific language governing permissions
53e9b27aba029b18be814df40bcf6f0428771d1efuankg# and limitations under the License.
53e9b27aba029b18be814df40bcf6f0428771d1efuankg#
53e9b27aba029b18be814df40bcf6f0428771d1efuankg# When distributing Covered Code, include this CDDL HEADER in each
53e9b27aba029b18be814df40bcf6f0428771d1efuankg# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
53e9b27aba029b18be814df40bcf6f0428771d1efuankg# If applicable, add the following below this CDDL HEADER, with the
347074f011eae59e518ddf8d8474d35e029a2056sf# fields enclosed by brackets "[]" replaced with your own identifying
fe2e0971201136f2dbc6b000ad5c006a1a6ff672sf# information: Portions Copyright [yyyy] [name of copyright owner]
fe2e0971201136f2dbc6b000ad5c006a1a6ff672sf#
347074f011eae59e518ddf8d8474d35e029a2056sf# CDDL HEADER END
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf#
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf#
2876a591f17b0c6ed0cf28da929643965e67c953sf# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
2876a591f17b0c6ed0cf28da929643965e67c953sf# Copyright (c) 2012 by Delphix. All rights reserved.
2876a591f17b0c6ed0cf28da929643965e67c953sf# Copyright 2014 Garrett D'Amore <garrett@damore.org>
2876a591f17b0c6ed0cf28da929643965e67c953sf#
38eb64d29a17648e108852de42f23335aecaa8f8sf
38eb64d29a17648e108852de42f23335aecaa8f8sf#
38eb64d29a17648e108852de42f23335aecaa8f8sf# Makefile for system source
5a1f28ac93914b4bae892c69ac4b3e670bc10da8nd#
5a1f28ac93914b4bae892c69ac4b3e670bc10da8nd# include global definitions
5a1f28ac93914b4bae892c69ac4b3e670bc10da8ndinclude Makefile.master
0361488d59792d052a9f8024c0e5a1ef909252e6rpluem#
0361488d59792d052a9f8024c0e5a1ef909252e6rpluem# the Targetdirs file is the AT&T target.dirs file in a makefile format.
0361488d59792d052a9f8024c0e5a1ef909252e6rpluem# it defines TARGETDIRS and ROOTDIRS.
6135cc8178d75a52828ad225b1d568cd1e97799erplueminclude Targetdirs
6135cc8178d75a52828ad225b1d568cd1e97799erpluem
6135cc8178d75a52828ad225b1d568cd1e97799erpluemCOMMON_SUBDIRS= uts lib cmd ucblib ucbcmd psm man test
44761f3e3072cf78a4997a88bb9a515ca101a1f4covenersparc_SUBDIRS= stand
44761f3e3072cf78a4997a88bb9a515ca101a1f4coveneri386_SUBDIRS= grub
44761f3e3072cf78a4997a88bb9a515ca101a1f4covener
2ba1586475aa4ec972ca7c19b06d53bf76f0ee7efuankg#
2ba1586475aa4ec972ca7c19b06d53bf76f0ee7efuankg# sparc needs to build stand before psm
c7502880be24058c7fc03771fda61f95bc238339sf#
c7502880be24058c7fc03771fda61f95bc238339sf$(SPARC_BLD)psm: stand
c7502880be24058c7fc03771fda61f95bc238339sf
ca61ccd0c306c2c72df153688ba1b49f3eceed80sfSUBDIRS= $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf
ca61ccd0c306c2c72df153688ba1b49f3eceed80sfHDRSUBDIRS= uts head lib cmd
6bb524f1895f30265a1431afc460977d391cb36bsf
6bb524f1895f30265a1431afc460977d391cb36bsf# UCB headers are bug-for-bug compatible and not checkable against the header
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf# standards.
6bb524f1895f30265a1431afc460977d391cb36bsf#
8233250a7f6c06225752db92bf32117bd9648c1dsfCHKHDRSUBDIRS= head uts lib
8233250a7f6c06225752db92bf32117bd9648c1dsf
8233250a7f6c06225752db92bf32117bd9648c1dsf#
b40bfdb714672f972887f9f1f1e154e00125bb68covener# Headers that can be built in parallel
b40bfdb714672f972887f9f1f1e154e00125bb68covener#
b40bfdb714672f972887f9f1f1e154e00125bb68covenerPARALLEL_HEADERS = sysheaders userheaders libheaders cmdheaders
b40bfdb714672f972887f9f1f1e154e00125bb68covener
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin#
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin# Directories that can be built in parallel
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin#
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrinPARALLEL_DIRS = uts lib man
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin# The check target also causes smf(5) service manifests to be validated.
23f1535d6a60817d2846bac0aea230ea475d7dccminfrinCHKMFSTSUBDIRS= cmd
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung# And man page formats
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjungCHKMANSUBDIRS = man
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjungMSGSUBDIRS= cmd ucbcmd lib
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjungDOMAINS= \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung SUNW_OST_ADMIN \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung SUNW_OST_NETRPC \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung SUNW_OST_OSCMD \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung SUNW_OST_OSLIB \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung SUNW_OST_UCBCMD \
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick SUNW_OST_ZONEINFO
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick
0827cb14e550f6f65018431c22c2c913631c8f25kbrandMSGDDIRS= $(DOMAINS:%=$(MSGROOT)/%)
6249dfa569d3b4f1f539665b979a80c6e335d93etrawickMSGDIRS= $(MSGROOT) $(MSGDDIRS) $(MSGROOT)/LC_TIME
ae600ca541efc686b34f8b1f21bd3d0741d37674covener
6249dfa569d3b4f1f539665b979a80c6e335d93etrawickall := TARGET= all
cfa64348224b66dd1c9979b809406c4d15b1c137fieldinginstall := TARGET= install
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajiminstall1 := TARGET= install
cfa64348224b66dd1c9979b809406c4d15b1c137fieldinginstall2 := TARGET= install
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajiminstall_h := TARGET= install_h
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingclean := TARGET= clean
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajimclobber := TARGET= clobber
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingcheck := TARGET= check
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajim
cfa64348224b66dd1c9979b809406c4d15b1c137fielding.KEEP_STATE:
#
# Note: install does not cause a build in pkg. To build packages,
# cd pkg and do a 'make install'
#
all: mapfiles closedbins sgs .WAIT $(SUBDIRS) pkg
#
# The _msg build is a two-step process. First, the _msg dependency
# causes recursive makes in $(MSGSUBDIRS), which stages raw message
# files in $(ROOT)/catalog. Second, the action from the install
# target rule causes those messages to be post-processed from where
# they were staged in $(ROOT)/catalog, and the results placed into the
# proto area.
#
# The stage-licenses target causes the license files needed for
# packaging to be pulled from $(SRC) and $(CLOSED) and staged in
# $(ROOT)/licenses.
#
install: install1 install2 _msg stage-licenses
@cd msg; pwd; $(MAKE) _msg
@rm -rf "$(ROOT)/catalog"
stage-licenses: install2
@cd pkg; pwd; $(MAKE) stage-licenses
install1: mapfiles closedbins sgs
install2: install1 $(SUBDIRS)
_msg: _msgdirs rootdirs FRC
@for m in $(MSGSUBDIRS); do \
cd $$m; pwd; $(MAKE) _msg; cd ..; \
done
mapfiles: bldtools
@cd common/mapfiles; pwd; $(MAKE) install
clean: $(SUBDIRS) head pkg
clobber: $(SUBDIRS) head pkg clobber_local
clobber_local:
@cd tools; pwd; $(MAKE) clobber
@cd common/mapfiles; pwd; $(MAKE) clobber
@cd msg; pwd; $(MAKE) clobber
closedbins: bldtools $(ROOTDIRS) FRC
@CLOSED_ROOT="$$ON_CLOSED_BINS/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
if [ ! -d "$$CLOSED_ROOT" ]; then \
$(ECHO) "Error: ON_CLOSED_BINS must point to closed" \
"binaries."; \
$(ECHO) "root_$(MACH)$${RELEASE_BUILD+-nd} is not" \
"present in $$ON_CLOSED_BINS."; \
exit 1; \
fi; \
$(ECHO) "Copying closed binaries from $$CLOSED_ROOT"; \
(cd $$CLOSED_ROOT; \
$(TAR) cfX - $(CODEMGR_WS)/exception_lists/closed-bins .) | \
(cd $(ROOT); $(TAR) xBpf -); \
( cd $(ROOT); $(CTFSTRIP) $$(cd $$CLOSED_ROOT; $(FIND) \
./kernel ./usr/kernel ./platform/*/kernel -type f -a -perm -u+x | \
$(EGREP) -vf $(CODEMGR_WS)/exception_lists/closed-bins) )
#
# Declare what parts can be built in parallel
# DUMMY at the end is used in case macro expansion produces an empty string to
# prevent everything going in parallel
#
.PARALLEL: $(PARALLEL_HEADERS) DUMMY
.PARALLEL: $(PARALLEL_DIRS) DUMMY
$(SUBDIRS) head pkg: FRC
@cd $@; pwd; $(MAKE) $(TARGET)
# librpcsvc has a dependency on headers installed by
# userheaders, hence the .WAIT before libheaders.
sgs: rootdirs .WAIT sysheaders userheaders .WAIT \
libheaders cmdheaders
#
# Top-level setup target to setup the development environment that includes
# headers, tools and generated mapfiles. For open-only builds (i.e.: source
# trees w/o usr/closed), this also depends on the closedbins target (above)
# in order to properly seed the proto area. Note, although the tools are
# dependent on a number of constant mapfiles, the tools themselves are
# required to build the generated mapfiles.
#
setup: closedbins bldtools sgs mapfiles
bldtools:
@cd tools; pwd; $(MAKE) install
# /var/mail/:saved is a special case because of the colon in the name.
#
rootdirs: $(ROOTDIRS)
$(INS) -d -m 775 $(ROOT)/var/mail/:saved
lint: FRC
$(MAKE) -f Makefile.lint
_msgdirs: $(MSGDIRS)
$(ROOTDIRS) $(MSGDIRS):
$(INS.dir)
userheaders: FRC
@cd head; pwd; $(MAKE) install_h
libheaders: bldtools
@cd lib; pwd; $(MAKE) install_h
sysheaders: FRC
@cd uts; pwd; $(MAKE) install_h
cmdheaders: FRC
@cd cmd/fm; pwd; $(MAKE) install_h
@cd cmd/mdb; pwd; $(MAKE) install_h
check: $(CHKHDRSUBDIRS) $(CHKMFSTSUBDIRS) $(CHKMANSUBDIRS)
#
# Cross-reference customization: skip all of the subdirectories that
# don't contain actual source code.
#
XRPRUNE = pkg prototypes
XRINCDIRS = uts/common head ucbhead
cscope.out tags: FRC
$(XREF) -f -x $@
FRC:
#
# Targets for reporting compiler versions; nightly uses these.
#
cc-version:
@if $($(MACH)_CC) -_versions >/dev/null 2>/dev/null; then \
$(ECHO) 32-bit compiler; \
$(ECHO) $($(MACH)_CC); \
$($(MACH)_CC) -_versions 2>&1 | \
$(EGREP) '^(cw|cc|gcc|primary|shadow)'; \
else \
__COMPILER=`$($(MACH)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
if [ -z "$$__COMPILER" ]; then \
$(ECHO) No 32-bit compiler found; \
exit 1; \
else \
$(ECHO) 32-bit compiler; \
$(ECHO) $($(MACH)_CC); \
$(ECHO) $$__COMPILER; \
$($(MACH)_CC) -V 2>&1 | head -1; \
fi; \
fi
cc64-version:
@if $($(MACH64)_CC) -_versions >/dev/null 2>/dev/null; then \
$(ECHO) 64-bit compiler; \
$(ECHO) $($(MACH64)_CC); \
$($(MACH64)_CC) -_versions 2>&1 | \
$(EGREP) '^(cw|cc|gcc|primary|shadow)'; \
else \
__COMPILER=`$($(MACH64)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
if [ -z "$$__COMPILER" ]; then \
$(ECHO) No 64-bit compiler found; \
exit 1; \
else \
$(ECHO) 64-bit compiler; \
$(ECHO) $($(MACH64)_CC); \
$(ECHO) $$__COMPILER; \
$($(MACH64)_CC) -V 2>&1 | head -1; \
fi; \
fi
java-version:
@if [ -x "$(JAVAC)" ]; then \
$(ECHO) $(JAVAC); \
$(JAVA_ROOT)/bin/java -fullversion 2>&1 | head -1; \
else \
$(ECHO) No Java compiler found; \
exit 1; \
fi