xref: /illumos-gate/usr/src/uts/Makefile (revision 168c213023b7f347f11abfc72f448b0c621ab718)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27# include global definitions
28include ../Makefile.master
29
30#
31# List of architectures to build as part of the standard build.
32#
33# Note that sparc must trail the individual platforms so that sparc
34# lint targets will have the unix lint libraries to compare against.
35#
36sparc_ARCHITECTURES = sun4v sun4u sparc
37
38i386_ARCHITECTURES = i86pc
39i386_ARCHITECTURES += intel
40
41def		:=	TARGET= def
42all		:=	TARGET= all
43install		:=	TARGET= install
44install_h	:=	TARGET= install_h
45clean		:=	TARGET= clean
46clobber		:=	TARGET= clobber
47lint		:=	TARGET= lint
48clean.lint	:=	TARGET= clean.lint
49check		:=	TARGET= check
50modlist		:=	TARGET= modlist
51modlist		:=	NO_STATE= -K $$MODSTATE$$$$
52
53.KEEP_STATE:
54
55def all lint: all_h $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
56
57install: all_h install_dirs $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
58
59clean clobber: $($(MACH)_ARCHITECTURES)
60	@if [ '$(PATCH_BUILD)' != '#' ] ; then \
61		echo $(RM) $(PMTMO_FILE) ; \
62		$(RM) $(PMTMO_FILE) ; \
63	fi
64
65clean.lint modlist: $($(MACH)_ARCHITECTURES)
66
67install_dirs:
68	@cd ..; pwd; $(MAKE) rootdirs
69	@pwd
70
71$($(MACH)_ARCHITECTURES): FRC
72	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
73
74$(PMTMO_FILE) pmtmo_file: $(PATCH_MAKEUP_TABLE)
75	@if [ -z "$(PATCH_MAKEUP_TABLE)" ] ; then \
76		echo 'ERROR: $$(PATCH_MAKEUP_TABLE) not set' \
77		    'in environment' >&2 ; \
78		exit 1 ; \
79	fi
80	RELEASE="$(RELEASE)" MACH="$(MACH)" \
81	    $(CTFCVTPTBL) -o $(PMTMO_FILE) $(PATCH_MAKEUP_TABLE)
82
83#
84# The following is the list of directories which contain Makefiles with
85# targets to install header file. The machine independent headers are
86# installed by invoking the Makefile in the directory containing the
87# header files. Machine and architecture dependent headers are installed
88# by invoking the main makefile for that architecture/machine which,
89# in turn, is responsible for invoking the Makefiles which install headers.
90# It is done this way so as not to assume that all of the header files in
91# the architecture/machine dependent subdirectories are in completely
92# isomorphic locations.
93#
94COMMON_HDRDIRS= common/des common/fs common/gssapi common/inet common/net \
95	common/netinet common/nfs common/rpc common/sys common/vm \
96	common/c2 common/pcmcia/sys common/rpcsvc common/inet/kssl \
97	common/inet/nca common/inet/ipf/netinet common/ipp
98
99# These aren't the only headers in closed.  But the other directories
100# are simple enough that they can be driven from the src tree.
101$(CLOSED_BUILD)COMMON_HDRDIRS += $(CLOSED)/uts/common/sys
102
103sparc_HDRDIRS= sun/sys
104i386_HDRDIRS= i86pc/vm
105
106HDRDIRS= $(COMMON_HDRDIRS) $($(MACH)_HDRDIRS)
107install_h check: $(HDRDIRS) $($(MACH)_ARCHITECTURES)
108
109$(HDRDIRS): FRC
110	@cd $@; pwd; $(MAKE) $(TARGET)
111
112# ensures that headers made by rpcgen and others are available in uts source
113# for kernel builds to reference without building install_h
114#
115all_h: FRC
116	@cd common/sys; pwd; $(MAKE) $@
117	@cd common/rpc; pwd; $(MAKE) $@
118	@cd common/rpcsvc; pwd; $(MAKE) $@
119	@cd common/gssapi; pwd; $(MAKE) $@
120
121ONC_FILES=	common/io/timod.c \
122		common/os/sig.c \
123		common/os/flock.c \
124		common/os/sysent.c \
125		common/os/swapgeneric.c \
126		common/syscall/fcntl.c
127
128# edit onc plus source files.
129ONC_PLUS:	$(ONC_FILES:%=%_onc_plus)
130
131#
132# Cross-reference customization: build a cross-reference over all of
133# the supported architectures.  Although there's no correct way to set
134# the include path (since we don't know what architecture is the one
135# the user will be interested in), it's historically been set to
136# mirror the $(XRDIRS) list, and that works kinda sorta okay.
137#
138SHARED_XRDIRS = $(sparc_ARCHITECTURES) $(i386_ARCHITECTURES) sun4 sfmmu	\
139	sun common
140CLOSED_XRDIRS = $(SHARED_XRDIRS:%=% ../../closed/uts/%)
141XRDIRS = $(SHARED_XRDIRS)
142$(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS:../../closed/uts/sfmmu=)
143
144XRINCDIRS = $(XRDIRS)
145
146cscope.out tags: FRC
147	$(XREF) -x $@
148
149FRC:
150