xref: /titanic_52/usr/src/uts/Makefile (revision e373b6e444a487df89a5dc6a4a4030b5b2aa87f9)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5f4b3ec61Sdh155122# Common Development and Distribution License (the "License").
6f4b3ec61Sdh155122# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22148c5f43SAlan Wright# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23b6805bf7SGordon Ross# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# include global definitions
267c478bd9Sstevel@tonic-gateinclude ../Makefile.master
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate#
297c478bd9Sstevel@tonic-gate# List of architectures to build as part of the standard build.
307c478bd9Sstevel@tonic-gate#
3198157a70Sakolb# Some of these architectures are built in parallel (see i386_PARALLEL and
3298157a70Sakolb# sparc_PARALLEL). This requires building some parts first before parallel build
3398157a70Sakolb# can start. Platform make files know what should be built as a prerequisite for
3498157a70Sakolb# the parallel build to work. The i386_PREREQ and sparc_PREREQ variables tell
3598157a70Sakolb# which platform directory to enter to start making prerequisite dependencies.
367c478bd9Sstevel@tonic-gate#
377c478bd9Sstevel@tonic-gatesparc_ARCHITECTURES = sun4v sun4u sparc
387c478bd9Sstevel@tonic-gate
3998157a70Sakolbi386_ARCHITECTURES = i86pc i86xpv intel
4098157a70Sakolb
4198157a70Sakolb#
4298157a70Sakolb# For i386 all architectures can be compiled in parallel.
4398157a70Sakolb#
4498157a70Sakolb# intel/Makefile knows how to build prerequisites needed for parallel build.
4598157a70Sakolb#
4698157a70Sakolbi386_PREREQ = intel
4798157a70Sakolbi386_PARALLEL = $(i386_ARCHITECTURES)
4898157a70Sakolb
4998157a70Sakolb#
5098157a70Sakolb# For sparc all architectures can be compiled in parallel.
5198157a70Sakolb#
5298157a70Sakolb# sun4/Makefile knows how to build prerequisites needed for parallel build.
5398157a70Sakolb# can start.
5498157a70Sakolb#
5598157a70Sakolbsparc_PREREQ = sun4
5698157a70Sakolbsparc_PARALLEL = $(sparc_ARCHITECTURES)
5798157a70Sakolb
5898157a70Sakolb#
5998157a70Sakolb# Platforms defined in $(MACH)_PARALLEL are built in parallel. DUMMY is placed
6098157a70Sakolb# at the end in case $(MACH)_PARALLEL is empty to prevent everything going in
6198157a70Sakolb# parallel.
6298157a70Sakolb#
6398157a70Sakolb.PARALLEL: $($(MACH)_PARALLEL) DUMMY
6498157a70Sakolb
6598157a70Sakolb#
6698157a70Sakolb# For build prerequisites we use a special target which is constructed by adding
6798157a70Sakolb# '.prereq' suffix to the $(MACH)_PREREQ.
6898157a70Sakolb#
6998157a70SakolbPREREQ_TARGET = $($(MACH)_PREREQ:%=%.prereq)
7098157a70Sakolb
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gatedef		:=	TARGET= def
737c478bd9Sstevel@tonic-gateall		:=	TARGET= all
747c478bd9Sstevel@tonic-gateinstall		:=	TARGET= install
757c478bd9Sstevel@tonic-gateinstall_h	:=	TARGET= install_h
767c478bd9Sstevel@tonic-gateclean		:=	TARGET= clean
777c478bd9Sstevel@tonic-gateclobber		:=	TARGET= clobber
78b6805bf7SGordon Rossclobber_h	:=	TARGET= clobber
797c478bd9Sstevel@tonic-gatelint		:=	TARGET= lint
807c478bd9Sstevel@tonic-gateclean.lint	:=	TARGET= clean.lint
817c478bd9Sstevel@tonic-gatecheck		:=	TARGET= check
82fb9f9b97Skupfermodlist		:=	TARGET= modlist
83fb9f9b97Skupfermodlist		:=	NO_STATE= -K $$MODSTATE$$$$
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate.KEEP_STATE:
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gatedef all lint: all_h $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateinstall: all_h install_dirs $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gateinstall_dirs:
927c478bd9Sstevel@tonic-gate	@cd ..; pwd; $(MAKE) rootdirs
937c478bd9Sstevel@tonic-gate	@pwd
947c478bd9Sstevel@tonic-gate
9598157a70Sakolb#
9698157a70Sakolb# Rule to build prerequisites. The left part of the pattern will match
9798157a70Sakolb# PREREQ_TARGET.
9898157a70Sakolb#
9998157a70Sakolb# The location of the Makefile is determined by strippinng '.prereq' suffix from
10098157a70Sakolb# the target name. We add '.prereq' suffix to the target passed to the child
10198157a70Sakolb# Makefile so that it can distinguish prerequisite build from the regular one.
10298157a70Sakolb#
10398157a70Sakolb#
10498157a70Sakolb%.prereq:
10598157a70Sakolb	@cd $(@:%.prereq=%); pwd; $(MAKE) $(NO_STATE) $(TARGET).prereq
10698157a70Sakolb
10798157a70Sakolb#
10898157a70Sakolb# Rule to build architecture files. Build all required prerequisites and then
10998157a70Sakolb# build the rest (potentially in parallel).
11098157a70Sakolb#
11198157a70Sakolb$($(MACH)_ARCHITECTURES): $(PREREQ_TARGET) FRC
112fb9f9b97Skupfer	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gate$(PMTMO_FILE) pmtmo_file: $(PATCH_MAKEUP_TABLE)
1157c478bd9Sstevel@tonic-gate	@if [ -z "$(PATCH_MAKEUP_TABLE)" ] ; then \
1167c478bd9Sstevel@tonic-gate		echo 'ERROR: $$(PATCH_MAKEUP_TABLE) not set' \
1177c478bd9Sstevel@tonic-gate		    'in environment' >&2 ; \
1187c478bd9Sstevel@tonic-gate		exit 1 ; \
1197c478bd9Sstevel@tonic-gate	fi
1207c478bd9Sstevel@tonic-gate	RELEASE="$(RELEASE)" MACH="$(MACH)" \
1217c478bd9Sstevel@tonic-gate	    $(CTFCVTPTBL) -o $(PMTMO_FILE) $(PATCH_MAKEUP_TABLE)
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate#
1247c478bd9Sstevel@tonic-gate# The following is the list of directories which contain Makefiles with
1257c478bd9Sstevel@tonic-gate# targets to install header file. The machine independent headers are
1267c478bd9Sstevel@tonic-gate# installed by invoking the Makefile in the directory containing the
1277c478bd9Sstevel@tonic-gate# header files. Machine and architecture dependent headers are installed
1287c478bd9Sstevel@tonic-gate# by invoking the main makefile for that architecture/machine which,
1297c478bd9Sstevel@tonic-gate# in turn, is responsible for invoking the Makefiles which install headers.
1307c478bd9Sstevel@tonic-gate# It is done this way so as not to assume that all of the header files in
1317c478bd9Sstevel@tonic-gate# the architecture/machine dependent subdirectories are in completely
1327c478bd9Sstevel@tonic-gate# isomorphic locations.
1337c478bd9Sstevel@tonic-gate#
134fcf3ce44SJohn ForteCOMMON_HDRDIRS= common/avs \
135fcf3ce44SJohn Forte		common/c2 \
136fcf3ce44SJohn Forte		common/des \
137fcf3ce44SJohn Forte		common/fs \
138fcf3ce44SJohn Forte		common/gssapi \
139fcf3ce44SJohn Forte		common/idmap \
140bbaa8b60SDan Kruchinin		common/klm \
141fcf3ce44SJohn Forte		common/inet \
142fcf3ce44SJohn Forte		common/inet/ipf/netinet \
143fcf3ce44SJohn Forte		common/inet/kssl \
144fcf3ce44SJohn Forte		common/inet/nca \
1450a0e9771SDarren Reed		common/inet/sockmods/netpacket \
1460a0e9771SDarren Reed		common/io/bpf/net \
147b6805bf7SGordon Ross		common/io/fibre-channel/fca/qlc \
148fcf3ce44SJohn Forte		common/ipp \
149fcf3ce44SJohn Forte		common/net \
150fcf3ce44SJohn Forte		common/netinet \
151fcf3ce44SJohn Forte		common/nfs \
152fcf3ce44SJohn Forte		common/pcmcia/sys \
153fcf3ce44SJohn Forte		common/rpc \
154fcf3ce44SJohn Forte		common/rpcsvc \
155fcf3ce44SJohn Forte		common/sharefs \
156148c5f43SAlan Wright		common/smb \
157fcf3ce44SJohn Forte		common/smbsrv \
158fcf3ce44SJohn Forte		common/sys \
159fcf3ce44SJohn Forte		common/vm
160fcf3ce44SJohn Forte
161f4b3ec61Sdh155122
1629b214d32SJordan Brown#
1639b214d32SJordan Brown# Subset of COMMON_HDRDIRS in which at least one header is generated
164bbaa8b60SDan Kruchinin# at runtime (e.g., rpcgen), and in which "make clean" should run.
165bbaa8b60SDan Kruchinin# Other directories should be included here, but do not yet have the
166bbaa8b60SDan Kruchinin# necessary Makefile support (make clean).  See 6414855.
1679b214d32SJordan Brown#
168b6805bf7SGordon RossDYNHDRDIRS =	common/avs \
169b6805bf7SGordon Ross		common/gssapi \
170b6805bf7SGordon Ross		common/idmap \
171b6805bf7SGordon Ross		common/io/fibre-channel/fca/qlc \
172bbaa8b60SDan Kruchinin		common/klm \
173b6805bf7SGordon Ross		common/rpc \
174bbaa8b60SDan Kruchinin		common/rpcsvc \
175bbaa8b60SDan Kruchinin		common/sys
1769b214d32SJordan Brown
1777c478bd9Sstevel@tonic-gatesparc_HDRDIRS= sun/sys
178843e1988Sjohnlevi386_HDRDIRS= i86pc/vm i86xpv/vm
1797c478bd9Sstevel@tonic-gate
1807c478bd9Sstevel@tonic-gateHDRDIRS= $(COMMON_HDRDIRS) $($(MACH)_HDRDIRS)
1817c478bd9Sstevel@tonic-gateinstall_h check: $(HDRDIRS) $($(MACH)_ARCHITECTURES)
1827c478bd9Sstevel@tonic-gate
1837c478bd9Sstevel@tonic-gate$(HDRDIRS): FRC
1847c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1857c478bd9Sstevel@tonic-gate
1867c478bd9Sstevel@tonic-gate# ensures that headers made by rpcgen and others are available in uts source
1877c478bd9Sstevel@tonic-gate# for kernel builds to reference without building install_h
1887c478bd9Sstevel@tonic-gate#
1897c478bd9Sstevel@tonic-gateall_h: FRC
1907c478bd9Sstevel@tonic-gate	@cd common/sys; pwd; $(MAKE) $@
1917c478bd9Sstevel@tonic-gate	@cd common/rpc; pwd; $(MAKE) $@
1927c478bd9Sstevel@tonic-gate	@cd common/rpcsvc; pwd; $(MAKE) $@
1937c478bd9Sstevel@tonic-gate	@cd common/gssapi; pwd; $(MAKE) $@
194c5c4113dSnw141292	@cd common/idmap; pwd; $(MAKE) $@
195bbaa8b60SDan Kruchinin	@cd common/klm; pwd; $(MAKE) $@
1967c478bd9Sstevel@tonic-gate
1979b214d32SJordan Brownclean clobber: $($(MACH)_ARCHITECTURES) $(DYNHDRDIRS)
1989b214d32SJordan Brown	@if [ '$(PATCH_BUILD)' != '#' ] ; then \
1999b214d32SJordan Brown		echo $(RM) $(PMTMO_FILE) ; \
2009b214d32SJordan Brown		$(RM) $(PMTMO_FILE) ; \
2019b214d32SJordan Brown	fi
2029b214d32SJordan Brown
203b6805bf7SGordon Ross# testing convenience
204b6805bf7SGordon Rossclobber_h: $(DYNHDRDIRS)
2059b214d32SJordan Brown
2069b214d32SJordan Brownclean.lint modlist: $($(MACH)_ARCHITECTURES)
2079b214d32SJordan Brown
2087c478bd9Sstevel@tonic-gate#
2097c478bd9Sstevel@tonic-gate# Cross-reference customization: build a cross-reference over all of
2107c478bd9Sstevel@tonic-gate# the supported architectures.  Although there's no correct way to set
2117c478bd9Sstevel@tonic-gate# the include path (since we don't know what architecture is the one
2127c478bd9Sstevel@tonic-gate# the user will be interested in), it's historically been set to
2137c478bd9Sstevel@tonic-gate# mirror the $(XRDIRS) list, and that works kinda sorta okay.
2147c478bd9Sstevel@tonic-gate#
215*c0e7977aSJosef 'Jeff' SipekXRDIRS = $(sparc_ARCHITECTURES) $(i386_ARCHITECTURES) sun4 sfmmu	\
216fb9f9b97Skupfer	sun common
217fb9f9b97Skupfer
2187c478bd9Sstevel@tonic-gateXRINCDIRS = $(XRDIRS)
2197c478bd9Sstevel@tonic-gate
2207c478bd9Sstevel@tonic-gatecscope.out tags: FRC
2217c478bd9Sstevel@tonic-gate	$(XREF) -x $@
2227c478bd9Sstevel@tonic-gate
2237c478bd9Sstevel@tonic-gateFRC:
224