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