xref: /titanic_50/usr/src/uts/sparc/usb_mid/Makefile (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# uts/sparc/usb_mid/Makefile
24
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28#	This makefile drives the production of the usb_mid driver kernel module.
29#	sparc architecture dependent
30#
31
32#ident	"%Z%%M%	%I%	%E% SMI"
33
34#
35#	Path to the base of the uts directory tree (usually /usr/src/uts).
36#
37UTSBASE = ../..
38
39#
40#	Define the module and object file sets.
41#
42MODULE		= usb_mid
43OBJECTS		= $(USB_MID_OBJS:%=$(OBJS_DIR)/%)
44LINTS		= $(USB_MID_OBJS:%.o=$(LINTS_DIR)/%.ln)
45WARLOCK_OUT	= $(USB_MID_OBJS:%.o=%.ll)
46WARLOCK_OK	= $(MODULE).ok
47ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
48
49#
50#	Include common rules.
51#
52include $(UTSBASE)/sparc/Makefile.sparc
53
54#
55# lint pass one enforcement
56#
57CFLAGS += $(CCVERBOSE)
58
59#
60# depends on misc/usba
61#
62LDFLAGS         += -dy -Nmisc/usba
63
64#
65#	Define targets
66#
67ALL_TARGET	= $(BINARY)
68LINT_TARGET	= $(MODULE).lint
69INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
70
71.KEEP_STATE:
72
73all:		$(ALL_DEPS)
74
75def:		$(DEF_DEPS)
76
77clean:		$(CLEAN_DEPS); \
78                $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
79
80clobber:	$(CLOBBER_DEPS); \
81		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
82
83lint:		$(LINT_DEPS)
84
85modlintlib:	$(MODLINTLIB_DEPS)
86
87clean.lint:	$(CLEAN_LINT_DEPS)
88
89install:	$(INSTALL_DEPS)
90
91#
92#	Include common targets.
93#
94include $(UTSBASE)/sparc/Makefile.targ
95
96#
97#	Defines for local commands.
98#
99WARLOCK		= warlock
100WLCC		= wlcc
101TOUCH		= touch
102SCCS		= sccs
103TEST		= test
104
105#
106#	lock_lint rules
107#
108USB_MID_FILES	= $(MODULE).ll
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: $(MODULE).ok warlock_with_usba
115
116%.wlcmd:
117	$(TEST) -f $@ || $(SCCS) get $@
118
119usb_mid.ok: usb_mid.ll usb_mid.wlcmd warlock_ddi.files
120	$(WARLOCK) -c usb_mid.wlcmd $(USB_MID_FILES)  \
121		-l ../warlock/ddi_dki_impl.ll
122	$(TOUCH) $@
123
124%.ll: $(UTSBASE)/common/io/usb/usb_mid/%.c \
125		$(UTSBASE)/common/sys/usb/usb_mid/usb_midvar.h
126	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
127
128warlock_with_usba: usb_mid.wlcmd  $(USB_MID_FILES) usba_files \
129	ohci_files ehci_files uhci_files warlock_ddi.files
130	$(WARLOCK) -c ./usb_mid_with_usba.wlcmd \
131		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
132		$(USB_MID_FILES) \
133		-l ../warlock/ddi_dki_impl.ll
134
135usba_files:
136	@cd ../usba;pwd; $(MAKE) warlock
137
138uhci_files:
139	@cd ../uhci;pwd; $(MAKE) warlock
140
141ohci_files:
142	@cd ../ohci;pwd; $(MAKE) warlock
143
144ehci_files:
145	@cd ../ehci;pwd; $(MAKE) warlock
146
147warlock_ddi.files:
148	cd ../warlock; pwd; $(MAKE) warlock
149