xref: /titanic_41/usr/src/uts/sparc/sd/Makefile (revision d89fccd8788afe1e920f842edd883fe192a1b8fe)
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 2005 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
49
50#
51#	Include common rules.
52#
53include $(UTSBASE)/sparc/Makefile.sparc
54
55#
56#	Define targets
57#
58ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
59LINT_TARGET	= $(MODULE).lint
60INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
61
62#
63# lint pass one enforcement
64#
65CFLAGS += $(CCVERBOSE)
66
67#
68#	Default build targets.
69#
70.KEEP_STATE:
71
72all:		$(ALL_DEPS)
73
74def:		$(DEF_DEPS)
75
76clean:		$(CLEAN_DEPS); \
77		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
78
79clobber:	$(CLOBBER_DEPS); \
80		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
81
82lint:		$(LINT_DEPS)
83
84modlintlib:	$(MODLINTLIB_DEPS)
85
86clean.lint:	$(CLEAN_LINT_DEPS)
87
88install:	$(INSTALL_DEPS)
89
90#
91#	Include common targets.
92#
93include	$(UTSBASE)/sparc/Makefile.targ
94
95
96#
97#	Defines for local commands.
98#
99WARLOCK		= warlock
100WLCC		= wlcc
101TOUCH		= touch
102SCCS		= sccs
103TEST		= test
104
105#
106# Warlock targets
107#
108# Note that in warlock_with_{esp,isp} it is important to load sd.ll
109# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
110# and warlock can only handle one extern function by a given name;
111# any loaded after the first are ignored.
112
113SD_FILES = $(SD_OBJS:%.o=%.ll)
114SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
115
116warlock: warlock_alone warlock_with_esp warlock_with_isp warlock_with_fas \
117	warlock_with_glm warlock_with_uata warlock_with_mpt
118
119warlock_alone: $(MODULE).ok $(SD_FILES)
120
121%.wlcmd:
122	$(TEST) -f $@  || $(SCCS) get $@
123
124warlock_with_esp: sd_with_esp.wlcmd $(SD_FILES) scsi_files esp_files \
125	warlock_ddi.files
126	$(WARLOCK) -c ./sd_with_esp.wlcmd \
127		$(SD_FILES) ../esp/esp $(SCSI_FILES) \
128		-l ../warlock/ddi_dki_impl.ll
129
130warlock_with_fas: sd_with_fas.wlcmd $(SD_FILES) scsi_files fas_files \
131	warlock_ddi.files
132	$(WARLOCK) -c ./sd_with_fas.wlcmd \
133		$(SD_FILES) ../fas/fas \
134		../fas/fas_callbacks \
135		$(SCSI_FILES) \
136		-l ../warlock/ddi_dki_impl.ll
137
138warlock_with_isp: sd_with_isp.wlcmd $(SD_FILES) scsi_files isp_files \
139	warlock_ddi.files
140	$(WARLOCK) -c ./sd_with_isp.wlcmd \
141		$(SD_FILES) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES) \
142		-l ../warlock/ddi_dki_impl.ll
143
144warlock_with_glm: sd_with_glm.wlcmd $(SD_FILES) scsi_files glm_files \
145	warlock_ddi.files
146	$(WARLOCK) -c ./sd_with_glm.wlcmd \
147		$(SD_FILES) $(CLOSED)/uts/sparc/glm/glm $(SCSI_FILES)  \
148		-l ../warlock/ddi_dki_impl.ll
149
150warlock_with_uata: sd_with_uata.wlcmd $(SD_FILES) scsi_files uata_files \
151	warlock_ddi.files
152	$(WARLOCK) -c ./sd_with_uata.wlcmd \
153		$(SD_FILES) $(CLOSED)/uts/sparc/uata/*.ll $(SCSI_FILES) \
154		-l ../warlock/ddi_dki_impl.ll
155
156warlock_with_mpt: sd_with_mpt.wlcmd $(SD_FILES) scsi_files mpt_files \
157	warlock_ddi.files
158	$(WARLOCK) -c ./sd_with_mpt.wlcmd \
159		$(SD_FILES) $(CLOSED)/uts/sparc/mpt/*.ll $(SCSI_FILES)  \
160		-l ../warlock/ddi_dki_impl.ll
161
162scsi_files:
163	@cd ../scsi; pwd; $(MAKE) warlock
164
165esp_files:
166	@cd ../esp; pwd; $(MAKE) warlock
167
168fas_files:
169	@cd ../fas; pwd; $(MAKE) warlock
170
171isp_files:
172	@cd $(CLOSED)/uts/sparc/isp; pwd; $(MAKE) warlock
173
174glm_files:
175	@cd $(CLOSED)/uts/sparc/glm; pwd; $(MAKE) warlock
176
177uata_files:
178	@cd $(CLOSED)/uts/sparc/uata; pwd; $(MAKE) warlock
179
180mpt_files:
181	@cd $(CLOSED)/uts/sparc/mpt; pwd; $(MAKE) warlock
182
183warlock_ddi.files:
184	@cd ../warlock; pwd; $(MAKE) warlock
185
186sd.ok: sd.wlcmd $(SD_FILES) scsi_files
187	$(WARLOCK) -c ./sd.wlcmd $(SD_FILES) $(SCSI_FILES) \
188		-l ../warlock/ddi_dki_impl.ll
189	$(TOUCH) $@
190
191%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
192	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
193