xref: /titanic_52/usr/src/uts/sparc/ses/Makefile (revision 1d842814faabbb6af3e2fe30a4bd61aa4a70eeb3)
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#
22# uts/sparc/ses/Makefile
23#
24# Copyright 2006 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 ses 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		= ses
43OBJECTS		= $(SES_OBJS:%=$(OBJS_DIR)/%)
44LINTS		= $(SES_OBJS:%.o=$(LINTS_DIR)/%.ln)
45ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
46CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
47WARLOCK_OUT     = $(SES_OBJS:%.o=%.ll)
48WARLOCK_OK      = $(MODULE).ok
49WLCMD_DIR	= $(UTSBASE)/common/io/warlock
50
51#
52# Include common rules.
53#
54include $(UTSBASE)/sparc/Makefile.sparc
55
56#
57# Define targets
58#
59ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
60LINT_TARGET	= $(MODULE).lint
61INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
62CLEANFILES	+= $(WARLOCK_TARGETS)
63
64#
65# For now, disable these lint checks; maintainers should endeavor
66# to investigate and remove these for maximum lint coverage.
67# Please do not carry these forward to new Makefiles.
68#
69LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
70LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
71LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
72
73#
74# Default build targets.
75#
76.KEEP_STATE:
77
78def:		$(DEF_DEPS)
79
80all:		$(ALL_DEPS)
81
82clean:		$(CLEAN_DEPS)
83		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
84
85clobber:	$(CLOBBER_DEPS)
86		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
87
88modlintlib:	$(MODLINTLIB_DEPS) lint64
89
90clean.lint:	$(CLEAN_LINT_DEPS)
91
92install:	$(INSTALL_DEPS)
93
94#
95#	Include common targets.
96#
97include $(UTSBASE)/sparc/Makefile.targ
98
99
100#
101# Defines for local commands.
102#
103WARLOCK		= warlock
104WLCC		= wlcc
105TOUCH		= touch
106SCCS		= sccs
107TEST		= test
108
109#
110# Warlock targets
111#
112# XXX FIX ME.  this can be improved quite a bit
113
114SES_FILES	= $(MODULE).ll
115SCSI_FILES	= $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
116
117%.wlcmd:
118	cd $(WLCMD_DIR); $(TEST) -f $@  || $(SCCS) get $@
119
120
121WARLOCK_TARGETS	= $(WARLOCK_OK) warlock_with_esp.ok warlock_with_fas.ok \
122		  warlock_with_isp.ok warlock_with_glm.ok
123
124warlock: $(WARLOCK_TARGETS)
125
126$(WARLOCK_OK): $(MODULE).wlcmd $(SES_FILES)
127	@cd ../warlock; $(MAKE) warlock
128	@cd ../scsi; $(MAKE) warlock
129	$(WARLOCK) -c $(WLCMD_DIR)/$(MODULE).wlcmd $(SES_FILES) ../warlock/scsi.ll \
130	        -l ../warlock/ddi_dki_impl.ll  \
131	        $(SCSI_FILES)
132	@ $(TOUCH) $@
133
134warlock_with_esp.ok: ses_with_esp.wlcmd $(SES_FILES)
135	@cd ../warlock; $(MAKE) warlock
136	@cd ../scsi; $(MAKE) warlock
137	@cd ../esp; $(MAKE) warlock;
138	$(WARLOCK) -c $(WLCMD_DIR)/ses_with_esp.wlcmd $(SES_FILES) ../esp/esp  \
139	        ../warlock/scsi.ll \
140	        -l ../warlock/ddi_dki_impl.ll \
141	        $(SCSI_FILES)
142	@ $(TOUCH) $@
143
144warlock_with_fas.ok: ses_with_fas.wlcmd $(SES_FILES)
145	@cd ../warlock; $(MAKE) warlock
146	@cd ../scsi; $(MAKE) warlock
147	@cd ../fas; $(MAKE) warlock;
148	$(WARLOCK) -c $(WLCMD_DIR)/ses_with_fas.wlcmd $(SES_FILES) \
149	        ../fas/fas ../fas/fas_callbacks \
150	        ../warlock/scsi.ll \
151	        -l ../warlock/ddi_dki_impl.ll \
152	        $(SCSI_FILES)
153	@ $(TOUCH) $@
154
155warlock_with_isp.ok: ses_with_isp.wlcmd $(SES_FILES)
156	@cd ../warlock; $(MAKE) warlock
157	@cd ../scsi; $(MAKE) warlock
158	@cd $(CLOSED)/uts/sparc/isp; $(MAKE) warlock;
159	$(WARLOCK) -c $(WLCMD_DIR)/ses_with_isp.wlcmd $(SES_FILES) \
160		$(CLOSED)/uts/sparc/isp/isp \
161	        ../warlock/scsi.ll \
162	        -l ../warlock/ddi_dki_impl.ll \
163	        $(SCSI_FILES)
164	@ $(TOUCH) $@
165
166warlock_with_glm.ok: ses_with_glm.wlcmd $(SES_FILES)
167	@cd ../warlock; $(MAKE) warlock
168	@cd ../scsi; $(MAKE) warlock
169	@cd $(CLOSED)/uts/sparc/glm; $(MAKE) warlock;
170	$(WARLOCK) -c $(WLCMD_DIR)/ses_with_glm.wlcmd $(SES_FILES) \
171		$(CLOSED)/uts/sparc/glm/glm \
172	        ../warlock/scsi.ll \
173	        -l ../warlock/ddi_dki_impl.ll \
174	        $(SCSI_FILES)
175	@ $(TOUCH) $@
176
177%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
178	$(WLCC) $(CPPFLAGS) -o $@ $<
179
180
181