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