xref: /titanic_52/usr/src/uts/sparc/usbsprl/Makefile (revision 7d968cb8b4b6274092771b93e94bf88d1ee31c6c)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# uts/sparc/usbsprl/Makefile
23#
24# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27#ident	"%Z%%M%	%I%	%E% SMI"
28#
29#	This makefile drives the production of the Prolific USB Serial
30#	Adapter driver.
31#
32#	Path to the base of the uts directory tree (usually /usr/src/uts).
33#
34UTSBASE	= ../..
35
36#
37#	Define the module and object file sets.
38#
39MODULE		= usbsprl
40OBJECTS		= $(USBSPRL_OBJS:%=$(OBJS_DIR)/%)
41LINTS		= $(USBSPRL_OBJS:%.o=$(LINTS_DIR)/%.ln)
42WARLOCK_OK	= $(MODULE).ok
43ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
44
45#
46#	Include common rules.
47#
48include $(UTSBASE)/sparc/Makefile.sparc
49
50#
51# lint pass one enforcement
52#
53CFLAGS += $(CCVERBOSE)
54
55LDFLAGS         += -dy -Nmisc/usba -Nmisc/usbser
56
57#
58#	Define targets
59#
60ALL_TARGET	= $(BINARY)
61LINT_TARGET	= $(MODULE).lint
62INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
63
64#
65# For now, disable these lint checks; maintainers should endeavor
66# to investigate and remove these for maximum lint coverage.
67# Please do not carry these forward to new Makefiles.
68#
69LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
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#
99WLCC		= wlcc
100TOUCH		= touch
101WARLOCK		= warlock
102SCCS		= sccs
103TEST		= test
104
105#
106#	warlock
107#
108WARLOCK_OUT	= usbser_pl2303.ll pl2303_dsd.ll
109WARLOCK_CMD	= $(MODULE).wlcmd
110
111USBSER_FILES = $(USBSER_OBJS:%.o=../usbser/%.ll)
112USBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
113UHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
114OHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
115EHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
116
117warlock: $(WARLOCK_OK) warlock_with_usba
118
119%.wlcmd:
120	$(TEST) -f $@ || $(SCCS) get $@
121
122$(WARLOCK_OK): warlock_with_usbser
123	$(TOUCH) $@
124
125%.ll: $(UTSBASE)/common/io/usb/clients/usbser/usbsprl/%.c
126	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
127
128warlock_with_usbser: $(WARLOCK_OUT) usbser_files warlock_ddi.files
129	$(WARLOCK) -c $(WARLOCK_CMD) $(WARLOCK_OUT) \
130		$(USBSER_FILES) -l ../warlock/ddi_dki_impl.ll
131
132usbser_files:
133	@cd ../usbser; pwd; $(MAKE) usbser.ll
134
135warlock_with_usba: $(WARLOCK_CMD) $(WARLOCK_OUT) usbser_files \
136	usba_files ohci_files uhci_files ehci_files warlock_ddi.files
137	$(WARLOCK) -c usbsprl_with_usba.wlcmd \
138		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
139		$(USBSER_FILES) \
140		$(WARLOCK_OUT) -l ../warlock/ddi_dki_impl.ll
141
142usba_files:
143	@cd ../usba;pwd; $(MAKE) warlock
144
145uhci_files:
146	@cd ../uhci;pwd; $(MAKE) warlock
147
148ohci_files:
149	@cd ../ohci;pwd; $(MAKE) warlock
150
151ehci_files:
152	@cd ../ehci;pwd; $(MAKE) warlock
153
154warlock_ddi.files:
155	cd ../warlock; pwd; $(MAKE) warlock
156