Reduce number of temporary files generated by build system.
* grub-core/gencmdlist.sh: Removed. * grub-core/genfslist.sh: Removed. * grub-core/genhandlerlist.sh: Removed. * grub-core/genmodsrc.sh: Removed. * grub-core/genpartmaplist.sh: Removed. * grub-core/genparttoollist.sh: Removed. * grub-core/gentermiinallist.sh: Removed. * grub-core/genvideolist.sh: Removed. * grub-core/genmod.sh.in: New file. * grub-core/gensyminfo.sh.in: New file. * conf/Makefile.common (CPPFLAGS_*_LIST): New marker flags. * conf/Makefile.extra-dist: Update with new files. * gentpl.py: Remove rules related to unnecessary temporary files. * grub-core/Makefile.am (syminfo.lst): New replacement for def-* and und-* files. * grub-core/Makefile.core.def: New rules for gensyminfo.sh and genmod.sh scripts. * grub-core/bus/usb/uhci.c: Remove empty #define. * grub-core/genmoddep.awk: Updated with new syminfo format. * util/bash-completion.d/Makefile.am: Add config.log to CLEANFILES.
This commit is contained in:
commit
3572f2b65a
19 changed files with 261 additions and 349 deletions
28
ChangeLog
28
ChangeLog
|
@ -1,3 +1,31 @@
|
|||
2010-09-19 BVK Chaitanya <bvk.groups@gmail.com>
|
||||
|
||||
Reduce number of temporary files generated by build system.
|
||||
|
||||
* grub-core/gencmdlist.sh: Removed.
|
||||
* grub-core/genfslist.sh: Removed.
|
||||
* grub-core/genhandlerlist.sh: Removed.
|
||||
* grub-core/genmodsrc.sh: Removed.
|
||||
* grub-core/genpartmaplist.sh: Removed.
|
||||
* grub-core/genparttoollist.sh: Removed.
|
||||
* grub-core/gentermiinallist.sh: Removed.
|
||||
* grub-core/genvideolist.sh: Removed.
|
||||
|
||||
* grub-core/genmod.sh.in: New file.
|
||||
* grub-core/gensyminfo.sh.in: New file.
|
||||
|
||||
* conf/Makefile.common (CPPFLAGS_*_LIST): New marker flags.
|
||||
* conf/Makefile.extra-dist: Update with new files.
|
||||
* gentpl.py: Remove rules related to unnecessary temporary files.
|
||||
* grub-core/Makefile.am (syminfo.lst): New replacement for def-*
|
||||
and und-* files.
|
||||
* grub-core/Makefile.core.def: New rules for gensyminfo.sh and
|
||||
genmod.sh scripts.
|
||||
* grub-core/bus/usb/uhci.c: Remove empty #define.
|
||||
* grub-core/genmoddep.awk: Updated with new syminfo format.
|
||||
* util/bash-completion.d/Makefile.am: Add config.log to
|
||||
CLEANFILES.
|
||||
|
||||
2010-09-19 Yves Blusseau <blusseau@zetam.org>
|
||||
|
||||
* Makefile.util.def: Add forgotten $(LIBINTL) library.
|
||||
|
|
|
@ -88,20 +88,26 @@ CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap
|
|||
|
||||
CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
|
||||
|
||||
# List file macros for recognizing /interesting/ modules
|
||||
CPPFLAGS_FS_LIST = -Dgrub_fs_register=FS_LIST_MARKER
|
||||
CPPFLAGS_VIDEO_LIST= -Dgrub_video_register=VIDEO_LIST_MARKER
|
||||
CPPFLAGS_PARTMAP_LIST = -Dgrub_partition_map_register=PARTMAP_LIST_MARKER
|
||||
CPPFLAGS_PARTTOOL_LIST = -Dgrub_parttool_register=PARTTOOL_LIST_MARKER
|
||||
CPPFLAGS_TERMINAL_LIST = '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \
|
||||
$(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \
|
||||
$(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST)
|
||||
|
||||
# Define these variables to calm down automake
|
||||
|
||||
FS_FILES =
|
||||
DEF_FILES =
|
||||
UND_FILES =
|
||||
IMG_FILES =
|
||||
MOD_FILES =
|
||||
VIDEO_FILES =
|
||||
MODULE_FILES =
|
||||
HANDLER_FILES =
|
||||
PARTMAP_FILES =
|
||||
COMMAND_FILES =
|
||||
PARTTOOL_FILES =
|
||||
TERMINAL_FILES =
|
||||
MARKER_FILES =
|
||||
KERNEL_HEADER_FILES =
|
||||
|
||||
man_MANS =
|
||||
|
|
|
@ -19,20 +19,14 @@ EXTRA_DIST += grub-core/Makefile.core.def
|
|||
EXTRA_DIST += grub-core/Makefile.gcry.def
|
||||
|
||||
EXTRA_DIST += grub-core/genmoddep.awk
|
||||
EXTRA_DIST += grub-core/genmodsrc.sh
|
||||
EXTRA_DIST += grub-core/genfslist.sh
|
||||
EXTRA_DIST += grub-core/gencmdlist.sh
|
||||
EXTRA_DIST += grub-core/genmod.sh.in
|
||||
EXTRA_DIST += grub-core/gensyminfo.sh.in
|
||||
EXTRA_DIST += grub-core/gensymlist.sh
|
||||
EXTRA_DIST += grub-core/genemuinit.sh
|
||||
EXTRA_DIST += grub-core/genvideolist.sh
|
||||
EXTRA_DIST += grub-core/genhandlerlist.sh
|
||||
EXTRA_DIST += grub-core/genpartmaplist.sh
|
||||
EXTRA_DIST += grub-core/genterminallist.sh
|
||||
EXTRA_DIST += grub-core/genparttoollist.sh
|
||||
EXTRA_DIST += grub-core/genemuinitheader.sh
|
||||
|
||||
EXTRA_DIST += grub-core/lib/libgcrypt/cipher
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/include -name '*.h')
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib -name '*.h')
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/gnulib -name '*.h')
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/efiemu -name '*.h')
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib -name '*.h')
|
||||
|
|
77
gentpl.py
77
gentpl.py
|
@ -276,75 +276,13 @@ def module(platform):
|
|||
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
|
||||
r += gvar_add("DEF_FILES", "def-[+ name +].lst")
|
||||
r += gvar_add("UND_FILES", "und-[+ name +].lst")
|
||||
r += gvar_add("MOD_FILES", "[+ name +].mod")
|
||||
r += gvar_add("platform_DATA", "[+ name +].mod")
|
||||
r += gvar_add("CLEANFILES", "def-[+ name +].lst und-[+ name +].lst mod-[+ name +].c mod-[+ name +].o [+ name +].mod")
|
||||
|
||||
r += gvar_add("COMMAND_FILES", "command-[+ name +].lst")
|
||||
r += gvar_add("FS_FILES", "fs-[+ name +].lst")
|
||||
r += gvar_add("VIDEO_FILES", "video-[+ name +].lst")
|
||||
r += gvar_add("PARTMAP_FILES", "partmap-[+ name +].lst")
|
||||
r += gvar_add("HANDLER_FILES", "handler-[+ name +].lst")
|
||||
r += gvar_add("PARTTOOL_FILES", "parttool-[+ name +].lst")
|
||||
r += gvar_add("TERMINAL_FILES", "terminal-[+ name +].lst")
|
||||
r += gvar_add("CLEANFILES", "command-[+ name +].lst fs-[+ name +].lst")
|
||||
r += gvar_add("CLEANFILES", "handler-[+ name +].lst terminal-[+ name +].lst")
|
||||
r += gvar_add("CLEANFILES", "video-[+ name +].lst partmap-[+ name +].lst parttool-[+ name +].lst")
|
||||
|
||||
r += gvar_add("CLEANFILES", "[+ name +].pp")
|
||||
r += gvar_add("MARKER_FILES", "[+ name +].marker")
|
||||
r += gvar_add("CLEANFILES", "[+ name +].marker")
|
||||
r += """
|
||||
[+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES)
|
||||
$(TARGET_CPP) -DGRUB_LST_GENERATOR $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@ || (rm -f $@; exit 1)
|
||||
|
||||
def-[+ name +].lst: [+ name +].module$(EXEEXT)
|
||||
if test x$(USE_APPLE_CC_FIXES) = xyes; then \
|
||||
$(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@; \
|
||||
else \
|
||||
$(NM) -g --defined-only -P -p $< | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@; \
|
||||
fi
|
||||
|
||||
und-[+ name +].lst: [+ name +].module$(EXEEXT)
|
||||
$(NM) -u -P -p $< | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@
|
||||
|
||||
mod-[+ name +].c: [+ name +].module$(EXEEXT) moddep.lst genmodsrc.sh
|
||||
sh $(srcdir)/genmodsrc.sh [+ name +] moddep.lst > $@ || (rm -f $@; exit 1)
|
||||
|
||||
mod-[+ name +].o: mod-[+ name +].c
|
||||
$(TARGET_CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $(""" + cname() + """_CFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
[+ name +].mod: [+ name +].module$(EXEEXT) mod-[+ name +].o
|
||||
if test x$(USE_APPLE_CC_FIXES) = xyes; then \
|
||||
$(CCLD) $(""" + cname() + """_LDFLAGS) $(LDFLAGS) -o $@.bin $^; \
|
||||
$(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@; \
|
||||
rm -f $@.bin; \
|
||||
else \
|
||||
$(CCLD) -o $@ $(""" + cname() + """_LDFLAGS) $(LDFLAGS) $^; \
|
||||
if test ! -z '$(TARGET_OBJ2ELF)'; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \
|
||||
$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@; \
|
||||
fi
|
||||
|
||||
command-[+ name +].lst: [+ name +].pp $(srcdir)/gencmdlist.sh
|
||||
cat $< | sh $(srcdir)/gencmdlist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
|
||||
fs-[+ name +].lst: [+ name +].pp $(srcdir)/genfslist.sh
|
||||
cat $< | sh $(srcdir)/genfslist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
|
||||
video-[+ name +].lst: [+ name +].pp $(srcdir)/genvideolist.sh
|
||||
cat $< | sh $(srcdir)/genvideolist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
|
||||
partmap-[+ name +].lst: [+ name +].pp $(srcdir)/genpartmaplist.sh
|
||||
cat $< | sh $(srcdir)/genpartmaplist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
|
||||
parttool-[+ name +].lst: [+ name +].pp $(srcdir)/genparttoollist.sh
|
||||
cat $< | sh $(srcdir)/genparttoollist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
|
||||
handler-[+ name +].lst: [+ name +].pp $(srcdir)/genhandlerlist.sh
|
||||
cat $< | sh $(srcdir)/genhandlerlist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
|
||||
terminal-[+ name +].lst: [+ name +].pp $(srcdir)/genterminallist.sh
|
||||
cat $< | sh $(srcdir)/genterminallist.sh [+ name +] > $@ || (rm -f $@; exit 1)
|
||||
[+ name +].marker: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES)
|
||||
$(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1)
|
||||
grep 'MARKER' $@.new > $@; rm -f $@.new
|
||||
"""
|
||||
return r
|
||||
|
||||
|
@ -471,9 +409,8 @@ def script(platform):
|
|||
r += "[+ IF mansection +]" + manpage() + "[+ ENDIF +]"
|
||||
r += "[+ ENDIF +]"
|
||||
|
||||
r += rule("[+ name +]", "$(top_builddir)/config.status " + platform_sources(platform), """
|
||||
$(top_builddir)/config.status --file=-:""" + platform_sources(platform) + """ \
|
||||
| sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
|
||||
r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """
|
||||
$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
|
||||
chmod a+x [+ name +]
|
||||
""")
|
||||
|
||||
|
|
|
@ -178,8 +178,8 @@ kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h
|
|||
$(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input
|
||||
if grep "^#define HAVE_ASM_USCORE" $(top_builddir)/config.h; then u="_"; else u=""; fi; \
|
||||
cat kernel_syms.input | grep -v '^#' | sed -n \
|
||||
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
|
||||
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
|
||||
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined '"$$u"'kernel \1/;p;}' \
|
||||
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined '"$$u"' kernel \1/;p;}' \
|
||||
| sort -u >$@
|
||||
rm -f kernel_syms.input
|
||||
CLEANFILES += kernel_syms.lst
|
||||
|
@ -199,61 +199,91 @@ grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES)
|
|||
CLEANFILES += grub_emu_init.c
|
||||
endif
|
||||
|
||||
# .lst files
|
||||
platform_DATA += moddep.lst
|
||||
platform_DATA += fs.lst
|
||||
platform_DATA += command.lst
|
||||
platform_DATA += partmap.lst
|
||||
platform_DATA += handler.lst
|
||||
platform_DATA += terminal.lst
|
||||
platform_DATA += parttool.lst
|
||||
platform_DATA += video.lst
|
||||
platform_DATA += crypto.lst
|
||||
CLEANFILES += moddep.lst
|
||||
CLEANFILES += handler.lst
|
||||
CLEANFILES += terminal.lst
|
||||
CLEANFILES += parttool.lst
|
||||
CLEANFILES += video.lst
|
||||
CLEANFILES += crypto.lst
|
||||
# List files
|
||||
|
||||
fs.lst: $(FS_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
fs.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
if grep 'FS_LIST_MARKER' $$pp >/dev/null 2>&1; then \
|
||||
echo $$b; \
|
||||
fi; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += fs.lst
|
||||
CLEANFILES += fs.lst
|
||||
|
||||
command.lst: $(COMMAND_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
command.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
sed -n \
|
||||
-e "/COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" \
|
||||
-e "/EXTCOMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \
|
||||
-e "/P1COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" $$pp; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += command.lst
|
||||
CLEANFILES += command.lst
|
||||
|
||||
partmap.lst: $(PARTMAP_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
partmap.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
if grep 'PARTMAP_LIST_MARKER' $$pp >/dev/null 2>&1; then \
|
||||
echo $$b; \
|
||||
fi; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += partmap.lst
|
||||
CLEANFILES += partmap.lst
|
||||
|
||||
handler.lst: $(HANDLER_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
CLEANFILES += handler.lst
|
||||
|
||||
terminal.lst: $(TERMINAL_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
terminal.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
sed -n \
|
||||
-e "/INPUT_TERMINAL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \
|
||||
-e "/OUTPUT_TERMINAL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}" $$pp; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += terminal.lst
|
||||
CLEANFILES += terminal.lst
|
||||
|
||||
parttool.lst: $(PARTTOOL_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
parttool.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
sed -n \
|
||||
-e "/PARTTOOL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" $$pp; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += parttool.lst
|
||||
CLEANFILES += parttool.lst
|
||||
|
||||
video.lst: $(VIDEO_FILES)
|
||||
cat $^ /dev/null | sort | uniq > $@
|
||||
video.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
if grep 'VIDEO_LIST_MARKER' $$pp >/dev/null 2>&1; then \
|
||||
echo $$b; \
|
||||
fi; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += video.lst
|
||||
CLEANFILES += video.lst
|
||||
|
||||
# but, crypto.lst is simply copied
|
||||
crypto.lst: $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst
|
||||
cp $^ $@
|
||||
platform_DATA += crypto.lst
|
||||
CLEANFILES += crypto.lst
|
||||
|
||||
syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES)
|
||||
cat kernel_syms.lst > $@.new
|
||||
for m in $(MODULE_FILES); do \
|
||||
sh $< $$m >> $@.new || exit 1; \
|
||||
done
|
||||
mv $@.new $@
|
||||
|
||||
# generate global module dependencies list
|
||||
moddep.lst: kernel_syms.lst genmoddep.awk $(DEF_FILES) $(UND_FILES)
|
||||
cat $(DEF_FILES) kernel_syms.lst /dev/null \
|
||||
| $(AWK) -f $(srcdir)/genmoddep.awk $(UND_FILES) > $@ \
|
||||
|| (rm -f $@; exit 1)
|
||||
moddep.lst: syminfo.lst genmoddep.awk
|
||||
cat $< | sort | awk -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1)
|
||||
platform_DATA += moddep.lst
|
||||
CLEANFILES += config.log syminfo.lst moddep.lst
|
||||
|
||||
$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT)
|
||||
sh $^ $@
|
||||
platform_DATA += $(MOD_FILES)
|
||||
CLEANFILES += $(MOD_FILES)
|
||||
|
||||
if COND_ENABLE_EFIEMU
|
||||
efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF)
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
AutoGen definitions Makefile.tpl;
|
||||
|
||||
script = {
|
||||
installdir = noinst;
|
||||
name = gensyminfo.sh;
|
||||
common = gensyminfo.sh.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
installdir = noinst;
|
||||
name = genmod.sh;
|
||||
common = genmod.sh.in;
|
||||
};
|
||||
|
||||
kernel = {
|
||||
name = kernel;
|
||||
|
||||
|
|
|
@ -55,8 +55,6 @@ enum
|
|||
GRUB_UHCI_PORTSC_RWC = ((1 << 1) | (1 << 3) | (1 << 11) | (3 << 13))
|
||||
};
|
||||
|
||||
#define
|
||||
|
||||
/* UHCI Queue Head. */
|
||||
struct grub_uhci_qh
|
||||
{
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2005,2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This gensymlist.sh is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect command names.
|
||||
|
||||
module=$1
|
||||
|
||||
grep -v "^#" | sed -n \
|
||||
-e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \
|
||||
-e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" \
|
||||
-e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}"
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2005,2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This gensymlist.sh is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect fs names.
|
||||
|
||||
module=$1
|
||||
|
||||
# Ignore kernel.mod.
|
||||
if test $module = kernel; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# For now, this emits only a module name, if the module registers a filesystem.
|
||||
if grep -v "^#" | grep '^ *grub_fs_register' >/dev/null 2>&1; then
|
||||
echo $module
|
||||
fi
|
|
@ -1,19 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This script is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect command names.
|
||||
|
||||
module=$1
|
||||
|
||||
grep -v "^#" | sed -n \
|
||||
-e "/grub_parser_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/parser.\1: $module/;p;}"
|
73
grub-core/genmod.sh.in
Normal file
73
grub-core/genmod.sh.in
Normal file
|
@ -0,0 +1,73 @@
|
|||
#! /bin/sh -e
|
||||
#
|
||||
# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# This gensymlist.sh is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# genmod.sh moddep.lst normal.module normal.mod
|
||||
#
|
||||
|
||||
moddep=$1
|
||||
infile=$2
|
||||
outfile=$3
|
||||
|
||||
tmpfile=${outfile}.tmp
|
||||
modname=`echo $infile | sed -e 's@\.module.*$@@'`
|
||||
|
||||
if ! grep ^$modname: $moddep >/dev/null; then
|
||||
echo "warning: moddep.lst has no dependencies for $modname" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
deps=`grep ^$modname: $moddep | sed s@^.*:@@`
|
||||
|
||||
# remove old files if any
|
||||
rm -f $tmpfile $outfile
|
||||
|
||||
# stripout .modname and .moddeps sections from input module
|
||||
objcopy -R .modname -R .moddeps $infile $tmpfile
|
||||
|
||||
# Attach .modname and .moddeps sections
|
||||
t1=`mktemp`
|
||||
printf "$modname\0" >$t1
|
||||
|
||||
t2=`mktemp`
|
||||
for dep in $deps; do printf "$dep\0" >> $t2; done
|
||||
|
||||
if test -n "$deps"; then
|
||||
objcopy --add-section .modname=$t1 --add-section .moddeps=$t2 $tmpfile
|
||||
else
|
||||
objcopy --add-section .modname=$t1 $tmpfile
|
||||
fi
|
||||
rm -f $t1 $t2
|
||||
|
||||
if test x@TARGET_APPLE_CC@ != x1; then
|
||||
if ! test -z "@TARGET_OBJ2ELF@"; then
|
||||
./@TARGET_OBJ2ELF@ $tmpfile || exit 1
|
||||
fi
|
||||
if test x@platform@ != xemu; then
|
||||
@STRIP@ --strip-unneeded \
|
||||
-K grub_mod_init -K grub_mod_fini \
|
||||
-K _grub_mod_init -K _grub_mod_fini \
|
||||
-R .note -R .comment $tmpfile || exit 1
|
||||
fi
|
||||
else
|
||||
# XXX Test these Apple CC fixes
|
||||
cp $tmpfile $tmpfile.bin
|
||||
@OBJCONV@ -f@TARGET_MODULE_FORMAT@ \
|
||||
-nr:_grub_mod_init:grub_mod_init \
|
||||
-nr:_grub_mod_fini:grub_mod_fini \
|
||||
-wd1106 -ew2030 -ew2050 -nu -nd $tmpfile.bin $tmpfile || exit 1
|
||||
rm -f $name.bin
|
||||
fi
|
||||
mv $tmpfile $outfile
|
|
@ -11,24 +11,29 @@
|
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read defined symbols from stdin.
|
||||
# Read symbols' info from stdin.
|
||||
BEGIN {
|
||||
error = 0
|
||||
lineno = 0;
|
||||
while (getline <"/dev/stdin") {
|
||||
symtab[$1] = $2
|
||||
}
|
||||
}
|
||||
|
||||
# The rest is undefined symbols.
|
||||
{
|
||||
module = $2
|
||||
|
||||
if ($1 in symtab) {
|
||||
modtab[module] = modtab[module] " " symtab[$1];
|
||||
}
|
||||
else if ($1 != "__gnu_local_gp") {
|
||||
printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
|
||||
lineno++;
|
||||
if ($1 == "defined") {
|
||||
symtab[$3] = $2;
|
||||
modtab[$2] = "" modtab[$2]
|
||||
} else if ($1 == "undefined") {
|
||||
if ($3 in symtab)
|
||||
modtab[$2] = modtab[$2] " " symtab[$3];
|
||||
else if ($3 != "__gnu_local_gp") {
|
||||
printf "%s in %s is not defined\n", $3, $2 >"/dev/stderr";
|
||||
error++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf "error: %u: unrecognized input format\n", lineno;
|
||||
error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Output the result.
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2002,2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This genmodsrc.sh is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
set -e
|
||||
|
||||
mod_name="$1"
|
||||
deps="$2"
|
||||
|
||||
cat <<EOF
|
||||
/* This file is automatically generated by genmodsrc.sh. DO NOT EDIT! */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2007 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
|
||||
EOF
|
||||
|
||||
echo "GRUB_MOD_NAME(${mod_name});"
|
||||
|
||||
for mod in `grep "^${mod_name}:" ${deps} | sed 's/^[^:]*://'`; do
|
||||
echo "GRUB_MOD_DEP(${mod});"
|
||||
done
|
|
@ -1,26 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2005, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This script is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect partmap names.
|
||||
|
||||
module=$1
|
||||
|
||||
# Ignore kernel.mod.
|
||||
if test $module = kernel; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# For now, this emits only a module name, if the module registers a partition map.
|
||||
if grep -v "^#" | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then
|
||||
echo $module
|
||||
fi
|
|
@ -1,19 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This gensymlist.sh is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect parttool names.
|
||||
|
||||
module=$1
|
||||
|
||||
grep -v "^#" | sed -n \
|
||||
-e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}"
|
34
grub-core/gensyminfo.sh.in
Normal file
34
grub-core/gensyminfo.sh.in
Normal file
|
@ -0,0 +1,34 @@
|
|||
#! /bin/sh -e
|
||||
#
|
||||
# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# This gensymlist.sh is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# gensyms.sh normal.module
|
||||
#
|
||||
|
||||
module=$1
|
||||
modname=`echo $module | sed -e 's@\.module.*$@@'`
|
||||
|
||||
# Print all symbols defined by module
|
||||
if test x@TARGET_APPLE_CC@ = x1; then
|
||||
@NM@ -g -P -p $module | \
|
||||
grep -E '^[a-zA-Z0-9_]* [TDS]' | \
|
||||
sed "s@^\([^ ]*\).*@defined $modname \1@g"
|
||||
else
|
||||
@NM@ -g --defined-only -P -p $module | \
|
||||
sed "s@^\([^ ]*\).*@defined $modname \1@g"
|
||||
fi
|
||||
|
||||
# Print all undefined symbols used by module
|
||||
@NM@ -u -P -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g"
|
|
@ -1,20 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2009,2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# This script is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect command names.
|
||||
|
||||
module=$1
|
||||
|
||||
grep -v "^#" | sed -n \
|
||||
-e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $module/;p;}" \
|
||||
-e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $module/;p;}" \
|
|
@ -1,26 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2005,2008,2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This script is free software; the author
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Read source code from stdin and detect partmap names.
|
||||
|
||||
module=$1
|
||||
|
||||
# Ignore video.mod.
|
||||
if test $module = video; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# For now, this emits only a module name, if the module registers a partition map.
|
||||
if grep -v "^#" | grep '^ *grub_video_register' >/dev/null 2>&1; then
|
||||
echo $module
|
||||
fi
|
|
@ -4,7 +4,7 @@ bash_completion_script = grub
|
|||
|
||||
EXTRA_DIST = $(bash_completion_source)
|
||||
|
||||
CLEANFILES = $(bash_completion_script)
|
||||
CLEANFILES = $(bash_completion_script) config.log
|
||||
|
||||
bashcompletiondir = $(sysconfdir)/bash_completion.d
|
||||
bashcompletion_DATA = $(bash_completion_script)
|
||||
|
|
Loading…
Reference in a new issue