2009-02-08 Marco Gerards <marco@gnu.org>
[grub2/jjazz.git] / geninitheader.sh
blob5ad1428b31a5e3fc8bf0f3b6b08c8a6787688eea
1 #! /bin/sh
3 # Copyright (C) 2005,2007 Free Software Foundation, Inc.
5 # This gensymlist.sh is free software; the author
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
14 lst="$1"
15 shift
17 cat <<EOF
18 /* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
20 * GRUB -- GRand Unified Bootloader
21 * Copyright (C) 2005,2007 Free Software Foundation, Inc.
23 * GRUB is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
28 * GRUB is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
37 EOF
39 cat <<EOF
40 void grub_init_all (void);
41 void grub_fini_all (void);
42 EOF
44 grep -v '^#' "${lst}" | sed -n '/GRUB_MOD_INIT *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/void grub_\1_init (void);/;p;}'
45 grep -v '^#' "${lst}" | sed -n '/GRUB_MOD_INIT *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/void grub_\1_fini (void);/;p;}'