1*b6805bf7SGordon Ross#
2*b6805bf7SGordon Ross# CDDL HEADER START
3*b6805bf7SGordon Ross#
4*b6805bf7SGordon Ross# The contents of this file are subject to the terms of the
5*b6805bf7SGordon Ross# Common Development and Distribution License (the "License").
6*b6805bf7SGordon Ross# You may not use this file except in compliance with the License.
7*b6805bf7SGordon Ross#
8*b6805bf7SGordon Ross# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*b6805bf7SGordon Ross# or http://www.opensolaris.org/os/licensing.
10*b6805bf7SGordon Ross# See the License for the specific language governing permissions
11*b6805bf7SGordon Ross# and limitations under the License.
12*b6805bf7SGordon Ross#
13*b6805bf7SGordon Ross# When distributing Covered Code, include this CDDL HEADER in each
14*b6805bf7SGordon Ross# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*b6805bf7SGordon Ross# If applicable, add the following below this CDDL HEADER, with the
16*b6805bf7SGordon Ross# fields enclosed by brackets "[]" replaced with your own identifying
17*b6805bf7SGordon Ross# information: Portions Copyright [yyyy] [name of copyright owner]
18*b6805bf7SGordon Ross#
19*b6805bf7SGordon Ross# CDDL HEADER END
20*b6805bf7SGordon Ross#
21*b6805bf7SGordon Ross#
22*b6805bf7SGordon Ross# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*b6805bf7SGordon Ross# Use is subject to license terms.
24*b6805bf7SGordon Ross#
25*b6805bf7SGordon Ross# Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
26*b6805bf7SGordon Ross#
27*b6805bf7SGordon Ross
28*b6805bf7SGordon Ross# Path to the base of the uts directory tree (usually /usr/src/uts).
29*b6805bf7SGordon RossUTSBASE	= ../../../../..
30*b6805bf7SGordon Ross
31*b6805bf7SGordon Ross#
32*b6805bf7SGordon Ross#	Include common rules.
33*b6805bf7SGordon Ross#
34*b6805bf7SGordon Rossinclude $(SRC)/Makefile.master
35*b6805bf7SGordon Ross
36*b6805bf7SGordon RossFWTABLE          = ql_fw_table.c
37*b6805bf7SGordon RossFWIMAGES         = 2200
38*b6805bf7SGordon RossFWIMAGES        += 2300
39*b6805bf7SGordon RossFWIMAGES        += 2400
40*b6805bf7SGordon RossFWIMAGES        += 2500
41*b6805bf7SGordon RossFWIMAGES        += 6322
42*b6805bf7SGordon RossFWIMAGES        += 8100
43*b6805bf7SGordon Ross
44*b6805bf7SGordon RossFWMODULES_SRC    = $(FWIMAGES:%=ql_fw_%.c)
45*b6805bf7SGordon Ross
46*b6805bf7SGordon Rossall_h install_h : $(FWTABLE)
47*b6805bf7SGordon Ross
48*b6805bf7SGordon Rosscheck:
49*b6805bf7SGordon Ross
50*b6805bf7SGordon Rossclean:
51*b6805bf7SGordon Ross	$(RM) $(FWTABLE)
52*b6805bf7SGordon Ross
53*b6805bf7SGordon Rossclobber: clean
54*b6805bf7SGordon Ross
55*b6805bf7SGordon Ross$(FWTABLE): $(FWMODULES_SRC)
56*b6805bf7SGordon Ross	$(RM) $@
57*b6805bf7SGordon Ross	echo '#include <ql_apps.h>'             >> $@
58*b6805bf7SGordon Ross	echo '#include <ql_api.h>'              >> $@
59*b6805bf7SGordon Ross	echo 'struct fw_table fw_table[] = {'   >> $@
60*b6805bf7SGordon Ross	grep FW_VERSION_STRING $(FWMODULES_SRC) |\
61*b6805bf7SGordon Ross	grep '#define'                          |\
62*b6805bf7SGordon Ross	sed 's/[0-9]"/& },/'                    |\
63*b6805bf7SGordon Ross	sed 's/.*ql_fw_/{ 0x/'                  |\
64*b6805bf7SGordon Ross	sed 's/.c:#define/,/'                   |\
65*b6805bf7SGordon Ross	sed 's/FW_VERSION_STRING//'             >> $@
66*b6805bf7SGordon Ross	echo '{ 0, NULL }'                      >> $@
67*b6805bf7SGordon Ross	echo '};'                               >> $@
68*b6805bf7SGordon Ross
69*b6805bf7SGordon Ross.KEEP_STATE: