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