xref: /illumos-gate/usr/src/uts/sun4v/genunix/Makefile (revision 0aaef2f5)
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#	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
47ROOTMODULE	= $(ROOT_PSM_KERN_DIR)/$(MODULE)
48
49PLATFORM	= sun4v
50LIBGEN		= $(OBJS_DIR)/libgenunix.so
51LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
52
53#
54#	Include common rules.
55#
56include $(UTSBASE)/sparc/Makefile.sparc
57
58#
59#	Define targets
60#
61ALL_TARGET	= $(LIBGEN) $(GENUNIX)
62INSTALL_TARGET	= $(LIBGEN) $(GENUNIX) $(ROOTMODULE)
63
64#
65#	Override defaults
66#
67CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
68
69BINARY		=
70
71CLOBBERFILES	+= $(GENUNIX)
72
73#
74# Non-patch genunix builds merge a version of the ip module called ipctf.  This
75# is to ensure that the common network-related types are included in genunix and
76# can thus be uniquified out of other modules.  We don't want to do this for
77# patch builds, since we can't guarantee that ip and genunix will be in the same
78# patch.
79#
80IPCTF_TARGET	= $(IPCTF)
81$(PATCH_BUILD)IPCTF_TARGET =
82
83#
84# For now, disable these warnings; maintainers should endeavor
85# to investigate and remove these for maximum coverage.
86# Please do not carry these forward to new Makefiles.
87#
88CFLAGS		+= $(CCVERBOSE)
89CERRWARN	+= -_gcc=-Wno-unused-label
90CERRWARN	+= -_gcc=-Wno-unused-variable
91CERRWARN	+= -_gcc=-Wno-unused-value
92CERRWARN	+= -_gcc=-Wno-unused-function
93CERRWARN	+= -_gcc=-Wno-parentheses
94CERRWARN	+= -_gcc=-Wno-switch
95CERRWARN	+= -_gcc=-Wno-type-limits
96CERRWARN	+= $(CNOWARN_UNINIT)
97CERRWARN	+= -_gcc=-Wno-clobbered
98CERRWARN	+= -_gcc=-Wno-empty-body
99
100CPPFLAGS += -I$(SRC)/common
101CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
102INC_PATH +=  -I$(UTSBASE)/sun4
103
104#
105#	Default build targets.
106#
107.KEEP_STATE:
108
109.PARALLEL:	$(LIBSTUBS)
110
111def:		$(DEF_DEPS)
112
113all:		$(ALL_DEPS)
114
115clean:		$(CLEAN_DEPS)
116
117clobber:	$(CLOBBER_DEPS)
118
119install:	$(INSTALL_DEPS)
120
121$(LIBGEN):	$(OBJECTS) $(LIBSTUBS)
122	$(BUILD.SO) $(OBJECTS) $(LIBSTUBS)
123
124$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
125	@pwd
126	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
127	$(CTFMERGE_GENUNIX_MERGE)
128	$(POST_PROCESS)
129
130$(OBJECTS): $(OBJS_DIR)
131
132#
133#	Include common targets.
134#
135include $(UTSBASE)/sparc/Makefile.targ
136
137#
138#	Include workarounds.
139#
140include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
141
142ALL_DEFS +=	$(WORKAROUND_DEFS)
143