Makefile revision e8fb11a1575b42dcd5c49341c588d9f6cd636135
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# CDDL HEADER START
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# The contents of this file are subject to the terms of the
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Common Development and Distribution License (the "License").
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# You may not use this file except in compliance with the License.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# or http://www.opensolaris.org/os/licensing.
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# See the License for the specific language governing permissions
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# and limitations under the License.
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# When distributing Covered Code, include this CDDL HEADER in each
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# If applicable, add the following below this CDDL HEADER, with the
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# fields enclosed by brackets "[]" replaced with your own identifying
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# information: Portions Copyright [yyyy] [name of copyright owner]
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# CDDL HEADER END
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# uts/intel/io/sd/Makefile
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# Use is subject to license terms.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#ident "%Z%%M% %I% %E% SMI"
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# This makefile drives the production of the sd
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# kernel module.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Path to the base of the uts directory tree (usually /usr/src/uts).
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassUTSBASE = ../..
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Define the module and object file sets.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassMODULE = sd
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassOBJECTS = $(SD_OBJS:%=$(OBJS_DIR)/%)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassLINTS = $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassCONF_SRCDIR = $(UTSBASE)/intel/io/scsi/targets
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassWARLOCK_OUT = $(SD_OBJS:%.o=%.ll)
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassWARLOCK_OK = $(MODULE).ok
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassWLCMD_DIR = $(UTSBASE)/common/io/warlock
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Include common rules.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glassinclude $(UTSBASE)/intel/Makefile.intel
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# Define targets
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassALL_TARGET = $(BINARY) $(CONFMOD)
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassLINT_TARGET = $(MODULE).lint
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass# Overrides.
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassDEBUG_FLGS =
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassDEBUG_DEFS += $(DEBUG_FLGS)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav GlassINC_PATH += -I$(UTSBASE)/intel/io/scsi/targets
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# For now, disable these lint checks; maintainers should endeavor
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# to investigate and remove these for maximum lint coverage.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Please do not carry these forward to new Makefiles.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassLINTTAGS += -erroff=E_STATIC_UNUSED
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassLINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
7bf968657bff10ad28ae9742176e4e814dbc3849Dav GlassLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass# Default build targets.
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass#
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass.KEEP_STATE:
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glassdef: $(DEF_DEPS)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glassall: $(ALL_DEPS)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glassclean: $(CLEAN_DEPS)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glass
7bf968657bff10ad28ae9742176e4e814dbc3849Dav Glassclobber: $(CLOBBER_DEPS)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav Glasslint: $(LINT_DEPS)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav Glassmodlintlib: $(MODLINTLIB_DEPS)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
72d545a3aacf73830ad019134a025794ed01ce1eDav Glassclean.lint: $(CLEAN_LINT_DEPS)
72d545a3aacf73830ad019134a025794ed01ce1eDav Glass
install: $(INSTALL_DEPS)
#
# Include common targets.
#
include $(UTSBASE)/intel/Makefile.targ
#
# Defines for local commands.
#
WARLOCK = warlock
WLCC = wlcc
TOUCH = touch
SCCS = sccs
TEST = test
#
# Warlock targets
#
# Note that in warlock_with_{esp,isp} it is important to load sd.ll
# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
# and warlock can only handle one extern function by a given name;
# any loaded after the first are ignored.
SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
warlock: warlock_alone warlock_with_mpt warlock_with_glm
warlock_alone: $(WARLOCK_OK)
%.wlcmd:
cd $(WLCMD_DIR); $(TEST) -f $@ || $(SCCS) get $@
$(WARLOCK_OK): sd.wlcmd $(WARLOCK_OUT) scsi_files warlock_ddi.files cmlb_files
$(WARLOCK) -c $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
$(CMLB_FILES) \
-l ../warlock/ddi_dki_impl.ll
$(TOUCH) $@
%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
warlock_with_glm: sd_with_glm.wlcmd $(WARLOCK_OUT) scsi_files glm_files \
warlock_ddi.files cmlb_files
$(WARLOCK) -c $(WLCMD_DIR)/sd_with_glm.wlcmd \
$(WARLOCK_OUT) \
$(CLOSED)/uts/intel/glm/*.ll \
$(SCSI_FILES) $(CMLB_FILES) \
-l ../warlock/ddi_dki_impl.ll
warlock_with_mpt: sd_with_mpt.wlcmd $(WARLOCK_OUT) scsi_files mpt_files \
warlock_ddi.files cmlb_files
$(WARLOCK) -c $(WLCMD_DIR)/sd_with_mpt.wlcmd \
$(WARLOCK_OUT) \
$(CLOSED)/uts/intel/mpt/*.ll \
$(SCSI_FILES) $(CMLB_FILES) \
-l ../warlock/ddi_dki_impl.ll
glm_files:
@cd $(CLOSED)/uts/intel/glm; pwd; $(MAKE) warlock
mpt_files:
@cd $(CLOSED)/uts/intel/mpt; pwd; $(MAKE) warlock
cmlb_files:
@cd ../cmlb; pwd; $(MAKE) warlock
scsi_files:
@cd ../scsi; pwd; $(MAKE) warlock
warlock_ddi.files:
@cd ../warlock; pwd; $(MAKE) warlock