xref: /titanic_44/usr/src/uts/sun4u/genunix/Makefile (revision 1e4c938b57d1656808e4112127ff1dce3eba5314)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
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)/%)
56
57#
58#	Include common rules.
59#
60include $(UTSBASE)/sparc/Makefile.sparc
61
62#
63#	Define targets
64#
65ALL_TARGET	= $(LIBGEN)
66LINT_TARGET	= $(MODULE).lint
67INSTALL_TARGET	= $(GENUNIX) $(ROOTMODULE)
68
69#
70#	Override defaults
71#
72CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
73
74LINT_LIB_DIR	= $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
75LINT_LIB	= $(LINT_LIB_DIR)/llib-lunix.ln
76GEN_LINT_LIB	=
77
78BINARY		=
79
80CLOBBERFILES	+= $(GENUNIX)
81
82#
83# Non-patch genunix builds merge a version of the ip module called ipctf.  This
84# is to ensure that the common network-related types are included in genunix and
85# can thus be uniquified out of other modules.  We don't want to do this for
86# patch builds, since we can't guarantee that ip and genunix will be in the same
87# patch.
88#
89IPCTF_TARGET	= $(IPCTF)
90$(PATCH_BUILD)IPCTF_TARGET =
91
92#
93# lint pass one enforcement
94#
95CFLAGS += $(CCVERBOSE)
96CPPFLAGS += -I$(SRC)/common
97CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
98
99INC_PATH +=  -I$(UTSBASE)/sun4
100
101#
102# For now, disable these lint checks; maintainers should endeavor
103# to investigate and remove these for maximum lint coverage.
104# Please do not carry these forward to new Makefiles.
105#
106LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
107LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
108LINTTAGS	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
109LINTTAGS	+= -erroff=E_STATIC_UNUSED
110LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
111LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
112
113#
114# Ensure that lint sees 'struct cpu' containing a fully declared
115# embedded 'struct machcpu'
116#
117LINTFLAGS	+= -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu
118
119#	Default build targets.
120#
121.KEEP_STATE:
122
123.PARALLEL:	$(LIBSTUBS)
124
125def:		$(DEF_DEPS)
126
127all:		$(ALL_DEPS)
128
129clean:		$(CLEAN_DEPS)
130
131clobber:	$(CLOBBER_DEPS)
132
133lint:		$(LINT_DEPS)
134
135modlintlib:	$(MODLINTLIB_DEPS)
136
137clean.lint:	$(CLEAN_LINT_DEPS)
138
139install:  	$(INSTALL_DEPS)
140
141install_h:
142
143
144$(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
145	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
146
147$(IPCTF_TARGET) ipctf_target: FRC
148	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
149	@pwd
150
151$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
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 sun4u workarounds.
165#
166include $(UTSBASE)/sun4u/Makefile.workarounds
167
168ALL_DEFS +=	$(WORKAROUND_DEFS)
169