xref: /illumos-gate/usr/src/uts/intel/genunix/Makefile (revision e2f4f3dab373b605b62ac175115f264a5c417eb6)
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#	x86 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_KERN_DIR)/$(MODULE)
52
53LIBGEN		= $(OBJS_DIR)/libgenunix.so
54LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
55
56#
57#	Include common rules.
58#
59include $(UTSBASE)/intel/Makefile.intel
60
61#
62#	Define targets
63#
64ALL_TARGET	= $(LIBGEN) $(GENUNIX)
65LINT_TARGET	= $(MODULE).lint
66INSTALL_TARGET	= $(LIBGEN) $(GENUNIX) $(ROOTMODULE)
67
68#
69#	Overrides
70#
71CLOBBERFILES	+= $(GENUNIX)
72CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
73BINARY		=
74
75#
76# Non-patch genunix builds merge a version of the ip module called ipctf.  This
77# is to ensure that the common network-related types are included in genunix and
78# can thus be uniquified out of other modules.  We don't want to do this for
79# patch builds, since we can't guarantee that ip and genunix will be in the same
80# patch.
81#
82IPCTF_TARGET	= $(IPCTF)
83$(PATCH_BUILD)IPCTF_TARGET =
84
85CPPFLAGS	+= -I$(SRC)/common
86CPPFLAGS	+= -I$(SRC)/uts/common/fs/zfs
87
88CPPFLAGS	+= -I$(UTSBASE)/i86pc
89
90#
91# For now, disable these lint checks; maintainers should endeavor
92# to investigate and remove these for maximum lint coverage.
93# Please do not carry these forward to new Makefiles.
94#
95LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
96LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
97LINTTAGS	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
98LINTTAGS	+= -erroff=E_STATIC_UNUSED
99LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
100LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
101
102CERRWARN	+= -_gcc=-Wno-unused-label
103CERRWARN	+= -_gcc=-Wno-unused-variable
104CERRWARN	+= -_gcc=-Wno-unused-value
105CERRWARN	+= -_gcc=-Wno-unused-function
106CERRWARN	+= -_gcc=-Wno-parentheses
107CERRWARN	+= -_gcc=-Wno-switch
108CERRWARN	+= -_gcc=-Wno-type-limits
109CERRWARN	+= -_gcc=-Wno-uninitialized
110CERRWARN	+= -_gcc=-Wno-clobbered
111CERRWARN	+= -_gcc=-Wno-empty-body
112
113#
114# Ensure that lint sees 'struct cpu' containing a fully declared
115# embedded 'struct machcpu'
116#
117LINTFLAGS	+= -D_MACHDEP -I../../i86pc
118
119#
120#	Default build targets.
121#
122.KEEP_STATE:
123
124def:		$(DEF_DEPS)
125
126all:		$(ALL_DEPS)
127
128clean:		$(CLEAN_DEPS)
129
130clobber:	$(CLOBBER_DEPS)
131
132lint:		$(LINT_DEPS)
133
134modlintlib:	$(MODLINTLIB_DEPS)
135
136clean.lint:	$(CLEAN_LINT_DEPS)
137
138install:	$(INSTALL_DEPS)
139
140$(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
141	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
142
143$(IPCTF_TARGET) ipctf_target: FRC
144	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
145	@pwd
146
147$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
148	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
149	$(CTFMERGE_GENUNIX_MERGE)
150	$(POST_PROCESS)
151
152#
153#	Include common targets.
154#
155include $(UTSBASE)/intel/Makefile.targ
156
157#
158#	Software workarounds for hardware "features".
159#
160include	$(UTSBASE)/i86pc/Makefile.workarounds
161
162ALL_DEFS += $(WORKAROUND_DEFS)
163
164#
165# Override.
166#
167$(MODULE).lint := GEN_LINT_LIB =
168