Makefile revision 4ebb14b236958cfe1ef4ff3b7a50216d9e51f997
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
bec154197d3d640b0d5b416cd5218ea58dca5d3aTinderbox User# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or http://www.opensolaris.org/os/licensing.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# uts/sparc/sd/Makefile
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater# Use is subject to license terms.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#ident "%Z%%M% %I% %E% SMI"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This makefile drives the production of the sd driver kernel module.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# sparc architecture dependent
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Path to the base of the uts directory tree (usually /usr/src/uts).
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsUTSBASE = ../..
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Define the module and object file sets.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE = sd
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsOBJECTS = $(SD_OBJS:%=$(OBJS_DIR)/%)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINTS = $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONF_SRCDIR = $(UTSBASE)/sun/io/scsi/targets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsWARLOCK_OUT = $(SD_OBJS:%.o=%.ll)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsWARLOCK_OK = $(MODULE).ok
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsWLCMD_DIR = $(UTSBASE)/common/io/warlock
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Include common rules.
94479b38340a00f0daf0ae0e1d3d673f845609ffTinderbox User#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(UTSBASE)/sparc/Makefile.sparc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Define targets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsALL_TARGET = $(BINARY) $(SRC_CONFILE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINT_TARGET = $(MODULE).lint
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User# lint pass one enforcement
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User#
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCFLAGS += $(CCVERBOSE)
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User#
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User# For now, disable these lint checks; maintainers should endeavor
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User# to investigate and remove these for maximum lint coverage.
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User# Please do not carry these forward to new Makefiles.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINTTAGS += -erroff=E_STATIC_UNUSED
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Default build targets.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews.KEEP_STATE:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsall: $(ALL_DEPS)
94479b38340a00f0daf0ae0e1d3d673f845609ffTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdef: $(DEF_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsclean: $(CLEAN_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsclobber: $(CLOBBER_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewslint: $(LINT_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsmodlintlib: $(MODLINTLIB_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsclean.lint: $(CLEAN_LINT_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall: $(INSTALL_DEPS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Include common targets.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(UTSBASE)/sparc/Makefile.targ
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Defines for local commands.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsWARLOCK = warlock
1224c3b69b3d18f7127aa042644936af25a2d679Mark AndrewsWLCC = wlcc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTOUCH = touch
1224c3b69b3d18f7127aa042644936af25a2d679Mark AndrewsSCCS = sccs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTEST = test
1224c3b69b3d18f7127aa042644936af25a2d679Mark Andrews
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Warlock targets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Note that in warlock_with_{esp,isp} it is important to load sd.ll
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and warlock can only handle one extern function by a given name;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# any loaded after the first are ignored.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewswarlock: warlock_alone warlock_with_esp warlock_with_isp warlock_with_fas \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews warlock_with_glm warlock_with_uata warlock_with_mpt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrewswarlock_alone: $(WARLOCK_OK)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews%.wlcmd:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cd $(WLCMD_DIR); $(TEST) -f $@ || $(SCCS) get $@
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(WARLOCK_OK): sd.wlcmd $(WARLOCK_OUT) scsi_files warlock_ddi.files
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(WARLOCK) -c $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -l ../warlock/ddi_dki_impl.ll
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews $(TOUCH) $@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewswarlock_with_esp: sd_with_esp.wlcmd $(WARLOCK_OUT) scsi_files esp_files \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews warlock_ddi.files
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(WARLOCK) -c $(WLCMD_DIR)/sd_with_esp.wlcmd \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(WARLOCK_OUT) ../esp/esp $(SCSI_FILES) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -l ../warlock/ddi_dki_impl.ll
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userwarlock_with_fas: sd_with_fas.wlcmd $(WARLOCK_OUT) scsi_files fas_files \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User warlock_ddi.files
94479b38340a00f0daf0ae0e1d3d673f845609ffTinderbox User $(WARLOCK) -c $(WLCMD_DIR)/sd_with_fas.wlcmd \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(WARLOCK_OUT) ../fas/fas \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User ../fas/fas_callbacks \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(SCSI_FILES) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -l ../warlock/ddi_dki_impl.ll
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userwarlock_with_isp: sd_with_isp.wlcmd $(WARLOCK_OUT) scsi_files isp_files \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User warlock_ddi.files
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK) -c $(WLCMD_DIR)/sd_with_isp.wlcmd \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK_OUT) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES) \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User -l ../warlock/ddi_dki_impl.ll
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userwarlock_with_glm: sd_with_glm.wlcmd $(WARLOCK_OUT) scsi_files glm_files \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User warlock_ddi.files
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK) -c $(WLCMD_DIR)/sd_with_glm.wlcmd \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK_OUT) $(CLOSED)/uts/sparc/glm/glm $(SCSI_FILES) \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User -l ../warlock/ddi_dki_impl.ll
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userwarlock_with_uata: sd_with_uata.wlcmd $(WARLOCK_OUT) scsi_files uata_files \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User warlock_ddi.files
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK) -c $(WLCMD_DIR)/sd_with_uata.wlcmd \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK_OUT) $(CLOSED)/uts/sparc/uata/*.ll $(SCSI_FILES) \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User -l ../warlock/ddi_dki_impl.ll
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userwarlock_with_mpt: sd_with_mpt.wlcmd $(WARLOCK_OUT) scsi_files mpt_files \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User warlock_ddi.files
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK) -c $(WLCMD_DIR)/sd_with_mpt.wlcmd \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User $(WARLOCK_OUT) $(CLOSED)/uts/sparc/mpt/*.ll $(SCSI_FILES) \
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User -l ../warlock/ddi_dki_impl.ll
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userscsi_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd ../scsi; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Useresp_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd ../esp; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userfas_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd ../fas; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userisp_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd $(CLOSED)/uts/sparc/isp; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userglm_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd $(CLOSED)/uts/sparc/glm; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Useruata_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd $(CLOSED)/uts/sparc/uata; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Usermpt_files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd $(CLOSED)/uts/sparc/mpt; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userwarlock_ddi.files:
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User @cd ../warlock; pwd; $(MAKE) warlock
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox User