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# uts/intel/nsmb/Makefile 23# 24# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 25# Use is subject to license terms. 26# 27# Copyright (c) 2018, Joyent, Inc. 28# Copyright 2024 RackTop Systems, Inc. 29 30# 31# intel architecture dependent 32# 33 34# 35# Path to the base of the uts directory tree (usually /usr/src/uts). 36# 37UTSBASE = ../.. 38 39# 40# Define the module and object file sets. 41# 42MODULE = nsmb 43OBJECTS = $(NSMB_OBJS:%=$(OBJS_DIR)/%) 44ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) 45CONF_SRCDIR = $(UTSBASE)/common/fs/smbclnt/netsmb 46OFFSETS_SRC = $(CONF_SRCDIR)/offsets.in 47IOC_CHECK_H = $(OBJS_DIR)/ioc_check.h 48 49# What symbols we export (e.g. _init(), ...) 50MAPFILE = $(CONF_SRCDIR)/$(MODULE).mapfile 51 52# The symbols we link against 53MAPFILE_EXT = $(CONF_SRCDIR)/nsmb_ext.mapfile 54MAPFILES += tlimod ddi 55 56# 57# Include common rules. 58# 59include $(UTSBASE)/intel/Makefile.intel 60 61# 62# Define targets 63# 64ALL_TARGET = $(ALL_TARGET_$(OBJS_DIR)) 65INSTALL_TARGET = $(INSTALL_TARGET_$(OBJS_DIR)) 66 67# 68# Overrides. 69# 70# We need some unusual overrides here so we'll 71# build ioc_check.h for both 32-bit/64-bit, 72# but only build 64-bit binaries. 73# 74 75# Build 32-bit also... 76DEF_BUILDS = $(DEF_BUILDS64) $(DEF_BUILDS32) 77ALL_BUILDS = $(ALL_BUILDS64) $(ALL_BUILDS32) 78# ... but don't build any 32-bit objects 79ALL_TARGET_debug32 = $(IOC_CHECK_H) 80ALL_TARGET_debug64 = $(BINARY) $(SRC_CONFILE) 81ALL_TARGET_obj32 = $(IOC_CHECK_H) 82ALL_TARGET_obj64 = $(BINARY) $(SRC_CONFILE) 83# ... and remove -xcg92 (not supported by cw) 84CFLAGS_32= 85# ... same deal for install targets 86INSTALL_TARGET_debug32 = $(IOC_CHECK_H) 87INSTALL_TARGET_debug64 = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) 88INSTALL_TARGET_obj32 = $(IOC_CHECK_H) 89INSTALL_TARGET_obj64 = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) 90 91# 92# Now the normal overrides... 93# 94CLEANFILES += $(IOC_CHECK_H) 95INC_PATH += -I$(UTSBASE)/common/fs/smbclnt 96LDFLAGS += -Ncrypto/md4 -Ncrypto/md5 -Nmisc/kcf -Nmisc/tlimod 97LDFLAGS += -M $(MAPFILE) -M $(MAPFILE_EXT) 98 99# 100# For now, disable these warnings; maintainers should endeavor 101# to investigate and remove these for maximum coverage. 102# Please do not carry these forward to new Makefiles. 103# 104 105# The mb_put/md_get functions are intentionally used with and without 106# return value checks, so filter those. 107SMOFF += all_func_returns 108 109# needs work 110SMOFF += signed,deref_check 111 112# 113# Default build targets. 114# 115.KEEP_STATE: 116 117def: $(DEF_DEPS) 118 119all: $(ALL_DEPS) 120 121clean: $(CLEAN_DEPS) 122 123clobber: $(CLOBBER_DEPS) 124 125install: $(INSTALL_DEPS) 126 127# 128# Create ioc_check.h and compare with the saved 129# ioc_check.ref to ensure 32/64-bit invariance. 130# 131$(OBJECTS) : $(IOC_CHECK_H) 132$(IOC_CHECK_H): $(OFFSETS_SRC) 133 $(OFFSETS_CREATE) <$(OFFSETS_SRC) >$@.tmp 134 cmp -s ioc_check.ref $@.tmp && \ 135 mv -f $@.tmp $@ 136 137# 138# Include common targets. 139# 140include $(UTSBASE)/Makefile.mapfile 141include $(UTSBASE)/intel/Makefile.targ 142