xref: /titanic_52/usr/src/uts/sparc/st/Makefile (revision ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6)
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# uts/sparc/st/Makefile
22#
23# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25# Copyright (c) 2011 Bayard G. Bell. All rights reserved.
26#
27#	This makefile drives the production of the st driver kernel module.
28#
29#	sparc architecture dependent
30#
31
32#
33#	Path to the base of the uts directory tree (usually /usr/src/uts).
34#
35UTSBASE	= ../..
36
37#
38#	Define the module and object file sets.
39#
40MODULE		= st
41OBJECTS		= $(ST_OBJS:%=$(OBJS_DIR)/%)
42LINTS		= $(ST_OBJS:%.o=$(LINTS_DIR)/%.ln)
43ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
44CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
45WARLOCK_OUT     = $(ST_OBJS:%.o=%.ll)
46WARLOCK_OK      = $(MODULE).ok
47WLCMD_DIR       = $(UTSBASE)/common/io/warlock
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# Define dependency on scsi
68#
69LDFLAGS += -dy -N misc/scsi
70
71#
72# For now, disable these lint checks; maintainers should endeavor
73# to investigate and remove these for maximum lint coverage.
74# Please do not carry these forward to new Makefiles.
75#
76LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
77LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
78LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
79
80CERRWARN	+= -_gcc=-Wno-parentheses
81CERRWARN	+= -_gcc=-Wno-switch
82CERRWARN	+= -_gcc=-Wno-uninitialized
83
84#
85#	Default build targets.
86#
87.KEEP_STATE:
88
89all:		$(ALL_DEPS)
90
91def:		$(DEF_DEPS)
92
93clean:		$(CLEAN_DEPS)
94		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
95
96clobber:	$(CLOBBER_DEPS)
97		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
98
99lint:		$(LINT_DEPS)
100
101modlintlib:	$(MODLINTLIB_DEPS)
102
103clean.lint:	$(CLEAN_LINT_DEPS)
104
105install:	$(INSTALL_DEPS)
106
107#	Include common targets.
108#
109include $(UTSBASE)/sparc/Makefile.targ
110
111#
112#	Defines for local commands.
113#
114WARLOCK		= warlock
115WLCC		= wlcc
116TOUCH		= touch
117TEST		= test
118
119#
120# Warlock targets
121#
122# Note that in warlock_with_{esp,isp} it is important to load st.ll
123# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
124# and warlock can only handle one extern function by a given name;
125# any loaded after the first are ignored.
126
127SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
128
129WARLOCK_TARGETS =  warlock_alone warlock_with_esp warlock_with_fas
130$(CLOSED_BUILD)WARLOCK_TARGETS += warlock_with_isp warlock_with_glm
131
132warlock: $(WARLOCK_TARGETS)
133
134warlock_alone: $(WARLOCK_OK)
135
136warlock_with_esp: $(WLCMD_DIR)/st_with_esp.wlcmd $(WARLOCK_OUT) scsi_files \
137	esp_files warlock_ddi.files
138	$(WARLOCK) -c $(WLCMD_DIR)/st_with_esp.wlcmd \
139		$(WARLOCK_OUT) ../esp/esp $(SCSI_FILES)  \
140		-l ../warlock/ddi_dki_impl.ll
141
142warlock_with_fas: $(WLCMD_DIR)/st_with_fas.wlcmd $(WARLOCK_OUT) scsi_files \
143	fas_files warlock_ddi.files
144	$(WARLOCK) -c $(WLCMD_DIR)/st_with_fas.wlcmd \
145		$(WARLOCK_OUT) \
146		../fas/fas ../fas/fas_callbacks \
147		$(SCSI_FILES)  \
148		-l ../warlock/ddi_dki_impl.ll
149
150warlock_with_isp: $(WLCMD_DIR)/st_with_isp.wlcmd $(WARLOCK_OUT) scsi_files \
151	isp_files warlock_ddi.files
152	$(WARLOCK) -c $(WLCMD_DIR)/st_with_isp.wlcmd \
153		$(WARLOCK_OUT) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES)  \
154		-l ../warlock/ddi_dki_impl.ll
155
156warlock_with_glm: $(WLCMD_DIR)/st_with_glm.wlcmd $(WARLOCK_OUT) scsi_files \
157	glm_files warlock_ddi.files
158	$(WARLOCK) -c $(WLCMD_DIR)/st_with_glm.wlcmd \
159		$(WARLOCK_OUT) $(CLOSED)/uts/sparc/glm/glm $(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
177st.ok: $(WLCMD_DIR)/st.wlcmd st.ll st_conf.ll  scsi_files warlock_ddi.files
178	$(WARLOCK) -c $(WLCMD_DIR)/st.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
179	-l ../warlock/ddi_dki_impl.ll
180	$(TOUCH) $@
181
182%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
183	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
184
185warlock_ddi.files:
186	@cd ../warlock; pwd; $(MAKE) warlock
187
188scsi.files:
189	@cd ../scsi; pwd; $(MAKE) warlock
190