xref: /titanic_41/usr/src/uts/intel/usbvc/Makefile (revision aa98ce2c4ecbce8afe8b7b253a911ab24fdded32)
1c77a61a7Syz147069#
2c77a61a7Syz147069# CDDL HEADER START
3c77a61a7Syz147069#
4c77a61a7Syz147069# The contents of this file are subject to the terms of the
5c77a61a7Syz147069# Common Development and Distribution License (the "License").
6c77a61a7Syz147069# You may not use this file except in compliance with the License.
7c77a61a7Syz147069#
8c77a61a7Syz147069# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c77a61a7Syz147069# or http://www.opensolaris.org/os/licensing.
10c77a61a7Syz147069# See the License for the specific language governing permissions
11c77a61a7Syz147069# and limitations under the License.
12c77a61a7Syz147069#
13c77a61a7Syz147069# When distributing Covered Code, include this CDDL HEADER in each
14c77a61a7Syz147069# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c77a61a7Syz147069# If applicable, add the following below this CDDL HEADER, with the
16c77a61a7Syz147069# fields enclosed by brackets "[]" replaced with your own identifying
17c77a61a7Syz147069# information: Portions Copyright [yyyy] [name of copyright owner]
18c77a61a7Syz147069#
19c77a61a7Syz147069# CDDL HEADER END
20c77a61a7Syz147069#
21c77a61a7Syz147069
22c77a61a7Syz147069#
23489b7c4aSRaymond Chen# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24c77a61a7Syz147069# Use is subject to license terms.
25c77a61a7Syz147069#
26*aa98ce2cSGarrett D'Amore# Copyright 2014 Garrett D'Amore <garrett@damore.org>
27*aa98ce2cSGarrett D'Amore#
28c77a61a7Syz147069
29c77a61a7Syz147069#
30c77a61a7Syz147069#	This makefile drives the production of the usbvc driver kernel module.
31c77a61a7Syz147069#
32c77a61a7Syz147069
33c77a61a7Syz147069#
34c77a61a7Syz147069#	Path to the base of the uts directory tree (usually /usr/src/uts).
35c77a61a7Syz147069#
36c77a61a7Syz147069UTSBASE	= ../..
37c77a61a7Syz147069
38c77a61a7Syz147069#
39c77a61a7Syz147069#	Define the module and object file sets.
40c77a61a7Syz147069#
41c77a61a7Syz147069MODULE		= usbvc
42c77a61a7Syz147069OBJECTS		= $(USBVC_OBJS:%=$(OBJS_DIR)/%)
43c77a61a7Syz147069LINTS		= $(USBVC_OBJS:%.o=$(LINTS_DIR)/%.ln)
44c77a61a7Syz147069ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45c77a61a7Syz147069WARLOCK_OUT	= $(USBVC_OBJS:%.o=%.ll)
46c77a61a7Syz147069WARLOCK_OK	= $(MODULE).ok
47c77a61a7Syz147069WLCMD_DIR	= $(UTSBASE)/common/io/warlock
48c77a61a7Syz147069
49c77a61a7Syz147069#
50c77a61a7Syz147069#	Include common rules.
51c77a61a7Syz147069#
52c77a61a7Syz147069include $(UTSBASE)/intel/Makefile.intel
53c77a61a7Syz147069
54c77a61a7Syz147069#
55c77a61a7Syz147069#	Define targets
56c77a61a7Syz147069#
57c77a61a7Syz147069ALL_TARGET	= $(BINARY)
58c77a61a7Syz147069LINT_TARGET	= $(MODULE).lint
59c77a61a7Syz147069INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
60c77a61a7Syz147069
61c77a61a7Syz147069#
62c77a61a7Syz147069#	Override defaults to build a unique, local modstubs.o.
63c77a61a7Syz147069#
64c77a61a7Syz147069MODSTUBS_DIR	 = $(OBJS_DIR)
65c77a61a7Syz147069CLEANFILES	+= $(MODSTUBS_O)
66c77a61a7Syz147069
67c77a61a7Syz147069#
68c77a61a7Syz147069# depends on misc/usba
69c77a61a7Syz147069#
70c77a61a7Syz147069LDFLAGS		+= -dy -Nmisc/usba
71c77a61a7Syz147069
72c77a61a7Syz147069#
73c77a61a7Syz147069# Disable this because it is necessary for this driver
74c77a61a7Syz147069# and it is surely safe
75c77a61a7Syz147069#
76c77a61a7Syz147069LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
77c77a61a7Syz147069
787014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-uninitialized
797014882cSRichard Lowe
80c77a61a7Syz147069#
81c77a61a7Syz147069#	Default build targets.
82c77a61a7Syz147069#
83c77a61a7Syz147069.KEEP_STATE:
84c77a61a7Syz147069
85c77a61a7Syz147069def:		$(DEF_DEPS)
86c77a61a7Syz147069
87c77a61a7Syz147069all:		$(ALL_DEPS)
88c77a61a7Syz147069
89c77a61a7Syz147069clean:		$(CLEAN_DEPS)
90c77a61a7Syz147069		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
91c77a61a7Syz147069
92c77a61a7Syz147069clobber:	$(CLOBBER_DEPS)
93c77a61a7Syz147069		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
94c77a61a7Syz147069
95c77a61a7Syz147069lint:		$(LINT_DEPS)
96c77a61a7Syz147069
97c77a61a7Syz147069modlintlib:	$(MODLINTLIB_DEPS)
98c77a61a7Syz147069
99c77a61a7Syz147069clean.lint:	$(CLEAN_LINT_DEPS)
100c77a61a7Syz147069
101c77a61a7Syz147069install:	$(INSTALL_DEPS)
102c77a61a7Syz147069
103c77a61a7Syz147069#
104c77a61a7Syz147069#	Include common targets.
105c77a61a7Syz147069#
106c77a61a7Syz147069include $(UTSBASE)/intel/Makefile.targ
107c77a61a7Syz147069
108c77a61a7Syz147069#
109c77a61a7Syz147069#	Defines for local commands.
110c77a61a7Syz147069#
111c77a61a7Syz147069WARLOCK		= warlock
112c77a61a7Syz147069WLCC		= wlcc
113c77a61a7Syz147069TOUCH		= touch
114c77a61a7Syz147069TEST		= test
115c77a61a7Syz147069
116c77a61a7Syz147069#
117c77a61a7Syz147069#	lock_lint rules
118c77a61a7Syz147069#
119*aa98ce2cSGarrett D'AmoreUSBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
120c77a61a7Syz147069UHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
121c77a61a7Syz147069OHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
122c77a61a7Syz147069EHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
123c77a61a7Syz147069
124c77a61a7Syz147069warlock: $(WARLOCK_OK) warlock_with_usba
125c77a61a7Syz147069
126bf56214cSstevel$(WARLOCK_OK): $(WARLOCK_OUT) $(WLCMD_DIR)/usbvc.wlcmd warlock_ddi.files
127c77a61a7Syz147069	$(WARLOCK) -c $(WLCMD_DIR)/usbvc.wlcmd $(WARLOCK_OUT)  \
128c77a61a7Syz147069		-l ../warlock/ddi_dki_impl.ll
129c77a61a7Syz147069	$(TOUCH) $@
130c77a61a7Syz147069
131c77a61a7Syz147069%.ll: $(UTSBASE)/common/io/usb/clients/video/usbvc/%.c \
132c77a61a7Syz147069		$(UTSBASE)/common/sys/usb/clients/video/usbvc/usbvc_var.h
133c77a61a7Syz147069	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
134c77a61a7Syz147069
135bf56214cSstevelwarlock_with_usba: $(WLCMD_DIR)/usbvc_with_usba.wlcmd $(WARLOCK_OUT) \
136bf56214cSstevel	usba_files ohci_files ehci_files uhci_files warlock_ddi.files
137c77a61a7Syz147069	$(WARLOCK) -c $(WLCMD_DIR)/usbvc_with_usba.wlcmd \
138c77a61a7Syz147069		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
139c77a61a7Syz147069		$(WARLOCK_OUT) \
140c77a61a7Syz147069	-l ../warlock/ddi_dki_impl.ll
141c77a61a7Syz147069
142c77a61a7Syz147069usba_files:
143c77a61a7Syz147069	@cd ../usba;pwd; $(MAKE) warlock
144c77a61a7Syz147069
145c77a61a7Syz147069ohci_files:
146c77a61a7Syz147069	@cd ../ohci;pwd; $(MAKE) warlock
147c77a61a7Syz147069
148c77a61a7Syz147069uhci_files:
149c77a61a7Syz147069	@cd ../uhci;pwd; $(MAKE) warlock
150c77a61a7Syz147069
151c77a61a7Syz147069ehci_files:
152c77a61a7Syz147069	@cd ../ehci;pwd; $(MAKE) warlock
153c77a61a7Syz147069
154c77a61a7Syz147069warlock_ddi.files:
155c77a61a7Syz147069	cd ../warlock; pwd; $(MAKE) warlock
156