xref: /titanic_52/usr/src/uts/sun4u/genunix/Makefile (revision 1b34bc4aa5ecbd590d45845d21c8478049df6dcf)
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#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29#
30#	This makefile drives the production of the generic
31#	unix kernel module.
32#
33#	sparc implementation architecture dependent
34#
35
36#
37#	Path to the base of the uts directory tree (usually /usr/src/uts).
38#
39UTSBASE	= ../..
40
41#
42#	Define the module and object file sets.
43#
44MODULE		= genunix
45GENUNIX		= $(OBJS_DIR)/$(MODULE)
46
47OBJECTS		= $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
48		  $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
49
50LINTS		= $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
51		  $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
52
53ROOTMODULE	= $(ROOT_PSM_KERN_DIR)/$(MODULE)
54
55PLATFORM	= sun4u
56LIBGEN		= $(OBJS_DIR)/libgenunix.so
57LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
58
59#
60#	Include common rules.
61#
62include $(UTSBASE)/sparc/Makefile.sparc
63
64#
65#	Define targets
66#
67ALL_TARGET	= $(LIBGEN)
68LINT_TARGET	= $(MODULE).lint
69INSTALL_TARGET	= $(GENUNIX) $(ROOTMODULE)
70
71#
72#	Override defaults
73#
74CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
75
76LINT_LIB_DIR	= $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
77LINT_LIB	= $(LINT_LIB_DIR)/llib-lunix.ln
78GEN_LINT_LIB	=
79
80BINARY		=
81
82CLOBBERFILES	+= $(GENUNIX)
83
84#
85# Non-patch genunix builds merge a version of the ip module called ipctf.  This
86# is to ensure that the common network-related types are included in genunix and
87# can thus be uniquified out of other modules.  We don't want to do this for
88# patch builds, since we can't guarantee that ip and genunix will be in the same
89# patch.
90#
91IPCTF_TARGET	= $(IPCTF)
92$(PATCH_BUILD)IPCTF_TARGET =
93
94#
95# lint pass one enforcement
96#
97CFLAGS += $(CCVERBOSE)
98CPPFLAGS += -I$(SRC)/common
99
100#
101# For now, disable these lint checks; maintainers should endeavor
102# to investigate and remove these for maximum lint coverage.
103# Please do not carry these forward to new Makefiles.
104#
105LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
106LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
107LINTTAGS	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
108LINTTAGS	+= -erroff=E_STATIC_UNUSED
109LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
110LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
111
112#
113#	Default build targets.
114#
115.KEEP_STATE:
116
117.PARALLEL:	$(LIBSTUBS)
118
119def:		$(DEF_DEPS)
120
121all:		$(ALL_DEPS)
122
123clean:		$(CLEAN_DEPS)
124
125clobber:	$(CLOBBER_DEPS)
126
127lint:		$(LINT_DEPS)
128
129modlintlib:	$(MODLINTLIB_DEPS)
130
131clean.lint:	$(CLEAN_LINT_DEPS)
132
133install:  	$(INSTALL_DEPS)
134
135install_h:
136
137
138$(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
139	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
140
141$(IPCTF_TARGET) ipctf_target: FRC
142	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
143	@pwd
144
145$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
146	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
147	$(CTFMERGE_GENUNIX_MERGE)
148	$(POST_PROCESS)
149
150$(OBJECTS): $(OBJS_DIR)
151
152#
153#	Include common targets.
154#
155include $(UTSBASE)/sparc/Makefile.targ
156
157#
158#	Include sun4u workarounds.
159#
160include $(UTSBASE)/sun4u/Makefile.workarounds
161
162ALL_DEFS +=	$(WORKAROUND_DEFS)
163