xref: /titanic_41/usr/src/uts/intel/usb_ia/Makefile (revision aa98ce2c4ecbce8afe8b7b253a911ab24fdded32)
1d73ae94eSgc161489#
2d73ae94eSgc161489# CDDL HEADER START
3d73ae94eSgc161489#
4d73ae94eSgc161489# The contents of this file are subject to the terms of the
5d73ae94eSgc161489# Common Development and Distribution License (the "License").
6d73ae94eSgc161489# You may not use this file except in compliance with the License.
7d73ae94eSgc161489#
8d73ae94eSgc161489# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9d73ae94eSgc161489# or http://www.opensolaris.org/os/licensing.
10d73ae94eSgc161489# See the License for the specific language governing permissions
11d73ae94eSgc161489# and limitations under the License.
12d73ae94eSgc161489#
13d73ae94eSgc161489# When distributing Covered Code, include this CDDL HEADER in each
14d73ae94eSgc161489# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15d73ae94eSgc161489# If applicable, add the following below this CDDL HEADER, with the
16d73ae94eSgc161489# fields enclosed by brackets "[]" replaced with your own identifying
17d73ae94eSgc161489# information: Portions Copyright [yyyy] [name of copyright owner]
18d73ae94eSgc161489#
19d73ae94eSgc161489# CDDL HEADER END
20d73ae94eSgc161489#
21d73ae94eSgc161489#
22d73ae94eSgc161489# uts/intel/usb_ia/Makefile
23489b7c4aSRaymond Chen# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24d73ae94eSgc161489# Use is subject to license terms.
25d73ae94eSgc161489#
26*aa98ce2cSGarrett D'Amore# Copyright 2014 Garrett D'Amore <garrett@damore.org>
27d73ae94eSgc161489#
28d73ae94eSgc161489#	This makefile drives the production of the usb_ia driver kernel module.
29d73ae94eSgc161489#
30d73ae94eSgc161489
31d73ae94eSgc161489#
32d73ae94eSgc161489#	Path to the base of the uts directory tree (usually /usr/src/uts).
33d73ae94eSgc161489#
34d73ae94eSgc161489UTSBASE	= ../..
35d73ae94eSgc161489
36d73ae94eSgc161489#
37d73ae94eSgc161489#	Define the module and object file sets.
38d73ae94eSgc161489#
39d73ae94eSgc161489MODULE		= usb_ia
40d73ae94eSgc161489OBJECTS		= $(USB_IA_OBJS:%=$(OBJS_DIR)/%)
41d73ae94eSgc161489LINTS		= $(USB_IA_OBJS:%.o=$(LINTS_DIR)/%.ln)
42d73ae94eSgc161489ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
43d73ae94eSgc161489WARLOCK_OUT	= $(USB_IA_OBJS:%.o=%.ll)
44d73ae94eSgc161489WARLOCK_OK	= $(MODULE).ok
45d73ae94eSgc161489WLCMD_DIR	= $(UTSBASE)/common/io/warlock
46d73ae94eSgc161489
47d73ae94eSgc161489#
48d73ae94eSgc161489#	Include common rules.
49d73ae94eSgc161489#
50d73ae94eSgc161489include $(UTSBASE)/intel/Makefile.intel
51d73ae94eSgc161489
52d73ae94eSgc161489#
53d73ae94eSgc161489#	Define targets
54d73ae94eSgc161489#
55d73ae94eSgc161489ALL_TARGET	= $(BINARY)
56d73ae94eSgc161489LINT_TARGET	= $(MODULE).lint
57d73ae94eSgc161489INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
58d73ae94eSgc161489
59d73ae94eSgc161489#
60d73ae94eSgc161489#	Override defaults to build a unique, local modstubs.o.
61d73ae94eSgc161489#
62d73ae94eSgc161489MODSTUBS_DIR	 = $(OBJS_DIR)
63d73ae94eSgc161489CLEANFILES	+= $(MODSTUBS_O)
64d73ae94eSgc161489
65d73ae94eSgc161489#
66d73ae94eSgc161489# depends on misc/usba
67d73ae94eSgc161489#
68d73ae94eSgc161489LDFLAGS         += -dy -Nmisc/usba
69d73ae94eSgc161489
70d73ae94eSgc161489#
71d73ae94eSgc161489#	Default build targets.
72d73ae94eSgc161489#
73d73ae94eSgc161489.KEEP_STATE:
74d73ae94eSgc161489
75d73ae94eSgc161489def:		$(DEF_DEPS)
76d73ae94eSgc161489
77d73ae94eSgc161489all:		$(ALL_DEPS)
78d73ae94eSgc161489
79d73ae94eSgc161489clean:		$(CLEAN_DEPS)
80d73ae94eSgc161489		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
81d73ae94eSgc161489
82d73ae94eSgc161489clobber:	$(CLOBBER_DEPS)
83d73ae94eSgc161489		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
84d73ae94eSgc161489
85d73ae94eSgc161489lint:		$(LINT_DEPS)
86d73ae94eSgc161489
87d73ae94eSgc161489modlintlib:	$(MODLINTLIB_DEPS)
88d73ae94eSgc161489
89d73ae94eSgc161489clean.lint:	$(CLEAN_LINT_DEPS)
90d73ae94eSgc161489
91d73ae94eSgc161489install:	$(INSTALL_DEPS)
92d73ae94eSgc161489
93d73ae94eSgc161489#
94d73ae94eSgc161489#	Include common targets.
95d73ae94eSgc161489#
96d73ae94eSgc161489include $(UTSBASE)/intel/Makefile.targ
97d73ae94eSgc161489
98d73ae94eSgc161489#
99d73ae94eSgc161489#	Defines for local commands.
100d73ae94eSgc161489#
101d73ae94eSgc161489WARLOCK		= warlock
102d73ae94eSgc161489WLCC		= wlcc
103d73ae94eSgc161489TOUCH		= touch
104d73ae94eSgc161489TEST		= test
105d73ae94eSgc161489
106d73ae94eSgc161489#
107d73ae94eSgc161489#	lock_lint rules
108d73ae94eSgc161489#
109*aa98ce2cSGarrett D'AmoreUSBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
110d73ae94eSgc161489UHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
111d73ae94eSgc161489OHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
112d73ae94eSgc161489EHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
113d73ae94eSgc161489
114d73ae94eSgc161489warlock: $(WARLOCK_OK) warlock_with_usba
115d73ae94eSgc161489
116bf56214cSstevel$(WARLOCK_OK): $(WARLOCK_OUT) $(WLCMD_DIR)/usb_ia.wlcmd warlock_ddi.files
117d73ae94eSgc161489	$(WARLOCK) -c $(WLCMD_DIR)/usb_ia.wlcmd $(WARLOCK_OUT)  \
118d73ae94eSgc161489		-l ../warlock/ddi_dki_impl.ll
119d73ae94eSgc161489	$(TOUCH) $@
120d73ae94eSgc161489
121d73ae94eSgc161489%.ll: $(UTSBASE)/common/io/usb/usb_ia/%.c \
122d73ae94eSgc161489		$(UTSBASE)/common/sys/usb/usb_ia/usb_iavar.h
123d73ae94eSgc161489	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
124d73ae94eSgc161489
125bf56214cSstevelwarlock_with_usba: $(WLCMD_DIR)/usb_ia_with_usba.wlcmd $(WARLOCK_OUT) \
126bf56214cSstevel	usba_files ohci_files ehci_files uhci_files warlock_ddi.files
127d73ae94eSgc161489	$(WARLOCK) -c $(WLCMD_DIR)/usb_ia_with_usba.wlcmd \
128d73ae94eSgc161489		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
129d73ae94eSgc161489		$(WARLOCK_OUT) \
130d73ae94eSgc161489		-l ../warlock/ddi_dki_impl.ll
131d73ae94eSgc161489
132d73ae94eSgc161489usba_files:
133d73ae94eSgc161489	@cd ../usba;pwd; $(MAKE) warlock
134d73ae94eSgc161489
135d73ae94eSgc161489uhci_files:
136d73ae94eSgc161489	@cd ../uhci;pwd; $(MAKE) warlock
137d73ae94eSgc161489
138d73ae94eSgc161489ohci_files:
139d73ae94eSgc161489	@cd ../ohci;pwd; $(MAKE) warlock
140d73ae94eSgc161489
141d73ae94eSgc161489ehci_files:
142d73ae94eSgc161489	@cd ../ehci;pwd; $(MAKE) warlock
143d73ae94eSgc161489
144d73ae94eSgc161489warlock_ddi.files:
145d73ae94eSgc161489	cd ../warlock; pwd; $(MAKE) warlock
146