xref: /titanic_52/usr/src/uts/sparc/st/Makefile (revision f498645a3eecf2ddd304b4ea9c7f1b4c155ff79e)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This makefile drives the production of the st driver kernel module.
29#
30#	sparc architecture dependent
31#
32
33#
34#	Path to the base of the uts directory tree (usually /usr/src/uts).
35#
36UTSBASE	= ../..
37
38#
39#	Define the module and object file sets.
40#
41MODULE		= st
42OBJECTS		= $(ST_OBJS:%=$(OBJS_DIR)/%)
43LINTS		= $(ST_OBJS:%.o=$(LINTS_DIR)/%.ln)
44ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
46WARLOCK_OUT     = $(ST_OBJS:%.o=%.ll)
47WARLOCK_OK      = $(MODULE).ok
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		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
77
78clobber:	$(CLOBBER_DEPS); \
79		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
80
81lint:		$(LINT_DEPS)
82
83modlintlib:	$(MODLINTLIB_DEPS)
84
85clean.lint:	$(CLEAN_LINT_DEPS)
86
87install:	$(INSTALL_DEPS)
88
89#	Include common targets.
90#
91include $(UTSBASE)/sparc/Makefile.targ
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 st.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
110SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
111ST_FILES = $(ST_OBJS:%.o=%.ll)
112
113warlock: warlock_alone warlock_with_esp warlock_with_isp warlock_with_fas \
114	warlock_with_glm
115
116warlock_alone: $(MODULE).ok
117
118%.wlcmd:
119	$(TEST) -f $@  || $(SCCS) get $@
120
121warlock_with_esp: st_with_esp.wlcmd $(ST_FILES) scsi_files esp_files \
122	warlock_ddi.files
123	$(WARLOCK) -c ./st_with_esp.wlcmd \
124		$(ST_FILES) ../esp/esp $(SCSI_FILES)  \
125		-l ../warlock/ddi_dki_impl.ll
126
127warlock_with_fas: st_with_fas.wlcmd $(ST_FILES) scsi_files fas_files \
128	warlock_ddi.files
129	$(WARLOCK) -c ./st_with_fas.wlcmd \
130		$(ST_FILES) \
131		../fas/fas ../fas/fas_callbacks \
132		$(SCSI_FILES)  \
133		-l ../warlock/ddi_dki_impl.ll
134
135warlock_with_isp: st_with_isp.wlcmd $(ST_FILES) scsi_files isp_files \
136	warlock_ddi.files
137	$(WARLOCK) -c ./st_with_isp.wlcmd \
138		$(ST_FILES) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES)  \
139		-l ../warlock/ddi_dki_impl.ll
140
141warlock_with_glm: st_with_glm.wlcmd $(ST_FILES) scsi_files glm_files \
142	warlock_ddi.files
143	$(WARLOCK) -c ./st_with_glm.wlcmd \
144		$(ST_FILES) $(CLOSED)/uts/sparc/glm/glm $(SCSI_FILES) \
145		-l ../warlock/ddi_dki_impl.ll
146
147scsi_files:
148	@cd ../scsi; pwd; $(MAKE) warlock
149
150esp_files:
151	@cd ../esp; pwd; $(MAKE) warlock
152
153fas_files:
154	@cd ../fas; pwd; $(MAKE) warlock
155
156isp_files:
157	@cd $(CLOSED)/uts/sparc/isp; pwd; $(MAKE) warlock
158
159glm_files:
160	@cd $(CLOSED)/uts/sparc/glm; pwd; $(MAKE) warlock
161
162st.ok: st.wlcmd st.ll st_conf.ll  scsi_files warlock_ddi.files
163	$(WARLOCK) -c ./st.wlcmd $(ST_FILES) $(SCSI_FILES) \
164	-l ../warlock/ddi_dki_impl.ll
165	$(TOUCH) $@
166
167%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
168	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
169
170warlock_ddi.files:
171	@cd ../warlock; pwd; $(MAKE) warlock
172
173scsi.files:
174	@cd ../scsi; pwd; $(MAKE) warlock
175