Makefile revision 3066:2a2af34f0642
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 2006 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# For now, disable these lint checks; maintainers should endeavor
68# to investigate and remove these for maximum lint coverage.
69# Please do not carry these forward to new Makefiles.
70#
71LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
72LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
73LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
74
75#
76#	Default build targets.
77#
78.KEEP_STATE:
79
80all:		$(ALL_DEPS)
81
82def:		$(DEF_DEPS)
83
84clean:		$(CLEAN_DEPS); \
85		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
86
87clobber:	$(CLOBBER_DEPS); \
88		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
89
90lint:		$(LINT_DEPS)
91
92modlintlib:	$(MODLINTLIB_DEPS)
93
94clean.lint:	$(CLEAN_LINT_DEPS)
95
96install:	$(INSTALL_DEPS)
97
98#	Include common targets.
99#
100include $(UTSBASE)/sparc/Makefile.targ
101
102#
103#	Defines for local commands.
104#
105WARLOCK		= warlock
106WLCC		= wlcc
107TOUCH		= touch
108SCCS		= sccs
109TEST		= test
110
111#
112# Warlock targets
113#
114# Note that in warlock_with_{esp,isp} it is important to load st.ll
115# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
116# and warlock can only handle one extern function by a given name;
117# any loaded after the first are ignored.
118
119SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
120ST_FILES = $(ST_OBJS:%.o=%.ll)
121
122warlock: warlock_alone warlock_with_esp warlock_with_isp warlock_with_fas \
123	warlock_with_glm
124
125warlock_alone: $(MODULE).ok
126
127%.wlcmd:
128	$(TEST) -f $@  || $(SCCS) get $@
129
130warlock_with_esp: st_with_esp.wlcmd $(ST_FILES) scsi_files esp_files \
131	warlock_ddi.files
132	$(WARLOCK) -c ./st_with_esp.wlcmd \
133		$(ST_FILES) ../esp/esp $(SCSI_FILES)  \
134		-l ../warlock/ddi_dki_impl.ll
135
136warlock_with_fas: st_with_fas.wlcmd $(ST_FILES) scsi_files fas_files \
137	warlock_ddi.files
138	$(WARLOCK) -c ./st_with_fas.wlcmd \
139		$(ST_FILES) \
140		../fas/fas ../fas/fas_callbacks \
141		$(SCSI_FILES)  \
142		-l ../warlock/ddi_dki_impl.ll
143
144warlock_with_isp: st_with_isp.wlcmd $(ST_FILES) scsi_files isp_files \
145	warlock_ddi.files
146	$(WARLOCK) -c ./st_with_isp.wlcmd \
147		$(ST_FILES) $(CLOSED)/uts/sparc/isp/isp $(SCSI_FILES)  \
148		-l ../warlock/ddi_dki_impl.ll
149
150warlock_with_glm: st_with_glm.wlcmd $(ST_FILES) scsi_files glm_files \
151	warlock_ddi.files
152	$(WARLOCK) -c ./st_with_glm.wlcmd \
153		$(ST_FILES) $(CLOSED)/uts/sparc/glm/glm $(SCSI_FILES) \
154		-l ../warlock/ddi_dki_impl.ll
155
156scsi_files:
157	@cd ../scsi; pwd; $(MAKE) warlock
158
159esp_files:
160	@cd ../esp; pwd; $(MAKE) warlock
161
162fas_files:
163	@cd ../fas; pwd; $(MAKE) warlock
164
165isp_files:
166	@cd $(CLOSED)/uts/sparc/isp; pwd; $(MAKE) warlock
167
168glm_files:
169	@cd $(CLOSED)/uts/sparc/glm; pwd; $(MAKE) warlock
170
171st.ok: st.wlcmd st.ll st_conf.ll  scsi_files warlock_ddi.files
172	$(WARLOCK) -c ./st.wlcmd $(ST_FILES) $(SCSI_FILES) \
173	-l ../warlock/ddi_dki_impl.ll
174	$(TOUCH) $@
175
176%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
177	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
178
179warlock_ddi.files:
180	@cd ../warlock; pwd; $(MAKE) warlock
181
182scsi.files:
183	@cd ../scsi; pwd; $(MAKE) warlock
184