Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# CDDL HEADER START
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Common Development and Distribution License (the "License").
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You may not use this file except in compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# or http://www.opensolaris.org/os/licensing.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# and limitations under the License.
ead9bb4b1be81d7bbf8ed86ee41d6c1e58b069a3Yuri Pankov#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# When distributing Covered Code, include this CDDL HEADER in each
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel Telka# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ead9bb4b1be81d7bbf8ed86ee41d6c1e58b069a3Yuri Pankov# If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# information: Portions Copyright [yyyy] [name of copyright owner]
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
ead9bb4b1be81d7bbf8ed86ee41d6c1e58b069a3Yuri Pankov# Use is subject to license terms.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov#
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel Telka# This makefile drives the production of qlc driver kernel module.
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel Telka#
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel Telka# Path to the base of the uts directory tree (usually /usr/src/uts).
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel Telka#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweUTSBASE = ../..
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov
ead9bb4b1be81d7bbf8ed86ee41d6c1e58b069a3Yuri Pankov#
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel Telka# Define the module and object file sets.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov#
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel TelkaMODULE = qlc
6aa4fc89ec1cf2cdf7d7c3b9ec059802ac9abe65Marcel TelkaOBJECTS = $(QLC_OBJS:%=$(OBJS_DIR)/%)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweLINTS = $(QLC_OBJS:%.o=$(LINTS_DIR)/%.ln)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONF_SRCDIR = $(UTSBASE)/common/io/fibre-channel/fca/qlc
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Include common rules.
#
include $(UTSBASE)/Makefile.uts
include $(UTSBASE)/sparc/Makefile.sparc
#
# Define targets
#
ALL_TARGET = $(BINARY) $(CONFMOD) $(ITUMOD)
LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
#
# header file directories
#
INC_PATH += -I$(ROOT)/usr/include
INC_PATH += -I$(UTSBASE)/common/sys/fibre-channel
INC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/ulp
INC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/fca/qlc
INC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/impl
LDFLAGS += -dy -Nmisc/fctl
#
# Lint tags
#
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
FWTABLE = ql_fw_table.c
FWIMAGES = 2200
FWIMAGES += 2300
FWIMAGES += 2400
FWIMAGES += 2500
FWIMAGES += 6322
FWIMAGES += 8100
FWMODULES = $(FWIMAGES:%=$(MODULE)_fw_%)
FWMODULES_SRC = $(FWIMAGES:%=$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_%.c)
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-type-limits
CERRWARN += -_gcc=-Wno-parentheses
#
# Default build targets.
#
.KEEP_STATE:
all: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(ALL_DEPS)
def: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(DEF_DEPS)
clean: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLEAN_DEPS)
clobber: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLOBBER_DEPS)
lint: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(LINT_DEPS)
modlintlib: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(MODLINTLIB_DEPS)
clean.lint: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLEAN_LINT_DEPS)
install: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(INSTALL_DEPS)
$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c: $(FWMODULES_SRC)
/usr/bin/rm -f $@
echo '#include <ql_apps.h>' >> $@
echo '#include <ql_api.h>' >> $@
echo 'struct fw_table fw_table[] = {' >> $@
grep FW_VERSION_STRING $(FWMODULES_SRC) |\
grep '#define' |\
sed 's/[0-9]"/& },/' |\
sed 's/.*ql_fw_/{ 0x/' |\
sed 's/.c:#define/,/' |\
sed 's/FW_VERSION_STRING//' >> $@
echo '{ 0, NULL }' >> $@
echo '};' >> $@
#
# Include common targets.
#
include $(UTSBASE)/sparc/Makefile.targ