xref: /titanic_52/usr/src/uts/sparc/scsa2usb/Makefile (revision f498645a3eecf2ddd304b4ea9c7f1b4c155ff79e)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# uts/sparc/scsa2usb/Makefile
27#
28#	This makefile drives the production of the scsa2usb driver
29#	kernel module. sparc architecture dependent
30#
31
32#ident	"%Z%%M%	%I%	%E% SMI"
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		= scsa2usb
43OBJECTS		= $(SCSA2USB_OBJS:%=$(OBJS_DIR)/%)
44LINTS		= $(SCSA2USB_OBJS:%.o=$(LINTS_DIR)/%.ln)
45ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
46CONF_SRCDIR	= $(UTSBASE)/common/io/usb/scsa2usb
47WARLOCK_OUT	= $(SCSA2USB_OBJS:%.o=%.ll)
48WARLOCK_OK	= $(MODULE).ok
49
50#
51#	Include common rules.
52#
53include $(UTSBASE)/sparc/Makefile.sparc
54
55#
56# lint pass one enforcement
57#
58CFLAGS += $(CCVERBOSE)
59
60# depends on misc/usba misc/scsi
61#
62LDFLAGS		+= -dy -Nmisc/usba -Nmisc/scsi
63
64#
65#	Define targets
66#
67ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
68LINT_TARGET	= $(MODULE).lint
69INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
70
71.KEEP_STATE:
72
73all:		$(ALL_DEPS)
74
75def:		$(DEF_DEPS)
76
77clean:		$(CLEAN_DEPS); \
78                $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
79
80clobber:	$(CLOBBER_DEPS); \
81		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
82
83lint:		$(LINT_DEPS)
84
85modlintlib:	$(MODLINTLIB_DEPS)
86
87clean.lint:	$(CLEAN_LINT_DEPS)
88
89install:	$(INSTALL_DEPS)
90
91#
92#	Include common targets.
93#
94include $(UTSBASE)/sparc/Makefile.targ
95
96#
97#	Defines for local commands.
98#
99WARLOCK		= warlock
100WLCC		= wlcc
101TOUCH		= touch
102SCCS		= sccs
103TEST		= test
104
105#
106#	lock_lint rules
107#
108WARLOCK_OBJECTS = $(SCSA2USB_OBJS:%.o=%.ll)
109USBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
110UHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
111OHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
112EHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
113SD_FILES   = $(SD_OBJS:%.o=../sd/%.ll)
114ST_FILES   = $(ST_OBJS:%.o=../st/%.ll)
115SCSI_FILES = $(SCSI_OBJS:%.o= -l ../scsi/%.ll)
116
117warlock: $(MODULE).ok $(WARLOCK_OBJECTS) warlock_with_usba
118
119%.wlcmd:
120	$(TEST) -f $@ || $(SCCS) get $@
121
122scsa2usb.ok: $(WARLOCK_OBJECTS) scsa2usb.wlcmd warlock_ddi.files \
123	scsi.files
124	$(WARLOCK) -c scsa2usb.wlcmd $(WARLOCK_OBJECTS)  \
125		../warlock/scsi.ll \
126		-l ../warlock/ddi_dki_impl.ll \
127		$(SCSI_FILES)
128	$(TOUCH) $@
129
130%.ll: $(UTSBASE)/common/io/usb/scsa2usb/%.c \
131		$(UTSBASE)/common/sys/usb/clients/mass_storage/usb_bulkonly.h \
132		$(UTSBASE)/common/sys/usb/clients/mass_storage/usb_cbi.h \
133		$(UTSBASE)/common/sys/usb/scsa2usb/scsa2usb.h
134	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
135
136warlock_with_usba: scsa2usb.wlcmd  $(WARLOCK_OBJECTS) usba_files \
137	ohci_files ehci_files uhci_files warlock_ddi.files sd.files st.files
138	$(WARLOCK) -c ./scsa2usb_with_usba.wlcmd \
139		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
140		$(SD_FILES) \
141		$(ST_FILES) \
142		$(SCSI_FILES) \
143		$(WARLOCK_OBJECTS) \
144		-l ../warlock/ddi_dki_impl.ll
145
146usba_files:
147	@cd ../usba;pwd; $(MAKE) warlock
148
149uhci_files:
150	@cd ../uhci;pwd; $(MAKE) warlock
151
152ohci_files:
153	@cd ../ohci;pwd; $(MAKE) warlock
154
155ehci_files:
156	@cd ../ehci;pwd; $(MAKE) warlock
157
158warlock_ddi.files:
159	@cd ../warlock; pwd; $(MAKE) warlock
160
161scsi.files:
162	@cd ../scsi; pwd; $(MAKE) warlock
163
164sd.files:
165	@cd ../sd; pwd; $(MAKE) warlock_alone
166
167st.files:
168	@cd ../st; pwd; $(MAKE) warlock_alone
169