xref: /onnv-gate/usr/src/uts/sun4u/genunix/Makefile (revision 11389:dd00b884e84f)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5580Swesolows# Common Development and Distribution License (the "License").
6580Swesolows# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
21580Swesolows
220Sstevel@tonic-gate#
23*11389SAlexander.Kolbasov@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate# Use is subject to license terms.
250Sstevel@tonic-gate#
26580Swesolows
270Sstevel@tonic-gate#
280Sstevel@tonic-gate#	This makefile drives the production of the generic
290Sstevel@tonic-gate#	unix kernel module.
300Sstevel@tonic-gate#
310Sstevel@tonic-gate#	sparc implementation architecture dependent
320Sstevel@tonic-gate#
330Sstevel@tonic-gate
340Sstevel@tonic-gate#
350Sstevel@tonic-gate#	Path to the base of the uts directory tree (usually /usr/src/uts).
360Sstevel@tonic-gate#
370Sstevel@tonic-gateUTSBASE	= ../..
380Sstevel@tonic-gate
390Sstevel@tonic-gate#
400Sstevel@tonic-gate#	Define the module and object file sets.
410Sstevel@tonic-gate#
420Sstevel@tonic-gateMODULE		= genunix
430Sstevel@tonic-gateGENUNIX		= $(OBJS_DIR)/$(MODULE)
440Sstevel@tonic-gate
450Sstevel@tonic-gateOBJECTS		= $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
460Sstevel@tonic-gate		  $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
470Sstevel@tonic-gate
480Sstevel@tonic-gateLINTS		= $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
490Sstevel@tonic-gate		  $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
500Sstevel@tonic-gate
510Sstevel@tonic-gateROOTMODULE	= $(ROOT_PSM_KERN_DIR)/$(MODULE)
520Sstevel@tonic-gate
530Sstevel@tonic-gatePLATFORM	= sun4u
540Sstevel@tonic-gateLIBGEN		= $(OBJS_DIR)/libgenunix.so
550Sstevel@tonic-gateLIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
560Sstevel@tonic-gate
570Sstevel@tonic-gate#
580Sstevel@tonic-gate#	Include common rules.
590Sstevel@tonic-gate#
600Sstevel@tonic-gateinclude $(UTSBASE)/sparc/Makefile.sparc
610Sstevel@tonic-gate
620Sstevel@tonic-gate#
630Sstevel@tonic-gate#	Define targets
640Sstevel@tonic-gate#
650Sstevel@tonic-gateALL_TARGET	= $(LIBGEN)
660Sstevel@tonic-gateLINT_TARGET	= $(MODULE).lint
670Sstevel@tonic-gateINSTALL_TARGET	= $(GENUNIX) $(ROOTMODULE)
680Sstevel@tonic-gate
690Sstevel@tonic-gate#
700Sstevel@tonic-gate#	Override defaults
710Sstevel@tonic-gate#
720Sstevel@tonic-gateCLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
730Sstevel@tonic-gate
740Sstevel@tonic-gateLINT_LIB_DIR	= $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
750Sstevel@tonic-gateLINT_LIB	= $(LINT_LIB_DIR)/llib-lunix.ln
760Sstevel@tonic-gateGEN_LINT_LIB	=
770Sstevel@tonic-gate
780Sstevel@tonic-gateBINARY		=
790Sstevel@tonic-gate
800Sstevel@tonic-gateCLOBBERFILES	+= $(GENUNIX)
810Sstevel@tonic-gate
820Sstevel@tonic-gate#
830Sstevel@tonic-gate# Non-patch genunix builds merge a version of the ip module called ipctf.  This
840Sstevel@tonic-gate# is to ensure that the common network-related types are included in genunix and
850Sstevel@tonic-gate# can thus be uniquified out of other modules.  We don't want to do this for
860Sstevel@tonic-gate# patch builds, since we can't guarantee that ip and genunix will be in the same
870Sstevel@tonic-gate# patch.
880Sstevel@tonic-gate#
890Sstevel@tonic-gateIPCTF_TARGET	= $(IPCTF)
900Sstevel@tonic-gate$(PATCH_BUILD)IPCTF_TARGET =
910Sstevel@tonic-gate
920Sstevel@tonic-gate#
930Sstevel@tonic-gate# lint pass one enforcement
940Sstevel@tonic-gate#
950Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
960Sstevel@tonic-gateCPPFLAGS += -I$(SRC)/common
976423Sgw25295CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
980Sstevel@tonic-gate
99*11389SAlexander.Kolbasov@Sun.COMINC_PATH +=  -I$(UTSBASE)/sun4
100*11389SAlexander.Kolbasov@Sun.COM
1010Sstevel@tonic-gate#
1023066Sjg# For now, disable these lint checks; maintainers should endeavor
1033066Sjg# to investigate and remove these for maximum lint coverage.
1043066Sjg# Please do not carry these forward to new Makefiles.
1053066Sjg#
1063066SjgLINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
1073066SjgLINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
1083066SjgLINTTAGS	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1093066SjgLINTTAGS	+= -erroff=E_STATIC_UNUSED
1103066SjgLINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
1113066SjgLINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
1123066Sjg
1133066Sjg#
1147632SNick.Todd@Sun.COM# Ensure that lint sees 'struct cpu' containing a fully declared
1157632SNick.Todd@Sun.COM# embedded 'struct machcpu'
1167632SNick.Todd@Sun.COM#
1177632SNick.Todd@Sun.COMLINTFLAGS	+= -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu
1187632SNick.Todd@Sun.COM
1190Sstevel@tonic-gate#	Default build targets.
1200Sstevel@tonic-gate#
1210Sstevel@tonic-gate.KEEP_STATE:
1220Sstevel@tonic-gate
1230Sstevel@tonic-gate.PARALLEL:	$(LIBSTUBS)
1240Sstevel@tonic-gate
1250Sstevel@tonic-gatedef:		$(DEF_DEPS)
1260Sstevel@tonic-gate
1270Sstevel@tonic-gateall:		$(ALL_DEPS)
1280Sstevel@tonic-gate
1290Sstevel@tonic-gateclean:		$(CLEAN_DEPS)
1300Sstevel@tonic-gate
1310Sstevel@tonic-gateclobber:	$(CLOBBER_DEPS)
1320Sstevel@tonic-gate
1330Sstevel@tonic-gatelint:		$(LINT_DEPS)
1340Sstevel@tonic-gate
1350Sstevel@tonic-gatemodlintlib:	$(MODLINTLIB_DEPS)
1360Sstevel@tonic-gate
1370Sstevel@tonic-gateclean.lint:	$(CLEAN_LINT_DEPS)
1380Sstevel@tonic-gate
1390Sstevel@tonic-gateinstall:  	$(INSTALL_DEPS)
1400Sstevel@tonic-gate
1416094Sakolbinstall_h:
1426094Sakolb
1436094Sakolb
1440Sstevel@tonic-gate$(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
145580Swesolows	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
1460Sstevel@tonic-gate
1470Sstevel@tonic-gate$(IPCTF_TARGET) ipctf_target: FRC
1480Sstevel@tonic-gate	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
1490Sstevel@tonic-gate	@pwd
1500Sstevel@tonic-gate
1510Sstevel@tonic-gate$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
1520Sstevel@tonic-gate	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
1530Sstevel@tonic-gate	$(CTFMERGE_GENUNIX_MERGE)
1540Sstevel@tonic-gate	$(POST_PROCESS)
1550Sstevel@tonic-gate
1560Sstevel@tonic-gate$(OBJECTS): $(OBJS_DIR)
1570Sstevel@tonic-gate
1580Sstevel@tonic-gate#
1590Sstevel@tonic-gate#	Include common targets.
1600Sstevel@tonic-gate#
1610Sstevel@tonic-gateinclude $(UTSBASE)/sparc/Makefile.targ
1620Sstevel@tonic-gate
1630Sstevel@tonic-gate#
1640Sstevel@tonic-gate#	Include sun4u workarounds.
1650Sstevel@tonic-gate#
1660Sstevel@tonic-gateinclude $(UTSBASE)/sun4u/Makefile.workarounds
1670Sstevel@tonic-gate
1680Sstevel@tonic-gateALL_DEFS +=	$(WORKAROUND_DEFS)
169