765N/A#
961N/A# CDDL HEADER START
765N/A#
765N/A# The contents of this file are subject to the terms of the
765N/A# Common Development and Distribution License (the "License").
765N/A# You may not use this file except in compliance with the License.
765N/A#
765N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
765N/A# or http://www.opensolaris.org/os/licensing.
765N/A# See the License for the specific language governing permissions
765N/A# and limitations under the License.
765N/A#
765N/A# When distributing Covered Code, include this CDDL HEADER in each
765N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
765N/A# If applicable, add the following below this CDDL HEADER, with the
765N/A# fields enclosed by brackets "[]" replaced with your own identifying
765N/A# information: Portions Copyright [yyyy] [name of copyright owner]
765N/A#
765N/A# CDDL HEADER END
765N/A#
765N/A#
765N/A# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
765N/A# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
765N/A#
765N/A# include global definitions
765N/Ainclude ../Makefile.master
765N/A
765N/A#
765N/A# List of architectures to build as part of the standard build.
765N/A#
765N/A# Some of these architectures are built in parallel (see i386_PARALLEL and
765N/A# sparc_PARALLEL). This requires building some parts first before parallel build
765N/A# can start. Platform make files know what should be built as a prerequisite for
765N/A# the parallel build to work. The i386_PREREQ and sparc_PREREQ variables tell
765N/A# which platform directory to enter to start making prerequisite dependencies.
765N/A#
765N/Asparc_ARCHITECTURES = sun4v sun4u sparc
765N/A
765N/Ai386_ARCHITECTURES = i86pc i86xpv intel
765N/A
765N/A#
765N/A# For i386 all architectures can be compiled in parallel.
765N/A#
765N/A# intel/Makefile knows how to build prerequisites needed for parallel build.
765N/A#
765N/Ai386_PREREQ = intel
765N/Ai386_PARALLEL = $(i386_ARCHITECTURES)
765N/A
765N/A#
765N/A# For sparc all architectures can be compiled in parallel.
765N/A#
765N/A# sun4/Makefile knows how to build prerequisites needed for parallel build.
765N/A# can start.
765N/A#
765N/Asparc_PREREQ = sun4
765N/Asparc_PARALLEL = $(sparc_ARCHITECTURES)
765N/A
765N/A#
765N/A# Platforms defined in $(MACH)_PARALLEL are built in parallel. DUMMY is placed
765N/A# at the end in case $(MACH)_PARALLEL is empty to prevent everything going in
765N/A# parallel.
765N/A#
765N/A.PARALLEL: $($(MACH)_PARALLEL) DUMMY
765N/A
765N/A#
765N/A# For build prerequisites we use a special target which is constructed by adding
765N/A# '.prereq' suffix to the $(MACH)_PREREQ.
765N/A#
765N/APREREQ_TARGET = $($(MACH)_PREREQ:%=%.prereq)
765N/A
765N/A
765N/Adef := TARGET= def
765N/Aall := TARGET= all
765N/Ainstall := TARGET= install
765N/Ainstall_h := TARGET= install_h
765N/Aclean := TARGET= clean
765N/Aclobber := TARGET= clobber
765N/Aclobber_h := TARGET= clobber
765N/Alint := TARGET= lint
765N/Aclean.lint := TARGET= clean.lint
765N/Acheck := TARGET= check
765N/Amodlist := TARGET= modlist
765N/Amodlist := NO_STATE= -K $$MODSTATE$$$$
765N/A
765N/A.KEEP_STATE:
765N/A
765N/Adef all lint: all_h $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
765N/A
765N/Ainstall: all_h install_dirs $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
765N/A
765N/Ainstall_dirs:
765N/A @cd ..; pwd; $(MAKE) rootdirs
765N/A @pwd
765N/A
765N/A#
765N/A# Rule to build prerequisites. The left part of the pattern will match
765N/A# PREREQ_TARGET.
765N/A#
765N/A# The location of the Makefile is determined by strippinng '.prereq' suffix from
765N/A# the target name. We add '.prereq' suffix to the target passed to the child
765N/A# Makefile so that it can distinguish prerequisite build from the regular one.
818N/A#
818N/A#
818N/A%.prereq:
818N/A @cd $(@:%.prereq=%); pwd; $(MAKE) $(NO_STATE) $(TARGET).prereq
818N/A
818N/A#
818N/A# Rule to build architecture files. Build all required prerequisites and then
818N/A# build the rest (potentially in parallel).
818N/A#
818N/A$($(MACH)_ARCHITECTURES): $(PREREQ_TARGET) FRC
818N/A @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
818N/A
818N/A$(PMTMO_FILE) pmtmo_file: $(PATCH_MAKEUP_TABLE)
818N/A @if [ -z "$(PATCH_MAKEUP_TABLE)" ] ; then \
818N/A echo 'ERROR: $$(PATCH_MAKEUP_TABLE) not set' \
818N/A 'in environment' >&2 ; \
818N/A exit 1 ; \
818N/A fi
818N/A RELEASE="$(RELEASE)" MACH="$(MACH)" \
765N/A $(CTFCVTPTBL) -o $(PMTMO_FILE) $(PATCH_MAKEUP_TABLE)
765N/A
#
# The following is the list of directories which contain Makefiles with
# targets to install header file. The machine independent headers are
# installed by invoking the Makefile in the directory containing the
# header files. Machine and architecture dependent headers are installed
# by invoking the main makefile for that architecture/machine which,
# in turn, is responsible for invoking the Makefiles which install headers.
# It is done this way so as not to assume that all of the header files in
# the architecture/machine dependent subdirectories are in completely
# isomorphic locations.
#
COMMON_HDRDIRS= common/avs \
common/c2 \
common/des \
common/fs \
common/gssapi \
common/idmap \
common/klm \
common/inet \
common/inet/ipf/netinet \
common/inet/kssl \
common/inet/nca \
common/inet/sockmods/netpacket \
common/io/bpf/net \
common/io/fibre-channel/fca/qlc \
common/io/lvm/md \
common/ipp \
common/net \
common/netinet \
common/nfs \
common/pcmcia/sys \
common/rpc \
common/rpcsvc \
common/sharefs \
common/smb \
common/smbsrv \
common/sys \
common/vm
#
# Subset of COMMON_HDRDIRS in which at least one header is generated
# at runtime (e.g., rpcgen), and in which "make clean" should run.
# Other directories should be included here, but do not yet have the
# necessary Makefile support (make clean). See 6414855.
#
DYNHDRDIRS = common/avs \
common/gssapi \
common/idmap \
common/io/fibre-channel/fca/qlc \
common/io/lvm/md \
common/klm \
common/rpc \
common/rpcsvc \
common/sys
sparc_HDRDIRS= sun/sys
i386_HDRDIRS= i86pc/vm i86xpv/vm
HDRDIRS= $(COMMON_HDRDIRS) $($(MACH)_HDRDIRS)
install_h check: $(HDRDIRS) $($(MACH)_ARCHITECTURES)
$(HDRDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
# ensures that headers made by rpcgen and others are available in uts source
# for kernel builds to reference without building install_h
#
all_h: FRC
@cd common/sys; pwd; $(MAKE) $@
@cd common/rpc; pwd; $(MAKE) $@
@cd common/rpcsvc; pwd; $(MAKE) $@
@cd common/gssapi; pwd; $(MAKE) $@
@cd common/idmap; pwd; $(MAKE) $@
@cd common/klm; pwd; $(MAKE) $@
clean clobber: $($(MACH)_ARCHITECTURES) $(DYNHDRDIRS)
@if [ '$(PATCH_BUILD)' != '#' ] ; then \
echo $(RM) $(PMTMO_FILE) ; \
$(RM) $(PMTMO_FILE) ; \
fi
# testing convenience
clobber_h: $(DYNHDRDIRS)
clean.lint modlist: $($(MACH)_ARCHITECTURES)
#
# Cross-reference customization: build a cross-reference over all of
# the supported architectures. Although there's no correct way to set
# the include path (since we don't know what architecture is the one
# the user will be interested in), it's historically been set to
# mirror the $(XRDIRS) list, and that works kinda sorta okay.
#
XRDIRS = $(sparc_ARCHITECTURES) $(i386_ARCHITECTURES) sun4 sfmmu \
sun common
XRINCDIRS = $(XRDIRS)
cscope.out tags: FRC
$(XREF) -x $@
FRC: