Makefile revision 16dd44c265271a75647fb0bb41109bb7c585a526
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
93c20f2609342fd05f6625f16dfcb9348e7977f2Sukumar Swaminathan# This makefile drives the production of qlc driver kernel module.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
93c20f2609342fd05f6625f16dfcb9348e7977f2Sukumar Swaminathan# Path to the base of the uts directory tree (usually /usr/src/uts).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteUTSBASE = ../..
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Define the module and object file sets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteMODULE = qlc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteOBJECTS = $(QLC_OBJS:%=$(OBJS_DIR)/%)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINTS = $(QLC_OBJS:%.o=$(LINTS_DIR)/%.ln)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCONF_SRCDIR = $(UTSBASE)/common/io/fibre-channel/fca/qlc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Include common rules.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinclude $(UTSBASE)/Makefile.uts
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinclude $(UTSBASE)/intel/Makefile.intel
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Define targets
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteALL_TARGET = $(BINARY) $(CONFMOD) $(ITUMOD)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINT_TARGET = $(MODULE).lint
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# header file directories
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINC_PATH += -I$(ROOT)/usr/include
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINC_PATH += -I$(UTSBASE)/common/sys/fibre-channel
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/ulp
93c20f2609342fd05f6625f16dfcb9348e7977f2Sukumar SwaminathanINC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/fca/qlc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteINC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/impl
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLDFLAGS += -dy -Nmisc/fctl
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Lint tags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWTABLE = ql_fw_table.c
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWIMAGES = 2200
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWIMAGES += 2300
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWIMAGES += 2400
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWIMAGES += 2500
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWIMAGES += 6322
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWMODULES = $(FWIMAGES:%=$(MODULE)_fw_%)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFWMODULES_SRC = $(FWIMAGES:%=$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_%.c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Default build targets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte.KEEP_STATE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteall: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(ALL_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedef: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(DEF_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclean: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLEAN_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclobber: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLOBBER_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortelint: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(LINT_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodlintlib: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(MODLINTLIB_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclean.lint: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(CLEAN_LINT_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstall: $(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c $(INSTALL_DEPS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c: $(FWMODULES_SRC)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /usr/bin/rm -f $@
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo '#include <ql_apps.h>' >> $@
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo '#include <ql_api.h>' >> $@
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo 'struct fw_table fw_table[] = {' >> $@
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte grep FW_VERSION_STRING $(FWMODULES_SRC) |\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte grep '#define' |\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed 's/[0-9]"/& },/' |\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed 's/.*ql_fw_/{ 0x/' |\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed 's/.c:#define/,/' |\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sed 's/FW_VERSION_STRING//' >> $@
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard echo '{ 0, NULL }' >> $@
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo '};' >> $@
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Include common targets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinclude $(UTSBASE)/intel/Makefile.targ