Some corrections, some additions, some embellishments.
[oweals/busybox.git] / busybox.mkll
1 #!/bin/sh
2 # Make busybox links list file.
3
4 CONFIG_H=${1:-Config.h}
5 APPLETS_H=${2:-applets.h}
6 gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
7   awk '/^[ \t]*LINK/{
8         match($2,"_BB_DIR[A-Z_]*")
9         dir=substr($2,RSTART+7,RLENGTH-7)
10         gsub("_","/",dir)
11         if(dir=="/ROOT") dir=""
12         file=$3
13         gsub("\"","",file)
14         if (file=="busybox") next
15         print tolower(dir) "/" file
16   }'