xref: /titanic_41/usr/src/uts/sparc/ssd/Makefile (revision f3312ec0e8acbd249df97358fb8c3ca92f4e089c)
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/ssd/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
29#
30#	This makefile drives the production of the ssd 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		= ssd
44OBJECTS		= $(SSD_OBJS:%=$(OBJS_DIR)/%)
45LINTS		= $(SSD_OBJS:%.o=$(LINTS_DIR)/%.ln)
46ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
47CONF_SRCDIR	= $(UTSBASE)/sun/io/scsi/targets
48WARLOCK_OUT     = ssd.ll
49WARLOCK_OK      = $(MODULE).ok
50WLCMD_DIR       = $(UTSBASE)/common/io/warlock
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)
63
64#
65# lint pass one enforcement
66#
67CFLAGS += $(CCVERBOSE) -D__fibre -dalign
68LINTFLAGS += -D__fibre
69WLCCFLAGS = -D__fibre
70
71#
72# For now, disable these lint checks; maintainers should endeavor
73# to investigate and remove these for maximum lint coverage.
74# Please do not carry these forward to new Makefiles.
75#
76LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
77LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
78LINTTAGS	+= -erroff=E_STATIC_UNUSED
79LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
80
81CERRWARN	+= -_gcc=-Wno-unused-function
82CERRWARN	+= -_gcc=-Wno-unused-label
83CERRWARN	+= -_gcc=-Wno-parentheses
84CERRWARN	+= -_gcc=-Wno-uninitialized
85CERRWARN	+= -_gcc=-Wno-type-limits
86
87#
88# Depends on scsi and cmlb
89# fcp included for fibre support
90#
91LDFLAGS         += -dy -N misc/scsi -N misc/cmlb -N drv/fcp
92
93#
94#	Default build targets.
95#
96.KEEP_STATE:
97
98all:		$(ALL_DEPS)
99
100def:		$(DEF_DEPS)
101
102clean:		$(CLEAN_DEPS)
103		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
104
105clobber:	$(CLOBBER_DEPS)
106		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
107
108lint:		$(LINT_DEPS)
109
110modlintlib:	$(MODLINTLIB_DEPS)
111
112clean.lint:	$(CLEAN_LINT_DEPS)
113
114install:	$(INSTALL_DEPS)
115
116#
117#	Include common targets.
118#
119include	$(UTSBASE)/sparc/Makefile.targ
120
121browser:	$(BINARY)
122
123browser		:= CFLAGS += -xsb
124
125#
126#	Defines for local commands.
127#
128WARLOCK		= warlock
129WLCC		= wlcc
130TOUCH		= touch
131TEST		= test
132
133#
134# Warlock targets
135
136SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
137CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
138
139warlock: warlock_alone
140
141warlock_alone: $(WARLOCK_OK)
142
143scsi_files:
144	@cd ../scsi; pwd; $(MAKE) warlock
145
146cmlb_files:
147	 @cd ../cmlb; pwd; $(MAKE) warlock
148
149$(WARLOCK_OK): $(WLCMD_DIR)/ssd.wlcmd $(WARLOCK_OUT) scsi.files cmlb_files
150	$(WARLOCK) -c $(WLCMD_DIR)/ssd.wlcmd $(WARLOCK_OUT) \
151	$(SCSI_FILES) $(CMLB_FILES) \
152	-l ../warlock/ddi_dki_impl.ll
153	$(TOUCH) $@
154
155ssd.ll: $(UTSBASE)/common/io/scsi/targets/sd.c
156	$(WLCC) $(CPPFLAGS) $(WLCCFLAGS) -DDEBUG -o $@ $(UTSBASE)/common/io/scsi/targets/sd.c
157
158warlock_ddi.files:
159	@cd ../warlock; pwd; $(MAKE) warlock
160
161scsi.files:
162	@cd ../scsi; pwd; $(MAKE) warlock
163