e2fsprogs/util/gen-android-files
Theodore Ts'o 99ceb8ec1a Move the check_plausibility() function from misc to lib/support
The check_plausibility() function is now used all over the place, so
we should move the plausible.c file to lib/support and remove the
special case handling for that file that had been in the build system.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:01:17 -04:00

62 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
ANDROID_GENERATED_FILES="lib/ext2fs/ext2_err.c lib/ext2fs/ext2_err.h \
lib/ss/ss_err.c lib/ss/ss_err.h lib/support/prof_err.c \
lib/support/prof_err.h \
lib/blkid/blkid_types.h lib/uuid/uuid_types.h \
lib/ext2fs/ext2_types.h lib/config.h lib/blkid/blkid.h \
lib/uuid/uuid.h lib/ext2fs/crc32c_table.h misc/default_profile.c \
lib/ss/std_rqs.c debugfs/debug_cmds.c debugfs/ro_debug_cmds.c \
debugfs/extent_cmds.c debugfs/e2freefrag.c debugfs/create_inode.c \
debugfs/recovery.c debugfs/revoke.c \
MODULE_LICENSE_GPL"
SS_DIR=$(pwd)/lib/ss
MK_CMDS=/tmp/mk_cmds$$.sh
sed -e "s;@SS_DIR@;$SS_DIR;" < $SS_DIR/mk_cmds.sh.in \
| sed -e "s/@AWK@/awk/" | sed -e "s/@SED@/sed/" > $MK_CMDS
sed -e "s/@E2FSPROGS_VERSION@/$(git describe)/" < lib/ext2fs/ext2_err.et.in > lib/ext2fs/ext2_err.et
for i in lib/ss/ss_err lib/support/prof_err lib/ext2fs/ext2_err
do
rm -f $i.c $i.h
awk -f lib/et/et_c.awk outfile=$i.c outfn=$(basename $i.c) $i.et
awk -f lib/et/et_h.awk outfile=$i.h outfn=$(basename $i.h) $i.et
done
for i in lib/ss/std_rqs debugfs/debug_cmds debugfs/ro_debug_cmds \
debugfs/extent_cmds
do
/bin/sh $MK_CMDS $i.ct
mv -f $(basename $i).c $i.c
done
rm -f $MK_CMDS
cp lib/blkid/blkid.h.in lib/blkid/blkid.h
cp lib/uuid/uuid.h.in lib/uuid/uuid.h
cp util/android_types.h lib/ext2fs/ext2_types.h
cp util/android_types.h lib/blkid/blkid_types.h
cp util/android_types.h lib/uuid/uuid_types.h
cp util/android_config.h lib/config.h
cp misc/e2freefrag.c misc/create_inode.c debugfs/
cp e2fsck/recovery.c e2fsck/revoke.c debugfs/
gcc -o gen_crc32ctable lib/ext2fs/gen_crc32ctable.c
./gen_crc32ctable > lib/ext2fs/crc32c_table.h
awk -f misc/profile-to-c.awk < misc/mke2fs.conf.in > misc/default_profile.c
rm -f ./gen_crc32table ./gen_crc32ctable lib/ext2fs/ext2_err.et
touch MODULE_LICENSE_GPL
git add -f $ANDROID_GENERATED_FILES
if test -f COPYING
then
git mv COPYING NOTICE
fi
git commit -m "Update generated files for Android"