xref: /onnv-gate/usr/src/uts/intel/hwa1480_fw/Makefile (revision 9430:637732b28916)
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/intel/hwa1480_fw/Makefile
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#
27#	This makefile drives the production of the hwa1480_fw kernel module.
28#
29#
30#	Path to the base of the uts directory tree (usually /usr/src/uts).
31#
32UTSBASE	= ../..
33
34#
35#	Define the module and object file sets.
36#
37MODULE		= hwa1480_fw
38OBJECTS		= $(WUSB_FWMOD_OBJS:%=$(OBJS_DIR)/%)
39LINTS		= $(WUSB_FWMOD_OBJS:%.o=$(LINTS_DIR)/%.ln)
40ROOTMODULE	= $(ROOT_MISC_DIR)/$(MODULE)
41WARLOCK_OUT	= $(WUSB_FWMOD_OBJS:%.o=%.ll)
42WARLOCK_OK	= $(MODULE).ok
43
44FWOBJ		= $(OBJS_DIR)/$(MODULE).o
45
46OBJECTS		+= $(FWOBJ)
47
48#
49#	Include common rules.
50#
51include $(UTSBASE)/intel/Makefile.intel
52
53LDFLAGS	=
54#
55#	Define targets
56#
57ALL_TARGET	= $(BINARY)
58LINT_TARGET	= $(MODULE).lint
59INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
60
61#
62# For now, disable these lint checks; maintainers should endeavor
63# to investigate and remove these for maximum lint coverage.
64# Please do not carry these forward to new Makefiles.
65#
66LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
67LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
68LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
69LINTTAGS	+= -erroff=E_STATIC_UNUSED
70
71#
72#	Default build targets.
73#
74.KEEP_STATE:
75
76def:		$(DEF_DEPS) $(FWOBJ)
77
78all:		$(ALL_DEPS)
79
80clean:		$(CLEAN_DEPS)
81		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
82
83clobber:	$(CLOBBER_DEPS)
84		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
85
86lint:		$(LINT_DEPS)
87
88modlintlib:	$(MODLINTLIB_DEPS)
89
90clean.lint:	$(CLEAN_LINT_DEPS)
91
92install:	$(INSTALL_DEPS)
93
94
95# customized section for transforming firmware binary
96ELFWRAP		= elfwrap
97BINSRC		= $(UTSBASE)/common/io/usb/clients/hwa1480_fw/i1480
98ORIGIN_SRC	= i1480-usb-0.0.bin
99
100#get build type, 32/64
101WRAPTYPE	= $(CLASS:%=-%)
102
103#set elfwrap option
104WRAPOPT		= $(WRAPTYPE:-32=)
105
106$(FWOBJ):
107	cp $(BINSRC)/$(ORIGIN_SRC) $(BINSRC)/$(MODULE)
108	$(ELFWRAP) $(WRAPOPT) -o $@ $(BINSRC)/$(MODULE)
109
110#
111#	Include common targets.
112#
113include $(UTSBASE)/intel/Makefile.targ
114
115#
116#	Defines for local commands.
117#
118WLCC		= wlcc
119TOUCH		= touch
120WARLOCK		= warlock
121
122#
123#	Warlock targets
124#
125warlock: $(WARLOCK_OK)
126
127$(WARLOCK_OK):	$(WARLOCK_OUT)
128	$(TOUCH) $@
129
130%.ll: $(UTSBASE)/common/io/usb/clients/hwa1480_fw/%.c
131	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
132