xref: /titanic_51/usr/src/uts/sparc/ses/Makefile (revision 9584cebb1c69707f4c67306b661c2ed47d8676f1)
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 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26# Copyright (c) 2011 Bayard G. Bell. All rights reserved.
27#
28# This makefile drives the production of the ses 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		= ses
42OBJECTS		= $(SES_OBJS:%=$(OBJS_DIR)/%)
43LINTS		= $(SES_OBJS:%.o=$(LINTS_DIR)/%.ln)
44ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
46WARLOCK_OUT     = $(SES_OBJS:%.o=%.ll)
47WARLOCK_OK      = $(MODULE).ok
48WLCMD_DIR	= $(UTSBASE)/common/io/warlock
49
50#
51# Include common rules.
52#
53include $(UTSBASE)/sparc/Makefile.sparc
54
55#
56# Define targets
57#
58ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
59LINT_TARGET	= $(MODULE).lint
60INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
61CLEANFILES	+= $(WARLOCK_TARGETS)
62
63#
64# Define dependency on scsi
65#
66LDFLAGS += -dy -N misc/scsi
67
68#
69# For now, disable these lint checks; maintainers should endeavor
70# to investigate and remove these for maximum lint coverage.
71# Please do not carry these forward to new Makefiles.
72#
73LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
74LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
75LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
76
77#
78# Default build targets.
79#
80.KEEP_STATE:
81
82def:		$(DEF_DEPS)
83
84all:		$(ALL_DEPS)
85
86clean:		$(CLEAN_DEPS)
87		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
88
89clobber:	$(CLOBBER_DEPS)
90		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
91
92modlintlib:	$(MODLINTLIB_DEPS) lint64
93
94clean.lint:	$(CLEAN_LINT_DEPS)
95
96install:	$(INSTALL_DEPS)
97
98#
99#	Include common targets.
100#
101include $(UTSBASE)/sparc/Makefile.targ
102
103
104#
105# Defines for local commands.
106#
107WARLOCK		= warlock
108WLCC		= wlcc
109TOUCH		= touch
110TEST		= test
111
112#
113# Warlock targets
114#
115# XXX FIX ME.  this can be improved quite a bit
116
117SES_FILES	= $(MODULE).ll
118SCSI_FILES	= $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
119
120WARLOCK_TARGETS	= $(WARLOCK_OK) warlock_with_esp.ok warlock_with_fas.ok
121
122warlock: $(WARLOCK_TARGETS)
123
124$(WARLOCK_OK): $(WLCMD_DIR)/$(MODULE).wlcmd $(SES_FILES)
125	@cd ../warlock; $(MAKE) warlock
126	@cd ../scsi; $(MAKE) warlock
127	$(WARLOCK) -c $(WLCMD_DIR)/$(MODULE).wlcmd $(SES_FILES) ../warlock/scsi.ll \
128	        -l ../warlock/ddi_dki_impl.ll  \
129	        $(SCSI_FILES)
130	@ $(TOUCH) $@
131
132warlock_with_esp.ok: $(WLCMD_DIR)/ses_with_esp.wlcmd $(SES_FILES)
133	@cd ../warlock; $(MAKE) warlock
134	@cd ../scsi; $(MAKE) warlock
135	@cd ../esp; $(MAKE) warlock;
136	$(WARLOCK) -c $(WLCMD_DIR)/ses_with_esp.wlcmd $(SES_FILES) ../esp/esp  \
137	        ../warlock/scsi.ll \
138	        -l ../warlock/ddi_dki_impl.ll \
139	        $(SCSI_FILES)
140	@ $(TOUCH) $@
141
142warlock_with_fas.ok: $(WLCMD_DIR)/ses_with_fas.wlcmd $(SES_FILES)
143	@cd ../warlock; $(MAKE) warlock
144	@cd ../scsi; $(MAKE) warlock
145	@cd ../fas; $(MAKE) warlock;
146	$(WARLOCK) -c $(WLCMD_DIR)/ses_with_fas.wlcmd $(SES_FILES) \
147	        ../fas/fas ../fas/fas_callbacks \
148	        ../warlock/scsi.ll \
149	        -l ../warlock/ddi_dki_impl.ll \
150	        $(SCSI_FILES)
151	@ $(TOUCH) $@
152
153%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
154	$(WLCC) $(CPPFLAGS) -o $@ $<
155
156
157