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