blob: 2ad23f9594a6e2f1dde5bff790555ee25850b144 [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
Eric Andersena68b21a2001-01-26 20:31:02 +00004# input $1: full path to Config.h
5# input $2: full path to applets.h
6# output (stdout): list of pathnames that should be linked to busybox
7
8# Maintainer: Larry Doolittle <ldoolitt@recycle.lbl.gov>
9
Eric Andersen39eea892001-03-08 21:42:11 +000010export LC_ALL=POSIX
11export LC_CTYPE=POSIX
12
Rob Landleya930bd32005-12-16 06:12:46 +000013CONFIG_H=${1:-include/bb_config.h}
Eric Andersen3cd27602001-10-24 07:58:02 +000014APPLETS_H=${2:-include/applets.h}
Bernhard Reutner-Fischerf00680e2005-12-29 16:53:47 +000015$HOSTCC -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
Eric Andersen868c0572000-12-02 00:44:48 +000016 awk '/^[ \t]*LINK/{
Eric Andersena68b21a2001-01-26 20:31:02 +000017 dir=substr($2,8)
Eric Andersen868c0572000-12-02 00:44:48 +000018 gsub("_","/",dir)
19 if(dir=="/ROOT") dir=""
20 file=$3
21 gsub("\"","",file)
22 if (file=="busybox") next
23 print tolower(dir) "/" file
24 }'