Makefile revision c0e7977a434048a8bc7386ea0e8befaa77a646cf
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz#
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz# CDDL HEADER START
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix#
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# The contents of this file are subject to the terms of the
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# Common Development and Distribution License (the "License").
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# You may not use this file except in compliance with the License.
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix#
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# or http://www.opensolaris.org/os/licensing.
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz# See the License for the specific language governing permissions
f91279be939ce6c33befa6cdb5bc8a99cc5a765cJon A. Cruz# and limitations under the License.
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix#
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# When distributing Covered Code, include this CDDL HEADER in each
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# If applicable, add the following below this CDDL HEADER, with the
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# fields enclosed by brackets "[]" replaced with your own identifying
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# information: Portions Copyright [yyyy] [name of copyright owner]
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix#
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# CDDL HEADER END
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix#
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix# uts/sparc/sd/Makefile
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix#
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# Use is subject to license terms.
433c7bdb0876de43779befd1230378b2fe728435Markus Engel# Copyright (c) 2011 Bayard G. Bell. All rights reserved.
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
1d882e9533b20c0e0783e9d17fcd3f5466fa422fcilix# This makefile drives the production of the sd driver kernel module.
094dc7c249a0253b9bbed67205e341a05b59eca7Abhishek Sharma Public#
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz# sparc architecture dependent
a2e796b608034e2c62290378d713058b8b58ef8fMarkus Engel#
cdef31ce8c9e6d220e3a1a6b8a06ac0a3eb5d1edMarkus Engel
05bb07872041bda1554e89f31df1a1596e95aa84Markus Engel#
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White# Path to the base of the uts directory tree (usually /usr/src/uts).
b2dfb5760b4ff97eabdaa0272ba7ed7f0dd8c6ebcilix#
11f343b8117dbf56931f537820c2749a8232fec2Liam P. WhiteUTSBASE = ../..
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix
e0c254c4445696f4e88690a2d35da1e3a760867ecilix#
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix# Define the module and object file sets.
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
36f768de5093f93de10e3b516a2b6f8b74f41513cilixMODULE = sd
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixOBJECTS = $(SD_OBJS:%=$(OBJS_DIR)/%)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixLINTS = $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln)
5341d52bd89ffc1587300ac4210afb64661af05dcilixROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
69f5c4dd44b76696be7d8d27f4059d420bd98bcccilixCONF_SRCDIR = $(UTSBASE)/sun/io/scsi/targets
69f5c4dd44b76696be7d8d27f4059d420bd98bcccilixWARLOCK_OUT = $(SD_OBJS:%.o=%.ll)
11f343b8117dbf56931f537820c2749a8232fec2Liam P. WhiteWARLOCK_OK = $(MODULE).ok
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. CruzWLCMD_DIR = $(UTSBASE)/common/io/warlock
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz#
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz# Include common rules.
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz#
05bb07872041bda1554e89f31df1a1596e95aa84Markus Engelinclude $(UTSBASE)/sparc/Makefile.sparc
51dc158adbe2c9d1df3c941cbf78b90944d1afc2Markus Engel
51dc158adbe2c9d1df3c941cbf78b90944d1afc2Markus Engel#
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White# Define targets
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White#
11f343b8117dbf56931f537820c2749a8232fec2Liam P. WhiteALL_TARGET = $(BINARY) $(SRC_CONFILE)
51dc158adbe2c9d1df3c941cbf78b90944d1afc2Markus EngelLINT_TARGET = $(MODULE).lint
e2d670e999945aa4ab409f5ad368cde00b450c69Martin OwensINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
51dc158adbe2c9d1df3c941cbf78b90944d1afc2Markus Engel
203b91a85466178dd14a24236e0e42539bc4a24bMarkus Engel#
203b91a85466178dd14a24236e0e42539bc4a24bMarkus Engel# lint pass one enforcement
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White#
05bb07872041bda1554e89f31df1a1596e95aa84Markus EngelCFLAGS += $(CCVERBOSE)
05bb07872041bda1554e89f31df1a1596e95aa84Markus Engel
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White# Define dependencies on scsi and cmlb
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White#
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixLDFLAGS += -dy -N misc/scsi -N misc/cmlb
c4ae5c46c1d9c171f96e47e81f2f0f5f0e189547cilix
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
11f343b8117dbf56931f537820c2749a8232fec2Liam P. White# For now, disable these lint checks; maintainers should endeavor
c4ae5c46c1d9c171f96e47e81f2f0f5f0e189547cilix# to investigate and remove these for maximum lint coverage.
c4ae5c46c1d9c171f96e47e81f2f0f5f0e189547cilix# Please do not carry these forward to new Makefiles.
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
c4ae5c46c1d9c171f96e47e81f2f0f5f0e189547cilixLINTTAGS += -erroff=E_STATIC_UNUSED
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixCERRWARN += -_gcc=-Wno-unused-variable
69f5c4dd44b76696be7d8d27f4059d420bd98bcccilixCERRWARN += -_gcc=-Wno-unused-function
69f5c4dd44b76696be7d8d27f4059d420bd98bcccilixCERRWARN += -_gcc=-Wno-unused-label
71dea9c6fbd2fd6d73cce6f1ed96151d51ada58fcilixCERRWARN += -_gcc=-Wno-parentheses
71dea9c6fbd2fd6d73cce6f1ed96151d51ada58fcilixCERRWARN += -_gcc=-Wno-type-limits
13223d251a0eca100512280a15dc9b2213a28809cilixCERRWARN += -_gcc=-Wno-uninitialized
e2d40573e3eece043a9e2607f851ed1d32251242cilix
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix#
5b8ee3df72dcac734e27c5f44c5060b5df2adfbdcilix# Default build targets.
32461c0cc717f51ba84908e1eea5b1ee150cf27ecilix#
7ed5165239990ad860859dd38806e0ac1736b8eecilix.KEEP_STATE:
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixall: $(ALL_DEPS)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixdef: $(DEF_DEPS)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixclean: $(CLEAN_DEPS)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilixclobber: $(CLOBBER_DEPS)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
4358ff6156766a315e38e72a5c3c83d6d5f7486bcilix
a4030d5ca449e7e384bc699cd249ee704faaeab0Chris Morganlint: $(LINT_DEPS)
modlintlib: $(MODLINTLIB_DEPS)
clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
#
# Include common targets.
#
include $(UTSBASE)/sparc/Makefile.targ
#
# Defines for local commands.
#
WARLOCK = warlock
WLCC = wlcc
TOUCH = touch
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_TARGETS = warlock_alone warlock_with_esp warlock_with_fas
warlock: $(WARLOCK_TARGETS)
warlock_alone: $(WARLOCK_OK)
$(WARLOCK_OK): $(WLCMD_DIR)/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_esp: $(WLCMD_DIR)/sd_with_esp.wlcmd $(WARLOCK_OUT) scsi_files \
esp_files warlock_ddi.files cmlb_files
$(WARLOCK) -c $(WLCMD_DIR)/sd_with_esp.wlcmd \
$(WARLOCK_OUT) ../esp/esp $(SCSI_FILES) $(CMLB_FILES) \
-l ../warlock/ddi_dki_impl.ll
warlock_with_fas: $(WLCMD_DIR)/sd_with_fas.wlcmd $(WARLOCK_OUT) scsi_files \
fas_files warlock_ddi.files cmlb_files
$(WARLOCK) -c $(WLCMD_DIR)/sd_with_fas.wlcmd \
$(WARLOCK_OUT) ../fas/fas \
../fas/fas_callbacks \
$(SCSI_FILES) $(CMLB_FILES) \
-l ../warlock/ddi_dki_impl.ll
cmlb_files:
@cd ../cmlb; pwd; $(MAKE) warlock
scsi_files:
@cd ../scsi; pwd; $(MAKE) warlock
esp_files:
@cd ../esp; pwd; $(MAKE) warlock
fas_files:
@cd ../fas; pwd; $(MAKE) warlock
warlock_ddi.files:
@cd ../warlock; pwd; $(MAKE) warlock