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#
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
47
48WARLOCK_OUT     = $(SES_OBJS:%.o=%.ll)
49WARLOCK_OK      = $(MODULE).ok
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
84clean:		$(CLEAN_DEPS); \
85		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
86
87clobber:	$(CLOBBER_DEPS); \
88		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
89
90modlintlib:	$(MODLINTLIB_DEPS) lint64
91
92clean.lint:	$(CLEAN_LINT_DEPS)
93
94install:	$(INSTALL_DEPS)
95
96#
97#	Include common targets.
98#
99include $(UTSBASE)/sparc/Makefile.targ
100
101
102#
103# Defines for local commands.
104#
105WARLOCK		= warlock
106WLCC		= wlcc
107TOUCH		= touch
108SCCS		= sccs
109TEST		= test
110
111#
112# Warlock targets
113#
114SES_FILES	= $(MODULE).ll
115SCSI_FILES	= $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
116
117WARLOCK_TARGETS	= warlock.ok warlock_with_esp.ok warlock_with_fas.ok \
118		  warlock_with_isp.ok warlock_with_glm.ok
119
120warlock: $(WARLOCK_TARGETS)
121
122warlock.ok: $(MODULE).wlcmd $(SES_FILES)
123	@cd ../warlock; $(MAKE) warlock
124	@cd ../scsi; $(MAKE) warlock
125	$(WARLOCK) -c ./$(MODULE).wlcmd $(SES_FILES) ../warlock/scsi.ll \
126	        -l ../warlock/ddi_dki_impl.ll  \
127	        $(SCSI_FILES)
128	@ $(TOUCH) $@
129
130warlock_with_esp.ok: ses_with_esp.wlcmd $(SES_FILES)
131	@cd ../warlock; $(MAKE) warlock
132	@cd ../scsi; $(MAKE) warlock
133	@cd ../esp; $(MAKE) warlock;
134	$(WARLOCK) -c ./ses_with_esp.wlcmd $(SES_FILES) ../esp/esp  \
135	        ../warlock/scsi.ll \
136	        -l ../warlock/ddi_dki_impl.ll \
137	        $(SCSI_FILES)
138	@ $(TOUCH) $@
139
140warlock_with_fas.ok: ses_with_fas.wlcmd $(SES_FILES)
141	@cd ../warlock; $(MAKE) warlock
142	@cd ../scsi; $(MAKE) warlock
143	@cd ../fas; $(MAKE) warlock;
144	$(WARLOCK) -c ./ses_with_fas.wlcmd $(SES_FILES) \
145	        ../fas/fas ../fas/fas_callbacks \
146	        ../warlock/scsi.ll \
147	        -l ../warlock/ddi_dki_impl.ll \
148	        $(SCSI_FILES)
149	@ $(TOUCH) $@
150
151warlock_with_isp.ok: ses_with_isp.wlcmd $(SES_FILES)
152	@cd ../warlock; $(MAKE) warlock
153	@cd ../scsi; $(MAKE) warlock
154	@cd $(CLOSED)/uts/sparc/isp; $(MAKE) warlock;
155	$(WARLOCK) -c ./ses_with_isp.wlcmd $(SES_FILES) \
156		$(CLOSED)/uts/sparc/isp/isp \
157	        ../warlock/scsi.ll \
158	        -l ../warlock/ddi_dki_impl.ll \
159	        $(SCSI_FILES)
160	@ $(TOUCH) $@
161
162warlock_with_glm.ok: ses_with_glm.wlcmd $(SES_FILES)
163	@cd ../warlock; $(MAKE) warlock
164	@cd ../scsi; $(MAKE) warlock
165	@cd $(CLOSED)/uts/sparc/glm; $(MAKE) warlock;
166	$(WARLOCK) -c ./ses_with_glm.wlcmd $(SES_FILES) \
167		$(CLOSED)/uts/sparc/glm/glm \
168	        ../warlock/scsi.ll \
169	        -l ../warlock/ddi_dki_impl.ll \
170	        $(SCSI_FILES)
171	@ $(TOUCH) $@
172
173%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
174	$(WLCC) $(CPPFLAGS) -o $@ $<
175
176
177