From: BVK Chaitanya Date: Sun, 19 Sep 2010 13:59:36 +0000 (+0530) Subject: Reduce number of temporary files generated by build system. X-Git-Tag: 1.99~482 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3572f2b65a76fb493c230e28dcdd557de9552ffc;p=thirdparty%2Fgrub.git 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. --- 3572f2b65a76fb493c230e28dcdd557de9552ffc diff --cc ChangeLog index 3b390d3f6,86f6f204d..2988a17df --- a/ChangeLog +++ b/ChangeLog @@@ -1,7 -1,3 +1,35 @@@ ++2010-09-19 BVK Chaitanya ++ ++ 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 + + * Makefile.util.def: Add forgotten $(LIBINTL) library. + 2010-09-19 BVK Chaitanya * util/grub-mkconfig.in: Check the config script for syntax errors diff --cc grub-core/Makefile.core.def index b9abac40d,d8ab2935f..757240343 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@@ -1,5 -1,15 +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; diff --cc grub-core/genmod.sh.in index 000000000,a267ca5d7..faac2b605 mode 000000,100644..100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@@ -1,0 -1,73 +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 echo.module ++# 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