xref: /titanic_50/usr/src/uts/sparc/sd/Makefile (revision afd1ac7b1c9a8cdf273c865aa5e9a14620341443)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# uts/sparc/sd/Makefile
24#
25# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28#ident	"%Z%%M%	%I%	%E% SMI"
29#
30#	This makefile drives the production of the sd driver kernel module.
31#
32#	sparc architecture dependent
33#
34
35#
36#	Path to the base of the uts directory tree (usually /usr/src/uts).
37#
38UTSBASE	= ../..
39
40#
41#	Define the module and object file sets.
42#
43MODULE		= sd
44OBJECTS		= $(SD_OBJS:%=$(OBJS_DIR)/%)
45LINTS		= $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln)
46ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
47CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
48WARLOCK_OUT     = $(SD_OBJS:%.o=%.ll)
49WARLOCK_OK      = $(MODULE).ok
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#	Default build targets.
70#
71.KEEP_STATE:
72
73all:		$(ALL_DEPS)
74
75def:		$(DEF_DEPS)
76
77clean:		$(CLEAN_DEPS); \
78		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
79
80clobber:	$(CLOBBER_DEPS); \
81		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
82
83lint:		$(LINT_DEPS)
84
85modlintlib:	$(MODLINTLIB_DEPS)
86
87clean.lint:	$(CLEAN_LINT_DEPS)
88
89install:	$(INSTALL_DEPS)
90
91#
92#	Include common targets.
93#
94include	$(UTSBASE)/sparc/Makefile.targ
95
96
97#
98#	Defines for local commands.
99#
100WARLOCK		= warlock
101WLCC		= wlcc
102TOUCH		= touch
103SCCS		= sccs
104TEST		= test
105
106#
107# Warlock targets
108#
109# Note that in warlock_with_{esp,isp} it is important to load sd.ll
110# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
111# and warlock can only handle one extern function by a given name;
112# any loaded after the first are ignored.
113
114SD_FILES = $(SD_OBJS:%.o=%.ll)
115SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
116
117warlock: warlock_alone warlock_with_esp warlock_with_isp warlock_with_fas \
118	warlock_with_glm warlock_with_uata warlock_with_mpt
119
120warlock_alone: $(MODULE).ok $(SD_FILES)
121
122%.wlcmd:
123	$(TEST) -f $@  || $(SCCS) get $@
124
125warlock_with_esp: sd_with_esp.wlcmd $(SD_FILES) scsi_files esp_files \
126	warlock_ddi.files
127	$(WARLOCK) -c ./sd_with_esp.wlcmd \
128		$(SD_FILES) ../esp/esp $(SCSI_FILES) \
129		-l ../warlock/ddi_dki_impl.ll
130
131warlock_with_fas: sd_with_fas.wlcmd $(SD_FILES) scsi_files fas_files \
132	warlock_ddi.files
133	$(WARLOCK) -c ./sd_with_fas.wlcmd \
134		$(SD_FILES) ../fas/fas \
135		../fas/fas_callbacks \
136		$(SCSI_FILES) \
137		-l ../warlock/ddi_dki_impl.ll
138
139warlock_with_isp: sd_with_isp.wlcmd $(SD_FILES) scsi_files isp_files \
140	warlock_ddi.files
141	$(WARLOCK) -c ./sd_with_isp.wlcmd \
142		$(SD_FILES) ../isp/isp $(SCSI_FILES) \
143		-l ../warlock/ddi_dki_impl.ll
144
145warlock_with_glm: sd_with_glm.wlcmd $(SD_FILES) scsi_files glm_files \
146	warlock_ddi.files
147	$(WARLOCK) -c ./sd_with_glm.wlcmd \
148		$(SD_FILES) ../glm/glm $(SCSI_FILES)  \
149		-l ../warlock/ddi_dki_impl.ll
150
151warlock_with_uata: sd_with_uata.wlcmd $(SD_FILES) scsi_files uata_files \
152	warlock_ddi.files
153	$(WARLOCK) -c ./sd_with_uata.wlcmd \
154		$(SD_FILES) ../uata/*.ll $(SCSI_FILES) \
155		-l ../warlock/ddi_dki_impl.ll
156
157warlock_with_mpt: sd_with_mpt.wlcmd $(SD_FILES) scsi_files mpt_files \
158	warlock_ddi.files
159	$(WARLOCK) -c ./sd_with_mpt.wlcmd \
160		$(SD_FILES) ../mpt/*.ll $(SCSI_FILES)  \
161		-l ../warlock/ddi_dki_impl.ll
162
163scsi_files:
164	@cd ../scsi; pwd; $(MAKE) warlock
165
166esp_files:
167	@cd ../esp; pwd; $(MAKE) warlock
168
169fas_files:
170	@cd ../fas; pwd; $(MAKE) warlock
171
172isp_files:
173	@cd ../isp; pwd; $(MAKE) warlock
174
175glm_files:
176	@cd ../glm; pwd; $(MAKE) warlock
177
178uata_files:
179	@cd ../uata; pwd; $(MAKE) warlock
180
181mpt_files:
182	@cd ../mpt; pwd; $(MAKE) warlock
183
184warlock_ddi.files:
185	@cd ../warlock; pwd; $(MAKE) warlock
186
187sd.ok: sd.wlcmd $(SD_FILES) scsi_files
188	$(WARLOCK) -c ./sd.wlcmd $(SD_FILES) $(SCSI_FILES) \
189		-l ../warlock/ddi_dki_impl.ll
190	$(TOUCH) $@
191
192%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
193	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
194