blob: c650febd6714088d0d6e74763db8794222c9fda5 [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001#!/bin/sh
Erik Andersenfac10d72000-02-07 05:29:42 +00002# Make busybox links list file.
Eric Andersencc8ed391999-10-05 16:24:54 +00003
4DF="busybox.def.h"
Eric Andersen17d49ef1999-10-06 20:25:32 +00005MF="busybox.c"
Eric Andersencc8ed391999-10-05 16:24:54 +00006
Erik Andersen7a4b7192000-04-06 07:37:35 +00007LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/BB_\1/gp;' | sort)"
Eric Andersencc8ed391999-10-05 16:24:54 +00008
Eric Andersen17d49ef1999-10-06 20:25:32 +00009for def in ${LIST}; do
Erik Andersend75af992000-03-16 08:09:09 +000010 i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF`
11 for j in $i; do
12 if [ -z $j ] ; then
13 continue;
14 fi;
15 echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
16 -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
17 -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
18 done;
Eric Andersen17d49ef1999-10-06 20:25:32 +000019done