Generate Makefile.*.am directly from gentpl.py, eliminating the use of Autogen. The Autogen definitions files remain intact as they offer a useful abstraction.

This commit is contained in:
Colin Watson 2013-11-13 12:42:24 +00:00
parent 1e4b358720
commit ab4f15013a
7 changed files with 575 additions and 401 deletions

1
.gitignore vendored
View File

@ -159,7 +159,6 @@ GPATH
GRTAGS
GSYMS
GTAGS
Makefile.tpl
compile
depcomp
mdate-sh

View File

@ -1,3 +1,9 @@
2013-11-26 Colin Watson <cjwatson@ubuntu.com>
Generate Makefile.*.am directly from gentpl.py, eliminating the use
of Autogen. The Autogen definitions files remain intact as they
offer a useful abstraction.
2013-11-26 Vladimir Serbinenko <phcoder@gmail.com>
Add PCI command activation to all PCI drivers as required for coreboot

View File

@ -55,7 +55,6 @@ need the following.
* Python 2.5.2 or later
* Autoconf 2.60 or later
* Automake 1.10.1 or later
* Autogen 5.10 or later
Prerequisites for make-check:

View File

@ -8,8 +8,6 @@ unset LC_ALL
find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
autogen --version >/dev/null || exit 1
echo "Importing unicode..."
python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
@ -32,10 +30,7 @@ for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul
ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
done
echo "Creating Makefile.tpl..."
python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
echo "Running autogen..."
echo "Generating Automake input..."
# Automake doesn't like including files from a path outside the project.
rm -f contrib grub-core/contrib
@ -59,8 +54,8 @@ for extra in contrib/*/Makefile.core.def; do
fi
done
cat $UTIL_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am
cat $CORE_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am
python gentpl.py $UTIL_DEFS > Makefile.util.am
python gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
for extra in contrib/*/Makefile.common; do
if test -e "$extra"; then

View File

@ -131,20 +131,15 @@ EXTRA_DIST =
CLEANFILES =
BUILT_SOURCES =
# Rules for autogen definition files
.PRECIOUS: $(top_srcdir)/Makefile.tpl
$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@
# Rules for Automake input
.PRECIOUS: $(top_srcdir)/Makefile.util.am
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def $(top_srcdir)/Makefile.tpl
cat $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def
python $^ > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def
if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
cat $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
python $^ > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@

View File

@ -2,7 +2,6 @@ EXTRA_DIST += autogen.sh
EXTRA_DIST += geninit.sh
EXTRA_DIST += gentpl.py
EXTRA_DIST += Makefile.tpl
EXTRA_DIST += Makefile.util.def
EXTRA_DIST += Makefile.utilgcry.def

941
gentpl.py

File diff suppressed because it is too large Load Diff