Whamcloud - gitweb
Move the check_plausibility() function from misc to lib/support
[tools/e2fsprogs.git] / util / gen-android-files
1 #!/bin/sh
2
3 ANDROID_GENERATED_FILES="lib/ext2fs/ext2_err.c lib/ext2fs/ext2_err.h \
4         lib/ss/ss_err.c lib/ss/ss_err.h lib/support/prof_err.c \
5         lib/support/prof_err.h \
6         lib/blkid/blkid_types.h lib/uuid/uuid_types.h \
7         lib/ext2fs/ext2_types.h lib/config.h lib/blkid/blkid.h \
8         lib/uuid/uuid.h lib/ext2fs/crc32c_table.h misc/default_profile.c \
9         lib/ss/std_rqs.c debugfs/debug_cmds.c debugfs/ro_debug_cmds.c \
10         debugfs/extent_cmds.c debugfs/e2freefrag.c debugfs/create_inode.c \
11         debugfs/recovery.c debugfs/revoke.c \
12         MODULE_LICENSE_GPL"
13
14 SS_DIR=$(pwd)/lib/ss
15 MK_CMDS=/tmp/mk_cmds$$.sh
16
17 sed -e "s;@SS_DIR@;$SS_DIR;" < $SS_DIR/mk_cmds.sh.in \
18     | sed -e "s/@AWK@/awk/" | sed -e "s/@SED@/sed/" > $MK_CMDS
19
20 sed -e "s/@E2FSPROGS_VERSION@/$(git describe)/" < lib/ext2fs/ext2_err.et.in > lib/ext2fs/ext2_err.et
21
22 for i in lib/ss/ss_err lib/support/prof_err lib/ext2fs/ext2_err
23 do
24    rm -f $i.c $i.h
25    awk -f lib/et/et_c.awk outfile=$i.c outfn=$(basename $i.c) $i.et
26    awk -f lib/et/et_h.awk outfile=$i.h outfn=$(basename $i.h) $i.et
27 done
28
29 for i in lib/ss/std_rqs debugfs/debug_cmds debugfs/ro_debug_cmds \
30                         debugfs/extent_cmds
31 do
32     /bin/sh $MK_CMDS $i.ct
33     mv -f $(basename $i).c $i.c
34 done
35
36 rm -f $MK_CMDS
37
38 cp lib/blkid/blkid.h.in lib/blkid/blkid.h
39 cp lib/uuid/uuid.h.in lib/uuid/uuid.h
40 cp util/android_types.h lib/ext2fs/ext2_types.h
41 cp util/android_types.h lib/blkid/blkid_types.h
42 cp util/android_types.h lib/uuid/uuid_types.h
43 cp util/android_config.h lib/config.h
44 cp misc/e2freefrag.c misc/create_inode.c debugfs/
45 cp e2fsck/recovery.c e2fsck/revoke.c debugfs/
46
47 gcc -o gen_crc32ctable lib/ext2fs/gen_crc32ctable.c
48 ./gen_crc32ctable > lib/ext2fs/crc32c_table.h
49
50 awk -f misc/profile-to-c.awk < misc/mke2fs.conf.in > misc/default_profile.c
51
52 rm -f ./gen_crc32table ./gen_crc32ctable lib/ext2fs/ext2_err.et
53
54 touch MODULE_LICENSE_GPL
55
56 git add -f $ANDROID_GENERATED_FILES
57 if test -f COPYING
58 then
59    git mv COPYING NOTICE
60 fi
61 git commit -m "Update generated files for Android"