remove per module lst files for creating fs.lst, command.lst, etc.

This commit is contained in:
BVK Chaitanya 2010-08-29 10:38:46 +05:30
parent a7363f53c8
commit a0bf9fc930
10 changed files with 63 additions and 227 deletions

View File

@ -85,18 +85,12 @@ CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
# Define these variables to calm down automake
FS_FILES =
PP_FILES =
DEF_FILES =
UND_FILES =
IMG_FILES =
MOD_FILES =
VIDEO_FILES =
MODULE_FILES =
HANDLER_FILES =
PARTMAP_FILES =
COMMAND_FILES =
PARTTOOL_FILES =
TERMINAL_FILES =
KERNEL_HEADER_FILES =
man_MANS =

View File

@ -290,17 +290,7 @@ def module(platform):
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("PP_FILES", "[+ name +].pp")
r += gvar_add("CLEANFILES", "[+ name +].pp")
r += """
[+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES)
@ -332,27 +322,6 @@ mod-[+ name +].o: mod-[+ name +].c
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)
"""
return r

View File

@ -256,56 +256,87 @@ 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: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
if grep -v "^#" $$pp | grep '^ *grub_fs_register' >/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: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
grep -v "^#" $$pp | sed -n \
-e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" \
-e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \
-e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}"; \
done) | sort -u > $@
platform_DATA += command.lst
CLEANFILES += command.lst
partmap.lst: $(PARTMAP_FILES)
cat $^ /dev/null | sort | uniq > $@
partmap.lst: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
if grep -v "^#" $$pp | grep '^ *grub_partition_map_register' >/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 > $@
handler.lst: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
grep -v "^#" $$pp | sed -n \
-e "/grub_parser_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/parser.\1: $$b/;p;}"; \
done) | sort -u > $@
platform_DATA += handler.lst
CLEANFILES += handler.lst
terminal.lst: $(TERMINAL_FILES)
cat $^ /dev/null | sort | uniq > $@
terminal.lst: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
grep -v "^#" $$pp | sed -n \
-e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \
-e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}"; \
done) | sort -u > $@
platform_DATA += terminal.lst
CLEANFILES += terminal.lst
parttool.lst: $(PARTTOOL_FILES)
cat $^ /dev/null | sort | uniq > $@
parttool.lst: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
grep -v "^#" $$pp | sed -n \
-e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}"; \
done) | sort -u > $@
platform_DATA += parttool.lst
CLEANFILES += parttool.lst
video.lst: $(VIDEO_FILES)
cat $^ /dev/null | sort | uniq > $@
video.lst: $(PP_FILES)
(for pp in $^; do \
b=`basename $$pp .pp`; \
if grep -v "^#" $$pp | grep '^ *grub_video_register' >/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
# .lst files
platform_DATA += moddep.lst
CLEANFILES += moddep.lst
# generate global module dependencies list
moddep.lst: kernel_syms.lst genmoddep.awk $(DEF_FILES) $(UND_FILES)
cat $(DEF_FILES) kernel_syms.lst /dev/null \

View File

@ -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;}"

View File

@ -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

View File

@ -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;}"

View File

@ -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

View File

@ -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;}"

View File

@ -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;}" \

View File

@ -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