xref: /titanic_50/usr/src/uts/intel/usb_as/Makefile (revision 90f050286227cf4c4f8aa425555d04723d331d48)
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 2006 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_as driver
28#	kernel module. Intel architecture dependent
29#
30
31#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
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)
58LINT_TARGET	= $(MODULE).lint
59INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
60
61#
62#	Override defaults to build a unique, local modstubs.o.
63#
64MODSTUBS_DIR	 = $(OBJS_DIR)
65CLEANFILES	+= $(MODSTUBS_O)
66
67#
68# do not remove depends on amsrc2. If removed, amsrc2 gets unloaded when
69# usb_ac_dacf gets unloaded
70#
71LDFLAGS		+= -dy -Nmisc/usba -Nmisc/audiosup -Nmisc/mixer -Nmisc/amsrc2
72
73#
74# For now, disable these lint checks; maintainers should endeavor
75# to investigate and remove these for maximum lint coverage.
76# Please do not carry these forward to new Makefiles.
77#
78LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
79LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
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
115SCCS		= sccs
116TEST		= test
117
118#
119#	lock_lint rules
120#
121USB_AS_FILES	= $(MODULE).ll
122USBA_FILES	= $(USBA_OBJS:%.o=../usba/%.ll)
123UHCI_FILES	= $(UHCI_OBJS:%.o=../uhci/%.ll)
124OHCI_FILES	= $(OHCI_OBJS:%.o=../ohci/%.ll)
125EHCI_FILES	= $(EHCI_OBJS:%.o=../ehci/%.ll)
126MIXER_FILES = $(MIXER_OBJS:%.o=$(UTSBASE)/intel/mixer/%.ll)
127AUDIO_SUP_FILES = $(AUDIO_SUP_OBJS:%.o=$(UTSBASE)/intel/audiosup/%.ll)
128AMSRC2_FILES = $(AMSRC2_OBJS:%.o=$(UTSBASE)/intel/amsrc2/%.ll)
129
130#	Warlock targets
131#
132%.wlcmd:
133	cd $(WLCMD_DIR); $(TEST) -f $@  || $(SCCS) get $@
134
135warlock: $(WARLOCK_OK)
136
137$(WARLOCK_OK):	$(WARLOCK_OUT) warlock_ddi.files  \
138	warlock_audiosup.files warlock_mixer.files warlock_amsrc2.files \
139	warlock_standalone warlock_with_usba  warlock_with_sada
140	$(TOUCH) $(WARLOCK_OK)
141
142warlock_with_sada: usb_as_with_sada.wlcmd \
143	$(WARLOCK_OUT) \
144	warlock_audiosup.files warlock_amsrc2.files warlock_mixer.files
145	$(WARLOCK) -c $(WLCMD_DIR)/usb_as_with_sada.wlcmd $(WARLOCK_OUT) \
146	$(MIXER_FILES) $(AUDIO_SUP_FILES) $(AMSRC2_FILES) \
147	-l ../warlock/ddi_dki_impl.ll
148
149warlock_with_usba: usb_as_with_usba.wlcmd  $(WARLOCK_OUT) \
150	warlock_ddi.files warlock_ohci.files warlock_usba.files \
151	warlock_ehci.files warlock_uhci.files
152	$(WARLOCK) -c $(WLCMD_DIR)/usb_as_with_usba.wlcmd \
153	$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
154	$(WARLOCK_OUT)  -l ../warlock/ddi_dki_impl.ll
155
156warlock_standalone: $(WARLOCK_OUT) warlock_ddi.files usb_as.wlcmd
157	$(WARLOCK) -c $(WLCMD_DIR)/usb_as.wlcmd $(WARLOCK_OUT) \
158	-l ../warlock/ddi_dki_impl.ll
159
160%.ll: $(UTSBASE)/common/io/usb/clients/audio/usb_as/%.c
161	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
162
163warlock_usba.files:
164	@cd ../usba;pwd; $(MAKE) warlock
165
166warlock_ohci.files:
167	@cd ../ohci;pwd; $(MAKE) warlock
168
169warlock_uhci.files:
170	@cd ../uhci;pwd; $(MAKE) warlock
171
172warlock_ehci.files:
173	@cd ../ehci;pwd; $(MAKE) warlock
174
175warlock_ddi.files:
176	@cd ../warlock; pwd; $(MAKE) warlock
177
178warlock_audiosup.files:
179	@cd ../audiosup; pwd; $(MAKE) warlock
180
181warlock_amsrc2.files:
182	@cd ../amsrc2; pwd; $(MAKE) warlock
183
184warlock_mixer.files:
185	@cd ../mixer; pwd; $(MAKE) warlock
186