b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# CDDL HEADER START
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# The contents of this file are subject to the terms of the
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# Common Development and Distribution License (the "License").
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# You may not use this file except in compliance with the License.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# or http://www.opensolaris.org/os/licensing.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# See the License for the specific language governing permissions
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# and limitations under the License.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# When distributing Covered Code, include this CDDL HEADER in each
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# If applicable, add the following below this CDDL HEADER, with the
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# fields enclosed by brackets "[]" replaced with your own identifying
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# information: Portions Copyright [yyyy] [name of copyright owner]
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# CDDL HEADER END
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# Use is subject to license terms.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# Path to the base of the uts directory tree (usually /usr/src/uts).
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossUTSBASE = ../../../../..
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross# Include common rules.
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Rossinclude $(SRC)/Makefile.master
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWTABLE = ql_fw_table.c
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWIMAGES = 2200
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWIMAGES += 2300
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWIMAGES += 2400
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWIMAGES += 2500
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWIMAGES += 6322
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWIMAGES += 8100
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossFWMODULES_SRC = $(FWIMAGES:%=ql_fw_%.c)
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Rossall_h install_h : $(FWTABLE)
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Rosscheck:
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Rossclean:
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross $(RM) $(FWTABLE)
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Rossclobber: clean
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross$(FWTABLE): $(FWMODULES_SRC)
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross $(RM) $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross echo '#include <ql_apps.h>' >> $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross echo '#include <ql_api.h>' >> $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross echo 'struct fw_table fw_table[] = {' >> $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross grep FW_VERSION_STRING $(FWMODULES_SRC) |\
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross grep '#define' |\
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross sed 's/[0-9]"/& },/' |\
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross sed 's/.*ql_fw_/{ 0x/' |\
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross sed 's/.c:#define/,/' |\
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross sed 's/FW_VERSION_STRING//' >> $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross echo '{ 0, NULL }' >> $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross echo '};' >> $@
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross.KEEP_STATE: