Makefile revision 4604:5989fb2cb1d5
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
113TEST		= test
114
115#
116# Warlock targets
117#
118# Note that in warlock_with_{esp,isp} it is important to load sd.ll
119# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
120# and warlock can only handle one extern function by a given name;
121# any loaded after the first are ignored.
122
123SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
124CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
125
126WARLOCK_TARGETS = warlock_alone warlock_with_esp warlock_with_fas
127$(CLOSED_BUILD)WARLOCK_TARGETS += warlock_with_isp warlock_with_glm \
128	warlock_with_uata warlock_with_mpt
129
130warlock: $(WARLOCK_TARGETS)
131
132warlock_alone: $(WARLOCK_OK)
133
134$(WARLOCK_OK): $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) scsi_files \
135	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: $(WLCMD_DIR)/sd_with_esp.wlcmd $(WARLOCK_OUT) scsi_files \
145	esp_files 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: $(WLCMD_DIR)/sd_with_fas.wlcmd $(WARLOCK_OUT) scsi_files \
151	fas_files 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: $(WLCMD_DIR)/sd_with_isp.wlcmd $(WARLOCK_OUT) scsi_files \
159	isp_files 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: $(WLCMD_DIR)/sd_with_glm.wlcmd $(WARLOCK_OUT) scsi_files \
166	glm_files 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: $(WLCMD_DIR)/sd_with_uata.wlcmd $(WARLOCK_OUT) scsi_files \
173	uata_files 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: $(WLCMD_DIR)/sd_with_mpt.wlcmd $(WARLOCK_OUT) scsi_files \
180	mpt_files 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