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.
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.
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]
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 # This makefile drives the production of the generic
30 # sparc implementation architecture dependent
34 # Path to the base of the uts directory tree (usually /usr/src/uts).
39 # Define the module and object file sets.
42 GENUNIX
= $(OBJS_DIR
)/$(MODULE
)
44 OBJECTS
= $(GENUNIX_OBJS
:%=$(OBJS_DIR
)/%) \
45 $(NOT_YET_KMODS
:%=$(OBJS_DIR
)/%)
47 LINTS
= $(GENUNIX_OBJS
:%.o
=$(LINTS_DIR
)/%.ln
) \
48 $(NOT_YET_KMODS
:%.o
=$(LINTS_DIR
)/%.ln
)
50 ROOTMODULE
= $(ROOT_PSM_KERN_DIR
)/$(MODULE
)
53 LIBGEN
= $(OBJS_DIR
)/libgenunix.so
54 LIBSTUBS
= $(GENSTUBS_OBJS
:%=$(OBJS_DIR
)/%)
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
63 LINTFLAGSUPPRESS
= $(POUND_SIGN
)
66 # Include common rules.
68 include $(UTSBASE
)/sparc
/Makefile.sparc
73 ALL_TARGET
= $(LIBGEN
) $(GENUNIX
)
74 LINT_TARGET
= $(MODULE
).lint
75 INSTALL_TARGET
= $(LIBGEN
) $(GENUNIX
) $(ROOTMODULE
)
80 CLEANFILES
+= $(LIBSTUBS
) $(LIBGEN
)
82 LINT_LIB_DIR
= $(UTSBASE
)/$(PLATFORM
)/lint-libs
/$(OBJS_DIR
)
83 LINT_LIB
= $(LINT_LIB_DIR
)/llib-lunix.ln
88 CLOBBERFILES
+= $(GENUNIX
)
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
97 IPCTF_TARGET
= $(IPCTF
)
98 $(PATCH_BUILD
)IPCTF_TARGET
=
101 # lint pass one enforcement
103 CFLAGS
+= $(CCVERBOSE
)
104 CPPFLAGS
+= -I
$(SRC
)/common
105 CPPFLAGS
+= -I
$(SRC
)/uts
/common
/fs
/zfs
107 INC_PATH
+= -I
$(UTSBASE
)/sun4
110 # For now, disable these lint checks; maintainers should endeavor
111 # to investigate and remove these for maximum lint coverage.
112 # Please do not carry these forward to new Makefiles.
114 LINTTAGS
+= -erroff
=E_SUSPICIOUS_COMPARISON
115 LINTTAGS
+= -erroff
=E_BAD_PTR_CAST_ALIGN
116 LINTTAGS
+= -erroff
=E_SUPPRESSION_DIRECTIVE_UNUSED
117 LINTTAGS
+= -erroff
=E_STATIC_UNUSED
118 LINTTAGS
+= -erroff
=E_PTRDIFF_OVERFLOW
119 LINTTAGS
+= -erroff
=E_ASSIGN_NARROW_CONV
121 CERRWARN
+= -_gcc
=-Wno-unused-label
122 CERRWARN
+= -_gcc
=-Wno-unused-variable
123 CERRWARN
+= -_gcc
=-Wno-unused-value
124 CERRWARN
+= -_gcc
=-Wno-unused-function
125 CERRWARN
+= -_gcc
=-Wno-parentheses
126 CERRWARN
+= -_gcc
=-Wno-switch
127 CERRWARN
+= -_gcc
=-Wno-type-limits
128 CERRWARN
+= -_gcc
=-Wno-uninitialized
129 CERRWARN
+= -_gcc
=-Wno-clobbered
130 CERRWARN
+= -_gcc
=-Wno-empty-body
133 # Ensure that lint sees 'struct cpu' containing a fully declared
134 # embedded 'struct machcpu'.
136 LINTFLAGS
+= -D_MACHDEP
-I..
/..
/sun4
-I..
/..
/$(PLATFORM
) -I..
/..
/sfmmu
139 # Default build targets.
143 .PARALLEL
: $(LIBSTUBS
)
151 clobber: $(CLOBBER_DEPS
)
155 modlintlib
: $(MODLINTLIB_DEPS
)
157 clean.lint
: $(CLEAN_LINT_DEPS
)
159 install: $(INSTALL_DEPS
)
161 $(LIBGEN
): $(GENUNIX
) $(LIBSTUBS
)
162 $(BUILD.SO
) $(GENUNIX
) $(LIBSTUBS
)
164 $(GENUNIX
): $(IPCTF_TARGET
) $(OBJECTS
)
166 $(LD
) -r
$(LDFLAGS
) -o
$@
$(OBJECTS
)
167 $(CTFMERGE_GENUNIX_MERGE
)
170 $(OBJECTS
): $(OBJS_DIR
)
173 # Include common targets.
175 include $(UTSBASE
)/sparc
/Makefile.targ
178 # Include workarounds.
180 include $(UTSBASE
)/$(PLATFORM
)/Makefile.workarounds
182 ALL_DEFS
+= $(WORKAROUND_DEFS
)