Makefile revision 3066:2a2af34f0642
1141580Sru#
2141580Sru# CDDL HEADER START
3141580Sru#
4136231Simp# The contents of this file are subject to the terms of the
5141580Sru# Common Development and Distribution License (the "License").
6141580Sru# You may not use this file except in compliance with the License.
7141580Sru#
8141580Sru# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9141580Sru# or http://www.opensolaris.org/os/licensing.
10141580Sru# See the License for the specific language governing permissions
11141580Sru# and limitations under the License.
12141580Sru#
13141580Sru# When distributing Covered Code, include this CDDL HEADER in each
14136231Simp# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15141580Sru# If applicable, add the following below this CDDL HEADER, with the
16141580Sru# fields enclosed by brackets "[]" replaced with your own identifying
17141580Sru# information: Portions Copyright [yyyy] [name of copyright owner]
18141580Sru#
19141580Sru# CDDL HEADER END
20141580Sru#
21141580Sru#
22141580Sru# uts/sparc/usbskel/Makefile
23141580Sru
24141580Sru# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25141580Sru# Use is subject to license terms.
26136231Simp#
27136231Simp#ident	"%Z%%M%	%I%	%E% SMI"
28136231Simp#
29140246Sdds#	This makefile drives the production of the usbskel kernel driver.
30136231Simp#
31136231Simp#	sparc architecture dependent
32136231Simp#
33136231Simp
34136231Simp#
35136231Simp#	Path to the base of the uts directory tree (usually /usr/src/uts).
36136231Simp#
37136231SimpUTSBASE	= ../..
38140228Sru
39140228Sru#
40140228Sru#	Define the module and object file sets.
41140228Sru#
42140228SruMODULE		= usbskel
43140228SruOBJECTS		= $(USBSKEL_OBJS:%=$(OBJS_DIR)/%)
44140228SruLINTS		= $(USBSKEL_OBJS:%.o=$(LINTS_DIR)/%.ln)
45140246SddsROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
46136231SimpCONF_SRCDIR     = $(UTSBASE)/common/io/usb/clients/usbskel
47136231SimpWARLOCK_OUT	= $(USBSKEL_OBJS:%.o=%.ll)
48140228SruWARLOCK_OK	= $(MODULE).ok
49136231Simp
50136231Simp#
51136231Simp#	Include common rules.
52136231Simp#
53136231Simpinclude $(UTSBASE)/sparc/Makefile.sparc
54136231Simp
55136231Simp# 
56136231Simp# lint pass one enforcement 
57136231Simp# 
58136231SimpCFLAGS += $(CCVERBOSE)
59136231Simp
60136231Simp#
61136231Simp# depends on misc/usba
62136231Simp#
63136231SimpLDFLAGS         += -dy -Nmisc/usba
64136231Simp
65136231Simp#
66136231Simp#	Define targets
67136231Simp#
68136231SimpALL_TARGET	= $(BINARY) $(SRC_CONFILE)
69136231SimpLINT_TARGET	= $(MODULE).lint
70136231SimpINSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
71136231Simp
72136231Simp#
73136231Simp# For now, disable these lint checks; maintainers should endeavor
74136231Simp# to investigate and remove these for maximum lint coverage.
75136231Simp# Please do not carry these forward to new Makefiles.
76136231Simp#
77136231SimpLINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
78136231Simp
79136231Simp.KEEP_STATE:
80136231Simp
81136231Simpall:		$(ALL_DEPS)
82136231Simp
83136231Simpdef:		$(DEF_DEPS)
84136231Simp
85136231Simpclean:		$(CLEAN_DEPS); \
86140228Sru                $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
87136231Simp
88136231Simpclobber:	$(CLOBBER_DEPS); \
89136231Simp		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
90136231Simp
91136231Simplint:		$(LINT_DEPS)
92136231Simp
93136231Simpmodlintlib:	$(MODLINTLIB_DEPS)
94136231Simp
95136231Simpclean.lint:	$(CLEAN_LINT_DEPS)
96136231Simp
97136231Simpinstall:	$(INSTALL_DEPS)
98136231Simp
99140228Sru#
100136231Simp#	Include common targets.
101136231Simp#
102136231Simpinclude $(UTSBASE)/sparc/Makefile.targ
103136231Simp
104136231Simp#
105136231Simp#	Defines for local commands.
106136231Simp#
107136231SimpWARLOCK		= warlock
108136231SimpWLCC		= wlcc
109136231SimpTOUCH		= touch
110136231SimpSCCS		= sccs
111136231SimpTEST		= test
112136231Simp
113136231Simp#
114136231Simp#	lock_lint rules
115136231Simp#
116136231SimpWARLOCK_OBJECTS = $(USBSKEL_OBJS:%.o=%.ll)
117140228SruUSBA_FILES = $(USBA_OBJS:%.o=../usba/%.ll)
118136231SimpUHCI_FILES = $(UHCI_OBJS:%.o=../uhci/%.ll)
119136231SimpOHCI_FILES = $(OHCI_OBJS:%.o=../ohci/%.ll)
120140228SruEHCI_FILES = $(EHCI_OBJS:%.o=../ehci/%.ll)
121136231Simp
122148580Skeramidawarlock: $(MODULE).ok $(WARLOCK_OBJECTS) warlock_with_usba
123140228Sru
124136231Simp%.wlcmd:
125136231Simp	$(TEST) -f $@ || $(SCCS) get $@
126136231Simp
127136231Simpusbskel.ok: $(WARLOCK_OBJECTS) usbskel.wlcmd warlock_ddi.files
128136231Simp	$(WARLOCK) -c usbskel.wlcmd $(WARLOCK_OBJECTS)  \
129140228Sru		-l ../warlock/ddi_dki_impl.ll
130136231Simp	$(TOUCH) $@
131136231Simp
132136231Simp%.ll: $(UTSBASE)/common/io/usb/clients/usbskel/%.c \
133136231Simp		$(UTSBASE)/common/sys/usb/clients/usbskel/usbskel.h
134136231Simp	$(WLCC)  $(CPPFLAGS) -DDEBUG -DUSBSKEL_PM -DUSBSKEL_CPR -o $@ $<
135136231Simp
136136231Simp
137136231Simpwarlock_with_usba: usbskel.wlcmd  $(WARLOCK_OBJECTS) usba_files \
138136231Simp	ohci_files ehci_files uhci_files warlock_ddi.files
139136231Simp	$(WARLOCK) -c ./usbskel_with_usba.wlcmd \
140136231Simp		$(USBA_FILES) $(OHCI_FILES) $(EHCI_FILES) $(UHCI_FILES) \
141136231Simp		$(WARLOCK_OBJECTS) \
142136231Simp	-l ../warlock/ddi_dki_impl.ll
143136231Simp
144136231Simpusba_files:
145136231Simp	@cd ../usba;pwd; $(MAKE) warlock
146136231Simp
147136231Simpuhci_files:
148136231Simp	@cd ../uhci;pwd; $(MAKE) warlock
149136231Simp
150136231Simpohci_files:
151136231Simp	@cd ../ohci;pwd; $(MAKE) warlock
152140228Sru
153136231Simpehci_files:
154136231Simp	@cd ../ehci;pwd; $(MAKE) warlock
155136231Simp
156136231Simpwarlock_ddi.files:
157136231Simp	cd ../warlock; pwd; $(MAKE) warlock
158136231Simp
159136231Simp