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