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