xref: /titanic_51/usr/src/uts/sparc/sd/Makefile (revision 8b464eb836173b92f2b7a65623cd06c8c3c59289)
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
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)
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: $(WARLOCK_OK)
130
131%.wlcmd:
132	cd $(WLCMD_DIR); $(TEST) -f $@  || $(SCCS) get $@
133
134$(WARLOCK_OK): sd.wlcmd $(WARLOCK_OUT) scsi_files warlock_ddi.files
135	$(WARLOCK) -c $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
136		-l ../warlock/ddi_dki_impl.ll
137	$(TOUCH) $@
138
139%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
140	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
141
142warlock_with_esp: sd_with_esp.wlcmd $(WARLOCK_OUT) scsi_files esp_files \
143	warlock_ddi.files
144	$(WARLOCK) -c $(WLCMD_DIR)/sd_with_esp.wlcmd \
145		$(WARLOCK_OUT) ../esp/esp $(SCSI_FILES) \
146		-l ../warlock/ddi_dki_impl.ll
147
148warlock_with_fas: sd_with_fas.wlcmd $(WARLOCK_OUT) scsi_files fas_files \
149	warlock_ddi.files
150	$(WARLOCK) -c $(WLCMD_DIR)/sd_with_fas.wlcmd \
151		$(WARLOCK_OUT) ../fas/fas \
152		../fas/fas_callbacks \
153		$(SCSI_FILES) \
154		-l ../warlock/ddi_dki_impl.ll
155
156warlock_with_isp: sd_with_isp.wlcmd $(WARLOCK_OUT) scsi_files isp_files \
157	warlock_ddi.files
158	$(WARLOCK) -c $(WLCMD_DIR)/sd_with_isp.wlcmd \
159		$(WARLOCK_OUT) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES) \
160		-l ../warlock/ddi_dki_impl.ll
161
162warlock_with_glm: sd_with_glm.wlcmd $(WARLOCK_OUT) scsi_files glm_files \
163	warlock_ddi.files
164	$(WARLOCK) -c $(WLCMD_DIR)/sd_with_glm.wlcmd \
165		$(WARLOCK_OUT) $(CLOSED)/uts/sparc/glm/glm $(SCSI_FILES)  \
166		-l ../warlock/ddi_dki_impl.ll
167
168warlock_with_uata: sd_with_uata.wlcmd $(WARLOCK_OUT) scsi_files uata_files \
169	warlock_ddi.files
170	$(WARLOCK) -c $(WLCMD_DIR)/sd_with_uata.wlcmd \
171		$(WARLOCK_OUT) $(CLOSED)/uts/sparc/uata/*.ll $(SCSI_FILES) \
172		-l ../warlock/ddi_dki_impl.ll
173
174warlock_with_mpt: sd_with_mpt.wlcmd $(WARLOCK_OUT) scsi_files mpt_files \
175	warlock_ddi.files
176	$(WARLOCK) -c $(WLCMD_DIR)/sd_with_mpt.wlcmd \
177		$(WARLOCK_OUT) $(CLOSED)/uts/sparc/mpt/*.ll $(SCSI_FILES)  \
178		-l ../warlock/ddi_dki_impl.ll
179
180scsi_files:
181	@cd ../scsi; pwd; $(MAKE) warlock
182
183esp_files:
184	@cd ../esp; pwd; $(MAKE) warlock
185
186fas_files:
187	@cd ../fas; pwd; $(MAKE) warlock
188
189isp_files:
190	@cd $(CLOSED)/uts/sparc/isp; pwd; $(MAKE) warlock
191
192glm_files:
193	@cd $(CLOSED)/uts/sparc/glm; pwd; $(MAKE) warlock
194
195uata_files:
196	@cd $(CLOSED)/uts/sparc/uata; pwd; $(MAKE) warlock
197
198mpt_files:
199	@cd $(CLOSED)/uts/sparc/mpt; pwd; $(MAKE) warlock
200
201warlock_ddi.files:
202	@cd ../warlock; pwd; $(MAKE) warlock
203