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