xref: /titanic_41/usr/src/uts/sparc/usb_as/Makefile (revision d89fccd8788afe1e920f842edd883fe192a1b8fe)
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# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# uts/sparc/usb_as/Makefile
26#
27#	This makefile drives the production of the usb_audio driver
28#	kernel module. sparc architecture dependent
29#
30
31#pragma ident	"%Z%%M%	%I%	%E% SMI"
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		= usb_as
42OBJECTS		= $(USB_AS_OBJS:%=$(OBJS_DIR)/%)
43LINTS		= $(USB_AS_OBJS:%.o=$(LINTS_DIR)/%.ln)
44ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45WARLOCK_OUT	= $(USB_AS_OBJS:%.o=%.ll)
46WARLOCK_OK	= $(MODULE).ok
47
48#
49#	Include common rules.
50#
51include $(UTSBASE)/sparc/Makefile.sparc
52
53#
54# lint pass one enforcement
55#
56CFLAGS += $(CCVERBOSE)
57
58#
59# do not remove depends on amsrc2. If removed, amsrc2 gets unloaded when
60# usb_ac_dacf gets unloaded
61LDFLAGS		+= -dy -Nmisc/usba -Nmisc/audiosup -Nmisc/mixer -Nmisc/amsrc2
62
63#
64#	Define targets
65#
66ALL_TARGET	= $(BINARY)
67LINT_TARGET	= $(MODULE).lint
68INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
69
70.KEEP_STATE:
71
72all:		$(ALL_DEPS)
73
74def:		$(DEF_DEPS)
75
76clean:		$(CLEAN_DEPS); \
77                $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
78
79clobber:	$(CLOBBER_DEPS); \
80		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
81
82lint:		$(LINT_DEPS)
83
84modlintlib:	$(MODLINTLIB_DEPS)
85
86clean.lint:	$(CLEAN_LINT_DEPS)
87
88install:	$(INSTALL_DEPS)
89
90#
91#	Include common targets.
92#
93include $(UTSBASE)/sparc/Makefile.targ
94
95#
96#	Defines for local commands.
97#
98WARLOCK		= warlock
99WLCC		= wlcc
100TOUCH		= touch
101SCCS		= sccs
102TEST		= test
103
104#
105#	lock_lint rules
106#
107USB_AS_FILES	= $(MODULE).ll
108USBA_FILES	= $(USBA_OBJS:%.o=../usba/%.ll)
109UHCI_FILES	= $(UHCI_OBJS:%.o=../uhci/%.ll)
110OHCI_FILES	= $(OHCI_OBJS:%.o=../ohci/%.ll)
111EHCI_FILES	= $(EHCI_OBJS:%.o=../ehci/%.ll)
112MIXER_FILES	= $(MIXER_OBJS:%.o=../mixer/%.ll)
113AUDIOSUP_FILES	= $(AUDIO_SUP_OBJS:%.o=../audiosup/%.ll)
114# AMSRC1_OBJS is only defined in the closed tree.
115AMSRC1_FILES	= $(CLOSED)/uts/sparc/amsrc1/am_src1.ll
116
117#
118#	Warlock targets
119#
120%.wlcmd:
121	$(TEST) -f $@ || $(SCCS) get $@
122
123warlock: $(MODULE).ok
124
125$(WARLOCK_OK):	$(WARLOCK_OUT) warlock_ddi.files \
126	warlock_audiosup.files warlock_mixer.files warlock_amsrc1.files \
127	warlock_standalone warlock_with_usba  warlock_with_sada
128	$(TOUCH) $(WARLOCK_OK)
129
130warlock_with_sada: usb_as_with_sada.wlcmd \
131	$(WARLOCK_OUT) \
132	warlock_audiosup.files warlock_amsrc1.files warlock_mixer.files
133	$(WARLOCK) -c usb_as_with_sada.wlcmd $(WARLOCK_OUT) \
134	$(MIXER_FILES) $(AUDIOSUP_FILES) $(AMSRC1_FILES) \
135	-l ../warlock/ddi_dki_impl.ll
136
137warlock_with_usba: usb_as.wlcmd  $(WARLOCK_OUT) \
138	warlock_ddi.files warlock_ohci.files warlock_usba.files \
139	warlock_ehci.files warlock_uhci.files
140	$(WARLOCK) -c ./usb_as_with_usba.wlcmd \
141	$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
142	$(WARLOCK_OUT)  -l ../warlock/ddi_dki_impl.ll
143
144warlock_standalone: $(WARLOCK_OUT) warlock_ddi.files usb_as.wlcmd
145	$(WARLOCK) -c usb_as.wlcmd $(WARLOCK_OUT) \
146	-l ../warlock/ddi_dki_impl.ll
147
148%.ll: $(UTSBASE)/common/io/usb/clients/audio/usb_as/%.c
149	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
150
151
152warlock_usba.files:
153	@cd ../usba;pwd; $(MAKE) warlock
154
155warlock_ohci.files:
156	@cd ../ohci;pwd; $(MAKE) warlock
157
158warlock_uhci.files:
159	@cd ../uhci;pwd; $(MAKE) warlock
160
161warlock_ehci.files:
162	@cd ../ehci;pwd; $(MAKE) warlock
163
164warlock_ddi.files:
165	@cd ../warlock; pwd; $(MAKE) warlock
166
167warlock_audiosup.files:
168	@cd ../audiosup; pwd; $(MAKE) warlock
169
170warlock_amsrc1.files:
171	@cd $(CLOSED)/uts/sparc/amsrc1; pwd; $(MAKE) warlock
172
173warlock_mixer.files:
174	@cd ../mixer; pwd; $(MAKE) warlock
175