xref: /titanic_52/usr/src/uts/intel/scsa2usb/Makefile (revision f5c2e7ea56aaa46a9976476fb0cb1f02b9426f07)
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/intel/scsa2usb/Makefile
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#
27#	This makefile drives the production of the scsa2usb driver
28#	kernel module. intel architecture dependent
29#
30
31#
32#	Path to the base of the uts directory tree (usually /usr/src/uts).
33#
34UTSBASE	= ../..
35
36#
37#	Define the module and object file sets.
38#
39MODULE		= scsa2usb
40OBJECTS		= $(SCSA2USB_OBJS:%=$(OBJS_DIR)/%)
41LINTS		= $(SCSA2USB_OBJS:%.o=$(LINTS_DIR)/%.ln)
42ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
43CONF_SRCDIR	= $(UTSBASE)/common/io/usb/scsa2usb
44WARLOCK_OUT	= $(SCSA2USB_OBJS:%.o=%.ll)
45WARLOCK_OK	= $(MODULE).ok
46WLCMD_DIR	= $(UTSBASE)/common/io/warlock
47
48#
49#	Include common rules.
50#
51include $(UTSBASE)/intel/Makefile.intel
52
53#
54#	Define targets
55#
56ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
57LINT_TARGET	= $(MODULE).lint
58INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
59
60#
61#	Override defaults to build a unique, local modstubs.o.
62#
63MODSTUBS_DIR	 = $(OBJS_DIR)
64CLEANFILES	+= $(MODSTUBS_O)
65
66#
67# depends on misc/usba misc/scsi
68#
69LDFLAGS		+= -dy -Nmisc/usba -Nmisc/scsi
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
77
78CERRWARN	+= -_gcc=-Wno-unused-label
79CERRWARN	+= -_gcc=-Wno-uninitialized
80
81#
82#	Default build targets.
83#
84.KEEP_STATE:
85
86def:		$(DEF_DEPS)
87
88all:		$(ALL_DEPS)
89
90clean:		$(CLEAN_DEPS)
91		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
92
93clobber:	$(CLOBBER_DEPS)
94		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
95
96lint:		$(LINT_DEPS)
97
98modlintlib:	$(MODLINTLIB_DEPS)
99
100clean.lint:	$(CLEAN_LINT_DEPS)
101
102install:	$(INSTALL_DEPS)
103
104#
105#	Include common targets.
106#
107include $(UTSBASE)/intel/Makefile.targ
108
109#
110#	Defines for local commands.
111#
112WARLOCK		= warlock
113WLCC		= wlcc
114TOUCH		= touch
115TEST		= test
116
117#
118#	lock_lint rules
119#
120USBA_FILES = $(USBA_WITHOUT_WUSB_OBJS:%.o=../usba/%.ll)
121UHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
122OHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
123EHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
124SD_FILES   = $(SD_OBJS:%.o=../sd/%.ll)
125ST_FILES   = $(ST_OBJS:%.o=../st/%.ll)
126SCSI_FILES = $(SCSI_OBJS:%.o= -l ../scsi/%.ll)
127CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
128
129warlock: $(WARLOCK_OK) warlock_with_usba
130
131$(WARLOCK_OK): $(WARLOCK_OUT) $(WLCMD_DIR)/scsa2usb.wlcmd warlock_ddi.files \
132	scsi.files
133	$(WARLOCK) -c $(WLCMD_DIR)/scsa2usb.wlcmd $(WARLOCK_OUT)  \
134		../warlock/scsi.ll \
135		$(SCSI_FILES) \
136		-l ../warlock/ddi_dki_impl.ll
137	$(TOUCH) $@
138
139%.ll: $(UTSBASE)/common/io/usb/scsa2usb/%.c \
140		$(UTSBASE)/common/sys/usb/clients/mass_storage/usb_bulkonly.h \
141		$(UTSBASE)/common/sys/usb/clients/mass_storage/usb_cbi.h \
142		$(UTSBASE)/common/sys/usb/scsa2usb/scsa2usb.h
143	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
144
145warlock_with_usba: $(WLCMD_DIR)/scsa2usb_with_usba.wlcmd \
146	$(WARLOCK_OUT) usba_files \
147	ohci_files ehci_files uhci_files warlock_ddi.files sd.files st.files \
148	cmlb.files scsi.files
149	$(WARLOCK) -c $(WLCMD_DIR)/scsa2usb_with_usba.wlcmd \
150		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
151		$(SD_FILES) \
152		$(ST_FILES) \
153		$(CMLB_FILES) \
154		$(SCSI_FILES) \
155		$(WARLOCK_OUT) \
156		-l ../warlock/ddi_dki_impl.ll
157
158usba_files:
159	@cd ../usba;pwd; $(MAKE) warlock
160
161uhci_files:
162	@cd ../uhci;pwd; $(MAKE) warlock
163
164ohci_files:
165	@cd ../ohci;pwd; $(MAKE) warlock
166
167ehci_files:
168	@cd ../ehci;pwd; $(MAKE) warlock
169
170warlock_ddi.files:
171	@cd ../warlock; pwd; $(MAKE) warlock
172
173scsi.files:
174	@cd ../scsi; pwd; $(MAKE) warlock
175
176sd.files:
177	@cd ../sd; pwd; $(MAKE) warlock_alone
178
179st.files:
180	@cd ../st; pwd; $(MAKE) warlock_alone
181
182cmlb.files:
183	 @cd ../cmlb; pwd; $(MAKE) warlock
184