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/sparc/sd/Makefile 23# 24# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25# Use is subject to license terms. 26# 27#ident "%Z%%M% %I% %E% SMI" 28# 29# This makefile drives the production of the sd driver kernel module. 30# 31# sparc 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 = sd 43OBJECTS = $(SD_OBJS:%=$(OBJS_DIR)/%) 44LINTS = $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln) 45ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 46CONF_SRCDIR = $(UTSBASE)/sun/io/scsi/targets 47WARLOCK_OUT = $(SD_OBJS:%.o=%.ll) 48WARLOCK_OK = $(MODULE).ok 49WLCMD_DIR = $(UTSBASE)/common/io/warlock 50 51# 52# Include common rules. 53# 54include $(UTSBASE)/sparc/Makefile.sparc 55 56# 57# Define targets 58# 59ALL_TARGET = $(BINARY) $(SRC_CONFILE) 60LINT_TARGET = $(MODULE).lint 61INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) 62 63# 64# lint pass one enforcement 65# 66CFLAGS += $(CCVERBOSE) 67 68# 69# For now, disable these lint checks; maintainers should endeavor 70# to investigate and remove these for maximum lint coverage. 71# Please do not carry these forward to new Makefiles. 72# 73LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 74LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 75LINTTAGS += -erroff=E_STATIC_UNUSED 76LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 77 78# 79# Default build targets. 80# 81.KEEP_STATE: 82 83all: $(ALL_DEPS) 84 85def: $(DEF_DEPS) 86 87clean: $(CLEAN_DEPS) 88 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 89 90clobber: $(CLOBBER_DEPS) 91 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 92 93lint: $(LINT_DEPS) 94 95modlintlib: $(MODLINTLIB_DEPS) 96 97clean.lint: $(CLEAN_LINT_DEPS) 98 99install: $(INSTALL_DEPS) 100 101# 102# Include common targets. 103# 104include $(UTSBASE)/sparc/Makefile.targ 105 106 107# 108# Defines for local commands. 109# 110WARLOCK = warlock 111WLCC = wlcc 112TOUCH = touch 113SCCS = sccs 114TEST = test 115 116# 117# Warlock targets 118# 119# Note that in warlock_with_{esp,isp} it is important to load sd.ll 120# before {isp,esp}.ll; the reason is that both have _init/_info/_fini 121# and warlock can only handle one extern function by a given name; 122# any loaded after the first are ignored. 123 124SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll) 125CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll) 126 127WARLOCK_TARGETS = warlock_alone warlock_with_esp warlock_with_fas 128$(CLOSED_BUILD)WARLOCK_TARGETS += warlock_with_isp warlock_with_glm \ 129 warlock_with_uata warlock_with_mpt 130 131warlock: $(WARLOCK_TARGETS) 132 133warlock_alone: $(WARLOCK_OK) 134 135%.wlcmd: 136 cd $(WLCMD_DIR); $(TEST) -f $@ || $(SCCS) get $@ 137 138$(WARLOCK_OK): sd.wlcmd $(WARLOCK_OUT) scsi_files warlock_ddi.files cmlb_files 139 $(WARLOCK) -c $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \ 140 $(CMLB_FILES) \ 141 -l ../warlock/ddi_dki_impl.ll 142 $(TOUCH) $@ 143 144%.ll: $(UTSBASE)/common/io/scsi/targets/%.c 145 $(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $< 146 147warlock_with_esp: sd_with_esp.wlcmd $(WARLOCK_OUT) scsi_files esp_files \ 148 warlock_ddi.files cmlb_files 149 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_esp.wlcmd \ 150 $(WARLOCK_OUT) ../esp/esp $(SCSI_FILES) $(CMLB_FILES) \ 151 -l ../warlock/ddi_dki_impl.ll 152 153warlock_with_fas: sd_with_fas.wlcmd $(WARLOCK_OUT) scsi_files fas_files \ 154 warlock_ddi.files cmlb_files 155 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_fas.wlcmd \ 156 $(WARLOCK_OUT) ../fas/fas \ 157 ../fas/fas_callbacks \ 158 $(SCSI_FILES) $(CMLB_FILES) \ 159 -l ../warlock/ddi_dki_impl.ll 160 161warlock_with_isp: sd_with_isp.wlcmd $(WARLOCK_OUT) scsi_files isp_files \ 162 warlock_ddi.files cmlb_files 163 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_isp.wlcmd \ 164 $(WARLOCK_OUT) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES) \ 165 $(CMLB_FILES) \ 166 -l ../warlock/ddi_dki_impl.ll 167 168warlock_with_glm: sd_with_glm.wlcmd $(WARLOCK_OUT) scsi_files glm_files \ 169 warlock_ddi.files cmlb_files 170 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_glm.wlcmd \ 171 $(WARLOCK_OUT) $(CLOSED)/uts/sparc/glm/glm $(SCSI_FILES) \ 172 $(CMLB_FILES) \ 173 -l ../warlock/ddi_dki_impl.ll 174 175warlock_with_uata: sd_with_uata.wlcmd $(WARLOCK_OUT) scsi_files uata_files \ 176 warlock_ddi.files cmlb_files 177 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_uata.wlcmd \ 178 $(WARLOCK_OUT) $(CLOSED)/uts/sparc/uata/*.ll $(SCSI_FILES) \ 179 $(CMLB_FILES) \ 180 -l ../warlock/ddi_dki_impl.ll 181 182warlock_with_mpt: sd_with_mpt.wlcmd $(WARLOCK_OUT) scsi_files mpt_files \ 183 warlock_ddi.files cmlb_files 184 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_mpt.wlcmd \ 185 $(WARLOCK_OUT) $(CLOSED)/uts/sparc/mpt/*.ll $(SCSI_FILES) \ 186 $(CMLB_FILES) \ 187 -l ../warlock/ddi_dki_impl.ll 188 189cmlb_files: 190 @cd ../cmlb; pwd; $(MAKE) warlock 191 192 193scsi_files: 194 @cd ../scsi; pwd; $(MAKE) warlock 195 196esp_files: 197 @cd ../esp; pwd; $(MAKE) warlock 198 199fas_files: 200 @cd ../fas; pwd; $(MAKE) warlock 201 202isp_files: 203 @cd $(CLOSED)/uts/sparc/isp; pwd; $(MAKE) warlock 204 205glm_files: 206 @cd $(CLOSED)/uts/sparc/glm; pwd; $(MAKE) warlock 207 208uata_files: 209 @cd $(CLOSED)/uts/sparc/uata; pwd; $(MAKE) warlock 210 211mpt_files: 212 @cd $(CLOSED)/uts/sparc/mpt; pwd; $(MAKE) warlock 213 214warlock_ddi.files: 215 @cd ../warlock; pwd; $(MAKE) warlock 216