More pristine source directory updates. It now works
[oweals/busybox.git] / applets / busybox.mkll
1 #!/bin/sh
2 # Make busybox links list file.
3
4 DF="Config.h"
5
6 MF=$1
7 if [ "$MF" = "" ]; then
8     MF="applets.h"
9 fi
10
11 LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/BB_\1/gp;' | sort)"
12
13 for def in ${LIST}; do
14         i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF`
15         for j in $i; do 
16                 if [ -z $j ] ; then 
17                         continue;
18                 fi;
19                 echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
20                     -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
21                     -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
22         done;
23 done