xref: /titanic_51/usr/src/uts/sparc/qlc/Makefile (revision 628e3cbed6489fa1db545d8524a06cd6535af456)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident "@(#)Makefile 1.10	08/07/25 SMI"
26#
27# This makefile drives the production of fcp driver kernel module.
28#
29# i86pc architecture dependent
30#
31
32#
33#	Path to the base of the uts directory tree (usually /usr/src/uts).
34#
35UTSBASE	= ../..
36
37#
38#	Define the module and object file sets.
39#
40MODULE		= qlc
41OBJECTS		= $(QLC_OBJS:%=$(OBJS_DIR)/%)
42LINTS		= $(QLC_OBJS:%.o=$(LINTS_DIR)/%.ln)
43ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
44CONF_SRCDIR	= $(UTSBASE)/common/io/fibre-channel/fca/qlc
45
46#
47#	Include common rules.
48#
49include $(UTSBASE)/Makefile.uts
50include $(UTSBASE)/sparc/Makefile.sparc
51
52#
53#	Define targets
54#
55ALL_TARGET	= $(BINARY) $(CONFMOD) $(ITUMOD)
56LINT_TARGET	= $(MODULE).lint
57INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
58
59#
60#	header file directories
61#
62INC_PATH	+= -I$(ROOT)/usr/include
63INC_PATH	+= -I$(UTSBASE)/common/sys/fibre-channel
64INC_PATH	+= -I$(UTSBASE)/common/sys/fibre-channel/ulp
65INC_PATH	+= -I$(UTSBASE)/common/sys/fibre-channel/fca
66INC_PATH	+= -I$(UTSBASE)/common/sys/fibre-channel/impl
67
68LDFLAGS		+= -dy -Nmisc/fctl
69
70#
71#	Lint tags
72#
73LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
74LINTTAGS	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
75
76FWTABLE          = ql_fw_table.c
77FWIMAGES         = 2200
78FWIMAGES        += 2300
79FWIMAGES        += 2400
80FWIMAGES        += 2500
81FWIMAGES        += 6322
82
83FWMODULES        = $(FWIMAGES:%=$(MODULE)_fw_%)
84FWMODULES_SRC    = $(FWIMAGES:%=$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_%.c)
85
86#
87#	Default build targets.
88#
89.KEEP_STATE:
90
91all:		$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(ALL_DEPS)
92
93def:		$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(DEF_DEPS)
94
95clean:		$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLEAN_DEPS)
96
97clobber:	$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLOBBER_DEPS)
98
99lint:		$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(LINT_DEPS)
100
101modlintlib:	$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(MODLINTLIB_DEPS)
102
103clean.lint:	$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLEAN_LINT_DEPS)
104
105install:	$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(INSTALL_DEPS)
106
107$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c: $(FWMODULES_SRC)
108	/usr/bin/rm -f $@
109	echo '#include <ql_apps.h>'             >> $@
110	echo '#include <ql_api.h>'              >> $@
111	echo 'struct fw_table fw_table[] = {'   >> $@
112	grep FW_VERSION_STRING $(FWMODULES_SRC) |\
113	grep '#define'                          |\
114	sed 's/[0-9]"/& },/'                    |\
115	sed 's/.*ql_fw_/{ 0x/'                  |\
116	sed 's/.c:#define/,/'                   |\
117	sed 's/FW_VERSION_STRING//'             >> $@
118	echo '};'                               >> $@
119
120#
121#	Include common targets.
122#
123include $(UTSBASE)/sparc/Makefile.targ
124