xref: /titanic_52/usr/src/uts/sparc/ugen/Makefile (revision 0eb822a1c0c2bea495647510b75f77f0e57633eb)
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/ugen/Makefile
24#
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28#ident	"%Z%%M%	%I%	%E% SMI"
29#
30#	This makefile drives the production of the ugen kernel driver.
31#
32#	sparc architecture dependent
33#
34
35#
36#	Path to the base of the uts directory tree (usually /usr/src/uts).
37#
38UTSBASE	= ../..
39
40#
41#	Define the module and object file sets.
42#
43MODULE		= ugen
44OBJECTS		= $(UGEN_OBJS:%=$(OBJS_DIR)/%)
45LINTS		= $(UGEN_OBJS:%.o=$(LINTS_DIR)/%.ln)
46ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
47WARLOCK_OUT     = $(UGEN_OBJS:%.o=%.ll)
48WARLOCK_OK      = $(MODULE).ok
49
50#
51#	Include common rules.
52#
53include $(UTSBASE)/sparc/Makefile.sparc
54
55#
56# lint pass one enforcement
57#
58CFLAGS += $(CCVERBOSE)
59
60#
61# depends on misc/usba
62#
63LDFLAGS         += -dy -Nmisc/usba
64
65#
66#	Define targets
67#
68ALL_TARGET	= $(BINARY)
69LINT_TARGET	= $(MODULE).lint
70INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
71
72.KEEP_STATE:
73
74all:		$(ALL_DEPS)
75
76def:		$(DEF_DEPS)
77
78clean:		$(CLEAN_DEPS); \
79                $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
80
81clobber:	$(CLOBBER_DEPS); \
82		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
83
84lint:		$(LINT_DEPS)
85
86modlintlib:	$(MODLINTLIB_DEPS)
87
88clean.lint:	$(CLEAN_LINT_DEPS)
89
90install:	$(INSTALL_DEPS)
91
92#
93#	Include common targets.
94#
95include $(UTSBASE)/sparc/Makefile.targ
96
97#
98#	Defines for local commands.
99#
100WARLOCK		= warlock
101WLCC		= wlcc
102TOUCH		= touch
103SCCS		= sccs
104TEST		= test
105
106#
107#	lock_lint rules
108#
109WARLOCK_OBJECTS = $(UGEN_OBJS:%.o=%.ll)
110USBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
111UHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
112OHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
113EHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
114
115warlock: $(MODULE).ok $(WARLOCK_OBJECTS) warlock_with_usba
116
117%.wlcmd:
118	$(TEST) -f $@ || $(SCCS) get $@
119
120ugen.ok: $(WARLOCK_OBJECTS) ugen.wlcmd warlock_ddi.files
121	$(WARLOCK) -c ugen.wlcmd $(WARLOCK_OBJECTS)  \
122		-l ../warlock/ddi_dki_impl.ll
123	$(TOUCH) $@
124
125%.ll: $(UTSBASE)/common/io/usb/clients/ugen/%.c \
126		$(UTSBASE)/common/sys/usb/clients/ugen/ugend.h
127	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
128
129
130warlock_with_usba: ugen.wlcmd  $(WARLOCK_OBJECTS) usba_files \
131	ohci_files ehci_files uhci_files warlock_ddi.files
132	$(WARLOCK) -c ./ugen_with_usba.wlcmd \
133		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
134		$(WARLOCK_OBJECTS) \
135	-l ../warlock/ddi_dki_impl.ll
136
137usba_files:
138	@cd ../usba;pwd; $(MAKE) warlock
139
140uhci_files:
141	@cd ../uhci;pwd; $(MAKE) warlock
142
143ohci_files:
144	@cd ../ohci;pwd; $(MAKE) warlock
145
146ehci_files:
147	@cd ../ehci;pwd; $(MAKE) warlock
148
149warlock_ddi.files:
150	cd ../warlock; pwd; $(MAKE) warlock
151
152