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