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*3066Sjg# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate# Use is subject to license terms. 250Sstevel@tonic-gate# 26580Swesolows# ident "%Z%%M% %I% %E% SMI" 27580Swesolows# 28580Swesolows 290Sstevel@tonic-gate# 300Sstevel@tonic-gate# This makefile drives the production of the generic 310Sstevel@tonic-gate# unix kernel module. 320Sstevel@tonic-gate# 330Sstevel@tonic-gate# sparc implementation architecture dependent 340Sstevel@tonic-gate# 350Sstevel@tonic-gate 360Sstevel@tonic-gate# 370Sstevel@tonic-gate# Path to the base of the uts directory tree (usually /usr/src/uts). 380Sstevel@tonic-gate# 390Sstevel@tonic-gateUTSBASE = ../.. 400Sstevel@tonic-gate 410Sstevel@tonic-gate# 420Sstevel@tonic-gate# Define the module and object file sets. 430Sstevel@tonic-gate# 440Sstevel@tonic-gateMODULE = genunix 450Sstevel@tonic-gateGENUNIX = $(OBJS_DIR)/$(MODULE) 460Sstevel@tonic-gate 470Sstevel@tonic-gateOBJECTS = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \ 480Sstevel@tonic-gate $(NOT_YET_KMODS:%=$(OBJS_DIR)/%) 490Sstevel@tonic-gate 500Sstevel@tonic-gateLINTS = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \ 510Sstevel@tonic-gate $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) 520Sstevel@tonic-gate 530Sstevel@tonic-gateROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(MODULE) 540Sstevel@tonic-gate 550Sstevel@tonic-gatePLATFORM = sun4u 560Sstevel@tonic-gateLIBGEN = $(OBJS_DIR)/libgenunix.so 570Sstevel@tonic-gateLIBSTUBS = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%) 580Sstevel@tonic-gate 590Sstevel@tonic-gate# 600Sstevel@tonic-gate# Include common rules. 610Sstevel@tonic-gate# 620Sstevel@tonic-gateinclude $(UTSBASE)/sparc/Makefile.sparc 630Sstevel@tonic-gate 640Sstevel@tonic-gate# 650Sstevel@tonic-gate# Define targets 660Sstevel@tonic-gate# 670Sstevel@tonic-gateALL_TARGET = $(LIBGEN) 680Sstevel@tonic-gateLINT_TARGET = $(MODULE).lint 690Sstevel@tonic-gateINSTALL_TARGET = $(GENUNIX) $(ROOTMODULE) 700Sstevel@tonic-gate 710Sstevel@tonic-gate# 720Sstevel@tonic-gate# Override defaults 730Sstevel@tonic-gate# 740Sstevel@tonic-gateCLEANFILES += $(LIBSTUBS) $(LIBGEN) 750Sstevel@tonic-gate 760Sstevel@tonic-gateLINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR) 770Sstevel@tonic-gateLINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln 780Sstevel@tonic-gateGEN_LINT_LIB = 790Sstevel@tonic-gate 800Sstevel@tonic-gateBINARY = 810Sstevel@tonic-gate 820Sstevel@tonic-gateCLOBBERFILES += $(GENUNIX) 830Sstevel@tonic-gate 840Sstevel@tonic-gate# 850Sstevel@tonic-gate# Non-patch genunix builds merge a version of the ip module called ipctf. This 860Sstevel@tonic-gate# is to ensure that the common network-related types are included in genunix and 870Sstevel@tonic-gate# can thus be uniquified out of other modules. We don't want to do this for 880Sstevel@tonic-gate# patch builds, since we can't guarantee that ip and genunix will be in the same 890Sstevel@tonic-gate# patch. 900Sstevel@tonic-gate# 910Sstevel@tonic-gateIPCTF_TARGET = $(IPCTF) 920Sstevel@tonic-gate$(PATCH_BUILD)IPCTF_TARGET = 930Sstevel@tonic-gate 940Sstevel@tonic-gate# 950Sstevel@tonic-gate# lint pass one enforcement 960Sstevel@tonic-gate# 970Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 980Sstevel@tonic-gateCPPFLAGS += -I$(SRC)/common 990Sstevel@tonic-gate 1000Sstevel@tonic-gate# 101*3066Sjg# For now, disable these lint checks; maintainers should endeavor 102*3066Sjg# to investigate and remove these for maximum lint coverage. 103*3066Sjg# Please do not carry these forward to new Makefiles. 104*3066Sjg# 105*3066SjgLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 106*3066SjgLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 107*3066SjgLINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 108*3066SjgLINTTAGS += -erroff=E_STATIC_UNUSED 109*3066SjgLINTTAGS += -erroff=E_PTRDIFF_OVERFLOW 110*3066SjgLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 111*3066Sjg 112*3066Sjg# 1130Sstevel@tonic-gate# Default build targets. 1140Sstevel@tonic-gate# 1150Sstevel@tonic-gate.KEEP_STATE: 1160Sstevel@tonic-gate 1170Sstevel@tonic-gate.PARALLEL: $(LIBSTUBS) 1180Sstevel@tonic-gate 1190Sstevel@tonic-gatedef: $(DEF_DEPS) 1200Sstevel@tonic-gate 1210Sstevel@tonic-gateall: $(ALL_DEPS) 1220Sstevel@tonic-gate 1230Sstevel@tonic-gateclean: $(CLEAN_DEPS) 1240Sstevel@tonic-gate 1250Sstevel@tonic-gateclobber: $(CLOBBER_DEPS) 1260Sstevel@tonic-gate 1270Sstevel@tonic-gatelint: $(LINT_DEPS) 1280Sstevel@tonic-gate 1290Sstevel@tonic-gatemodlintlib: $(MODLINTLIB_DEPS) 1300Sstevel@tonic-gate 1310Sstevel@tonic-gateclean.lint: $(CLEAN_LINT_DEPS) 1320Sstevel@tonic-gate 1330Sstevel@tonic-gateinstall: $(INSTALL_DEPS) 1340Sstevel@tonic-gate 1350Sstevel@tonic-gate$(LIBGEN): $(GENUNIX) $(LIBSTUBS) 136580Swesolows $(BUILD.SO) $(GENUNIX) $(LIBSTUBS) 1370Sstevel@tonic-gate 1380Sstevel@tonic-gate$(IPCTF_TARGET) ipctf_target: FRC 1390Sstevel@tonic-gate @cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR) 1400Sstevel@tonic-gate @pwd 1410Sstevel@tonic-gate 1420Sstevel@tonic-gate$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS) 1430Sstevel@tonic-gate $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS) 1440Sstevel@tonic-gate $(CTFMERGE_GENUNIX_MERGE) 1450Sstevel@tonic-gate $(POST_PROCESS) 1460Sstevel@tonic-gate 1470Sstevel@tonic-gate$(OBJECTS): $(OBJS_DIR) 1480Sstevel@tonic-gate 1490Sstevel@tonic-gate# 1500Sstevel@tonic-gate# Include common targets. 1510Sstevel@tonic-gate# 1520Sstevel@tonic-gateinclude $(UTSBASE)/sparc/Makefile.targ 1530Sstevel@tonic-gate 1540Sstevel@tonic-gate# 1550Sstevel@tonic-gate# Include sun4u workarounds. 1560Sstevel@tonic-gate# 1570Sstevel@tonic-gateinclude $(UTSBASE)/sun4u/Makefile.workarounds 1580Sstevel@tonic-gate 1590Sstevel@tonic-gateALL_DEFS += $(WORKAROUND_DEFS) 160