Makefile revision 0a0e9771ca0211c15f3ac4466b661c145feeb9e4
6c2a76b3e2ccd32c35814b6e0f54da00190749d7Evan Hunt# CDDL HEADER START
c7fd128f8ea8a527fe27c1b95ab46df7155bc8e4Tinderbox User# The contents of this file are subject to the terms of the
c7fd128f8ea8a527fe27c1b95ab46df7155bc8e4Tinderbox User# Common Development and Distribution License (the "License").
ba9e87b35e561bc7354ce3f4b9685b747b7be507Tinderbox User# You may not use this file except in compliance with the License.
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews# See the License for the specific language governing permissions
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# and limitations under the License.
0726d872f6f36901ea09321df57084614e5bb6faTinderbox User# When distributing Covered Code, include this CDDL HEADER in each
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a2c370ca12bb0360ff7e969474ead3f788c65fffTinderbox User# If applicable, add the following below this CDDL HEADER, with the
8de3f14f1c300c3e1ed99084cc03485b42c92bf1Tinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# CDDL HEADER END
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Use is subject to license terms.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# include global definitions
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# List of architectures to build as part of the standard build.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Some of these architectures are built in parallel (see i386_PARALLEL and
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# sparc_PARALLEL). This requires building some parts first before parallel build
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# can start. Platform make files know what should be built as a prerequisite for
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# the parallel build to work. The i386_PREREQ and sparc_PREREQ variables tell
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# which platform directory to enter to start making prerequisite dependencies.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# For i386 all architectures can be compiled in parallel.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# intel/Makefile knows how to build prerequisites needed for parallel build.
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# For sparc all architectures can be compiled in parallel.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# sun4/Makefile knows how to build prerequisites needed for parallel build.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Platforms defined in $(MACH)_PARALLEL are built in parallel. DUMMY is placed
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# at the end in case $(MACH)_PARALLEL is empty to prevent everything going in
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater# For build prerequisites we use a special target which is constructed by adding
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# '.prereq' suffix to the $(MACH)_PREREQ.
b378314925e78f21853a98cec924788ce1822c6cTinderbox Userdef all lint: all_h $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrewsinstall: all_h install_dirs $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
7cc0a5d21ef046bfd630c4769943d896a7d7472cTinderbox User# Rule to build prerequisites. The left part of the pattern will match
3ccf87473f7cf6d9faac156df38a935a238f96fdTinderbox User# PREREQ_TARGET.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# The location of the Makefile is determined by strippinng '.prereq' suffix from
551e6d2414c4f47d58a9bb0b37f206f915a4f5acTinderbox User# the target name. We add '.prereq' suffix to the target passed to the child
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Makefile so that it can distinguish prerequisite build from the regular one.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User @cd $(@:%.prereq=%); pwd; $(MAKE) $(NO_STATE) $(TARGET).prereq
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Rule to build architecture files. Build all required prerequisites and then
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# build the rest (potentially in parallel).
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User echo 'ERROR: $$(PATCH_MAKEUP_TABLE) not set' \
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User $(CTFCVTPTBL) -o $(PMTMO_FILE) $(PATCH_MAKEUP_TABLE)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# The following is the list of directories which contain Makefiles with
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# targets to install header file. The machine independent headers are
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# installed by invoking the Makefile in the directory containing the
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# header files. Machine and architecture dependent headers are installed
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# by invoking the main makefile for that architecture/machine which,
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# in turn, is responsible for invoking the Makefiles which install headers.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# It is done this way so as not to assume that all of the header files in
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# the architecture/machine dependent subdirectories are in completely
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# isomorphic locations.
b378314925e78f21853a98cec924788ce1822c6cTinderbox User# These aren't the only headers in closed. But the other directories
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# are simple enough that they can be driven from the src tree.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews$(CLOSED_BUILD)COMMON_HDRDIRS += $(CLOSED)/uts/common/sys
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Subset of COMMON_HDRDIRS in which at least one header is generated
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews# at runtime (e.g., rpcgen). (This is a partial list; there are
b625bdae12277225b076a002dd4af80902529181Tinderbox User# other directories that should be included and do not yet have the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# necessary Makefile support. See 6414855.)
2b7254075b883d70852a2757210793603085a0f1Tinderbox UserDYNHDRDIRS = common/rpcsvc common/idmap common/sys
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsinstall_h check: $(HDRDIRS) $($(MACH)_ARCHITECTURES)
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# ensures that headers made by rpcgen and others are available in uts source
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# for kernel builds to reference without building install_h
415d630b6309922caee8469384a6fab75cf05032Mark Andrewsclean clobber: $($(MACH)_ARCHITECTURES) $(DYNHDRDIRS)
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# edit onc plus source files.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# Cross-reference customization: build a cross-reference over all of
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# the supported architectures. Although there's no correct way to set
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# the include path (since we don't know what architecture is the one
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# the user will be interested in), it's historically been set to
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# mirror the $(XRDIRS) list, and that works kinda sorta okay.
5f7586ddbd3edd11272cdd30ed613d936129328bTinderbox User# We need to manually prune usr/closed/uts/{i86xpv|sfmmu|i86pc} since
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# none of them exist.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox UserSHARED_XRDIRS = $(sparc_ARCHITECTURES) $(i386_ARCHITECTURES) sun4 sfmmu \
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox UserCLOSED_XRDIRS = $(SHARED_XRDIRS:%=% ../../closed/uts/%)
5affecff6e148a8e124d03f5dbac0da11e30dcc5Tinderbox UserCLOSED_XRDIRS_XEN = $(CLOSED_XRDIRS:../../closed/uts/i86xpv=)
5affecff6e148a8e124d03f5dbac0da11e30dcc5Tinderbox UserCLOSED_XRDIRS_1 = $(CLOSED_XRDIRS_XEN:../../closed/uts/i86pc=)