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