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