xref: /titanic_52/usr/src/uts/sun4u/genunix/Makefile (revision 84ab085a13f931bc78e7415e7ce921dbaa14fcb3)
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#	This makefile drives the production of the generic
29#	unix kernel module.
30#
31#	sparc implementation architecture dependent
32#
33
34#
35#	Path to the base of the uts directory tree (usually /usr/src/uts).
36#
37UTSBASE	= ../..
38
39#
40#	Define the module and object file sets.
41#
42MODULE		= genunix
43GENUNIX		= $(OBJS_DIR)/$(MODULE)
44
45OBJECTS		= $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
46		  $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
47
48LINTS		= $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
49		  $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
50
51ROOTMODULE	= $(ROOT_PSM_KERN_DIR)/$(MODULE)
52
53PLATFORM	= sun4u
54LIBGEN		= $(OBJS_DIR)/libgenunix.so
55LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
56SONAME		= $(MODULE)
57
58#
59#	Include common rules.
60#
61include $(UTSBASE)/sparc/Makefile.sparc
62
63#
64#	Define targets
65#
66ALL_TARGET	= $(LIBGEN)
67LINT_TARGET	= $(MODULE).lint
68INSTALL_TARGET	= $(GENUNIX) $(ROOTMODULE)
69
70#
71#	Override defaults
72#
73CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
74
75LINT_LIB_DIR	= $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
76LINT_LIB	= $(LINT_LIB_DIR)/llib-lunix.ln
77GEN_LINT_LIB	=
78
79BINARY		=
80
81CLOBBERFILES	+= $(GENUNIX)
82
83#
84# Non-patch genunix builds merge a version of the ip module called ipctf.  This
85# is to ensure that the common network-related types are included in genunix and
86# can thus be uniquified out of other modules.  We don't want to do this for
87# patch builds, since we can't guarantee that ip and genunix will be in the same
88# patch.
89#
90IPCTF_TARGET	= $(IPCTF)
91$(PATCH_BUILD)IPCTF_TARGET =
92
93#
94# lint pass one enforcement
95#
96CFLAGS += $(CCVERBOSE)
97CPPFLAGS += -I$(SRC)/common
98
99#
100#	Default build targets.
101#
102.KEEP_STATE:
103
104.PARALLEL:	$(LIBSTUBS)
105
106def:		$(DEF_DEPS)
107
108all:		$(ALL_DEPS)
109
110clean:		$(CLEAN_DEPS)
111
112clobber:	$(CLOBBER_DEPS)
113
114lint:		$(LINT_DEPS)
115
116modlintlib:	$(MODLINTLIB_DEPS)
117
118clean.lint:	$(CLEAN_LINT_DEPS)
119
120install:  	$(INSTALL_DEPS)
121
122$(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
123	$(LD) -o $@ -G -h $(SONAME) $(GENUNIX) $(LIBSTUBS)
124
125$(IPCTF_TARGET) ipctf_target: FRC
126	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
127	@pwd
128
129$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
130	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
131	$(CTFMERGE_GENUNIX_MERGE)
132	$(POST_PROCESS)
133
134$(OBJECTS): $(OBJS_DIR)
135
136#
137#	Include common targets.
138#
139include $(UTSBASE)/sparc/Makefile.targ
140
141#
142#	Include sun4u workarounds.
143#
144include $(UTSBASE)/sun4u/Makefile.workarounds
145
146ALL_DEFS +=	$(WORKAROUND_DEFS)
147