xref: /titanic_50/usr/src/uts/sparc/st/Makefile (revision 35551380472894a564e057962b701af78f719377)
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# uts/sparc/st/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 st 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		= st
43OBJECTS		= $(ST_OBJS:%=$(OBJS_DIR)/%)
44LINTS		= $(ST_OBJS:%.o=$(LINTS_DIR)/%.ln)
45ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
46CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
47WARLOCK_OUT     = $(ST_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#	Include common targets.
91#
92include $(UTSBASE)/sparc/Makefile.targ
93
94#
95#	Defines for local commands.
96#
97WARLOCK		= warlock
98WLCC		= wlcc
99TOUCH		= touch
100SCCS		= sccs
101TEST		= test
102
103#
104# Warlock targets
105#
106# Note that in warlock_with_{esp,isp} it is important to load st.ll
107# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
108# and warlock can only handle one extern function by a given name;
109# any loaded after the first are ignored.
110
111SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
112ST_FILES = $(ST_OBJS:%.o=%.ll)
113
114warlock: warlock_alone warlock_with_esp warlock_with_isp warlock_with_fas \
115	warlock_with_glm
116
117warlock_alone: $(MODULE).ok
118
119%.wlcmd:
120	$(TEST) -f $@  || $(SCCS) get $@
121
122warlock_with_esp: st_with_esp.wlcmd $(ST_FILES) scsi_files esp_files \
123	warlock_ddi.files
124	$(WARLOCK) -c ./st_with_esp.wlcmd \
125		$(ST_FILES) ../esp/esp $(SCSI_FILES)  \
126		-l ../warlock/ddi_dki_impl.ll
127
128warlock_with_fas: st_with_fas.wlcmd $(ST_FILES) scsi_files fas_files \
129	warlock_ddi.files
130	$(WARLOCK) -c ./st_with_fas.wlcmd \
131		$(ST_FILES) \
132		../fas/fas ../fas/fas_callbacks \
133		$(SCSI_FILES)  \
134		-l ../warlock/ddi_dki_impl.ll
135
136warlock_with_isp: st_with_isp.wlcmd $(ST_FILES) scsi_files isp_files \
137	warlock_ddi.files
138	$(WARLOCK) -c ./st_with_isp.wlcmd \
139		$(ST_FILES) ../isp/isp $(SCSI_FILES)  \
140		-l ../warlock/ddi_dki_impl.ll
141
142warlock_with_glm: st_with_glm.wlcmd $(ST_FILES) scsi_files glm_files \
143	warlock_ddi.files
144	$(WARLOCK) -c ./st_with_glm.wlcmd \
145		$(ST_FILES) ../glm/glm $(SCSI_FILES) \
146		-l ../warlock/ddi_dki_impl.ll
147
148scsi_files:
149	@cd ../scsi; pwd; $(MAKE) warlock
150
151esp_files:
152	@cd ../esp; pwd; $(MAKE) warlock
153
154fas_files:
155	@cd ../fas; pwd; $(MAKE) warlock
156
157isp_files:
158	@cd ../isp; pwd; $(MAKE) warlock
159
160glm_files:
161	@cd ../glm; pwd; $(MAKE) warlock
162
163st.ok: st.wlcmd st.ll st_conf.ll  scsi_files warlock_ddi.files
164	$(WARLOCK) -c ./st.wlcmd $(ST_FILES) $(SCSI_FILES) \
165	-l ../warlock/ddi_dki_impl.ll
166	$(TOUCH) $@
167
168%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
169	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
170
171warlock_ddi.files:
172	@cd ../warlock; pwd; $(MAKE) warlock
173
174scsi.files:
175	@cd ../scsi; pwd; $(MAKE) warlock
176