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