Makefile revision 4604:5989fb2cb1d5
1290494Sbapt#
2290494Sbapt# CDDL HEADER START
3290494Sbapt#
4290494Sbapt# The contents of this file are subject to the terms of the
586073Sache# Common Development and Distribution License (the "License").
6174990Sache# You may not use this file except in compliance with the License.
7290494Sbapt#
8290494Sbapt# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9290494Sbapt# or http://www.opensolaris.org/os/licensing.
10290494Sbapt# See the License for the specific language governing permissions
11290494Sbapt# and limitations under the License.
12290494Sbapt#
13290494Sbapt# When distributing Covered Code, include this CDDL HEADER in each
14290494Sbapt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15290494Sbapt# If applicable, add the following below this CDDL HEADER, with the
16290494Sbapt# fields enclosed by brackets "[]" replaced with your own identifying
17290494Sbapt# information: Portions Copyright [yyyy] [name of copyright owner]
18290494Sbapt#
1986073Sache# CDDL HEADER END
20174990Sache#
21290494Sbapt
22290494Sbapt# uts/intel/usb_mid/Makefile
23290494Sbapt# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24290494Sbapt# Use is subject to license terms.
25290494Sbapt#
26290494Sbapt#ident	"%Z%%M%	%I%	%E% SMI"
27290494Sbapt#
28290494Sbapt#	This makefile drives the production of the usb_mid driver kernel module.
29290494Sbapt#
30290494Sbapt
31290494Sbapt#
32290494Sbapt#	Path to the base of the uts directory tree (usually /usr/src/uts).
3386073Sache#
34174990SacheUTSBASE	= ../..
35290494Sbapt
36290494Sbapt#
37290494Sbapt#	Define the module and object file sets.
38290494Sbapt#
39290494SbaptMODULE		= usb_mid
40290494SbaptOBJECTS		= $(USB_MID_OBJS:%=$(OBJS_DIR)/%)
41290494SbaptLINTS		= $(USB_MID_OBJS:%.o=$(LINTS_DIR)/%.ln)
4286073SacheROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
43174990SacheWARLOCK_OUT	= $(USB_MID_OBJS:%.o=%.ll)
44290494SbaptWARLOCK_OK	= $(MODULE).ok
45290494SbaptWLCMD_DIR	= $(UTSBASE)/common/io/warlock
46290494Sbapt
47290494Sbapt#
48290494Sbapt#	Include common rules.
49290494Sbapt#
50290494Sbaptinclude $(UTSBASE)/intel/Makefile.intel
5186073Sache
5286073Sache#
5386073Sache#	Define targets
5486073Sache#
5586073SacheALL_TARGET	= $(BINARY)
56304500SbaptLINT_TARGET	= $(MODULE).lint
5786073SacheINSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
5886073Sache
59304500Sbapt#
6086073Sache#	Override defaults to build a unique, local modstubs.o.
61290494Sbapt#
62290494SbaptMODSTUBS_DIR	 = $(OBJS_DIR)
63290494SbaptCLEANFILES	+= $(MODSTUBS_O)
6486073Sache
6586073Sache#
66304500Sbapt# depends on misc/usba
6786073Sache#
68174990SacheLDFLAGS         += -dy -Nmisc/usba
69290494Sbapt
70290494Sbapt#
71290494Sbapt#	Default build targets.
72290494Sbapt#
73290494Sbapt.KEEP_STATE:
74290494Sbapt
75290494Sbaptdef:		$(DEF_DEPS)
76290494Sbapt
77290494Sbaptall:		$(ALL_DEPS)
78290494Sbapt
79290494Sbaptclean:		$(CLEAN_DEPS)
80290494Sbapt		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
8186073Sache
8286073Sacheclobber:	$(CLOBBER_DEPS)
83302016Sume		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
8486073Sache
8586073Sachelint:		$(LINT_DEPS)
8686073Sache
8786073Sachemodlintlib:	$(MODLINTLIB_DEPS)
88
89clean.lint:	$(CLEAN_LINT_DEPS)
90
91install:	$(INSTALL_DEPS)
92
93#
94#	Include common targets.
95#
96include $(UTSBASE)/intel/Makefile.targ
97
98#
99#	Defines for local commands.
100#
101WARLOCK		= warlock
102WLCC		= wlcc
103TOUCH		= touch
104TEST		= test
105
106#
107#	lock_lint rules
108#
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)
113
114warlock: $(WARLOCK_OK) warlock_with_usba
115
116$(WARLOCK_OK): $(WARLOCK_OUT) $(WLCMD_DIR)/usb_mid.wlcmd warlock_ddi.files
117	$(WARLOCK) -c $(WLCMD_DIR)/usb_mid.wlcmd $(WARLOCK_OUT)  \
118		-l ../warlock/ddi_dki_impl.ll
119	$(TOUCH) $@
120
121%.ll: $(UTSBASE)/common/io/usb/usb_mid/%.c \
122		$(UTSBASE)/common/sys/usb/usb_mid/usb_midvar.h
123	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
124
125warlock_with_usba: $(WLCMD_DIR)/usb_mid_with_usba.wlcmd $(WARLOCK_OUT) \
126	usba_files ohci_files ehci_files uhci_files warlock_ddi.files
127	$(WARLOCK) -c $(WLCMD_DIR)/usb_mid_with_usba.wlcmd \
128		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
129		$(WARLOCK_OUT) \
130		-l ../warlock/ddi_dki_impl.ll
131
132usba_files:
133	@cd ../usba;pwd; $(MAKE) warlock
134
135uhci_files:
136	@cd ../uhci;pwd; $(MAKE) warlock
137
138ohci_files:
139	@cd ../ohci;pwd; $(MAKE) warlock
140
141ehci_files:
142	@cd ../ehci;pwd; $(MAKE) warlock
143
144warlock_ddi.files:
145	cd ../warlock; pwd; $(MAKE) warlock
146