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# x86 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_KERN_DIR)/$(MODULE) 520Sstevel@tonic-gate 530Sstevel@tonic-gateLIBGEN = $(OBJS_DIR)/libgenunix.so 540Sstevel@tonic-gateLIBSTUBS = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%) 550Sstevel@tonic-gate 560Sstevel@tonic-gate# 570Sstevel@tonic-gate# Include common rules. 580Sstevel@tonic-gate# 590Sstevel@tonic-gateinclude $(UTSBASE)/intel/Makefile.intel 600Sstevel@tonic-gate 610Sstevel@tonic-gate# 620Sstevel@tonic-gate# Define targets 630Sstevel@tonic-gate# 640Sstevel@tonic-gateALL_TARGET = $(LIBGEN) 650Sstevel@tonic-gateLINT_TARGET = $(MODULE).lint 660Sstevel@tonic-gateINSTALL_TARGET = $(GENUNIX) $(ROOTMODULE) 670Sstevel@tonic-gate 680Sstevel@tonic-gate# 690Sstevel@tonic-gate# Overrides 700Sstevel@tonic-gate# 710Sstevel@tonic-gateCLEANFILES += $(LIBSTUBS) $(LIBGEN) 720Sstevel@tonic-gateBINARY = 730Sstevel@tonic-gate 740Sstevel@tonic-gate# 750Sstevel@tonic-gate# Non-patch genunix builds merge a version of the ip module called ipctf. This 760Sstevel@tonic-gate# is to ensure that the common network-related types are included in genunix and 770Sstevel@tonic-gate# can thus be uniquified out of other modules. We don't want to do this for 780Sstevel@tonic-gate# patch builds, since we can't guarantee that ip and genunix will be in the same 790Sstevel@tonic-gate# patch. 800Sstevel@tonic-gate# 810Sstevel@tonic-gateIPCTF_TARGET = $(IPCTF) 820Sstevel@tonic-gate$(PATCH_BUILD)IPCTF_TARGET = 830Sstevel@tonic-gate 840Sstevel@tonic-gateCPPFLAGS += -I$(SRC)/common 856423Sgw25295CPPFLAGS += -I$(SRC)/uts/common/fs/zfs 860Sstevel@tonic-gate 87*11389SAlexander.Kolbasov@Sun.COMCPPFLAGS += -I$(UTSBASE)/i86pc 88*11389SAlexander.Kolbasov@Sun.COM 890Sstevel@tonic-gate# 903066Sjg# For now, disable these lint checks; maintainers should endeavor 913066Sjg# to investigate and remove these for maximum lint coverage. 923066Sjg# Please do not carry these forward to new Makefiles. 933066Sjg# 943066SjgLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 953066SjgLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 963066SjgLINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 973066SjgLINTTAGS += -erroff=E_STATIC_UNUSED 983066SjgLINTTAGS += -erroff=E_PTRDIFF_OVERFLOW 993066SjgLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 1003066Sjg 1013066Sjg# 1027632SNick.Todd@Sun.COM# Ensure that lint sees 'struct cpu' containing a fully declared 1037632SNick.Todd@Sun.COM# embedded 'struct machcpu' 1047632SNick.Todd@Sun.COM# 1057632SNick.Todd@Sun.COMLINTFLAGS += -D_MACHDEP -I../../i86pc 1067632SNick.Todd@Sun.COM 1077632SNick.Todd@Sun.COM# 1080Sstevel@tonic-gate# Default build targets. 1090Sstevel@tonic-gate# 1100Sstevel@tonic-gate.KEEP_STATE: 1110Sstevel@tonic-gate 1120Sstevel@tonic-gatedef: $(DEF_DEPS) 1130Sstevel@tonic-gate 1140Sstevel@tonic-gateall: $(ALL_DEPS) 1150Sstevel@tonic-gate 1160Sstevel@tonic-gateclean: $(CLEAN_DEPS) 1170Sstevel@tonic-gate 1180Sstevel@tonic-gateclobber: $(CLOBBER_DEPS) 1190Sstevel@tonic-gate 1200Sstevel@tonic-gatelint: $(LINT_DEPS) 1210Sstevel@tonic-gate 1220Sstevel@tonic-gatemodlintlib: $(MODLINTLIB_DEPS) 1230Sstevel@tonic-gate 1240Sstevel@tonic-gateclean.lint: $(CLEAN_LINT_DEPS) 1250Sstevel@tonic-gate 1260Sstevel@tonic-gateinstall: $(INSTALL_DEPS) 1270Sstevel@tonic-gate 1280Sstevel@tonic-gate$(LIBGEN): $(GENUNIX) $(LIBSTUBS) 129580Swesolows $(BUILD.SO) $(GENUNIX) $(LIBSTUBS) 1300Sstevel@tonic-gate 1310Sstevel@tonic-gate$(IPCTF_TARGET) ipctf_target: FRC 1320Sstevel@tonic-gate @cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR) 1330Sstevel@tonic-gate @pwd 1340Sstevel@tonic-gate 1350Sstevel@tonic-gate$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS) 1360Sstevel@tonic-gate $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS) 1370Sstevel@tonic-gate $(CTFMERGE_GENUNIX_MERGE) 1380Sstevel@tonic-gate $(POST_PROCESS) 1390Sstevel@tonic-gate 1400Sstevel@tonic-gate# 1410Sstevel@tonic-gate# Include common targets. 1420Sstevel@tonic-gate# 1430Sstevel@tonic-gateinclude $(UTSBASE)/intel/Makefile.targ 1440Sstevel@tonic-gate 1450Sstevel@tonic-gate# 1460Sstevel@tonic-gate# Software workarounds for hardware "features". 1470Sstevel@tonic-gate# 1480Sstevel@tonic-gateinclude $(UTSBASE)/i86pc/Makefile.workarounds 1490Sstevel@tonic-gate 1500Sstevel@tonic-gateALL_DEFS += $(WORKAROUND_DEFS) 1510Sstevel@tonic-gate 1520Sstevel@tonic-gate# 1530Sstevel@tonic-gate# Override. 1540Sstevel@tonic-gate# 1550Sstevel@tonic-gate$(MODULE).lint := GEN_LINT_LIB = 156