aboutsummaryrefslogtreecommitdiff
path: root/scripts/individual
blob: a4e433ca837be3d58907019ed902f0ba5839a5f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

# Make our prerequisites.

make busybox.links include/bb_config.h

# Adding "libbb/libbb.a" to the previous line doesn't work, nor does going
# "make libbb.a" in the libb directory.  The busybox makefile has layers and
# layers of overcomplicated brokenness...

cd libbb
make
cd ..

# Here are a few that build in a standard way.  Others are easy to get to
# build, for example miscutils/dc needs -lm and most of loginutils/* needs
# -lcrypt...

rm -rf build
mkdir build
for APPLET in `sed 's .*/  ' busybox.links`
do
  j=`find . -name "$APPLET.c"`
  if [ -z "$j" ]
  then
    echo no file for $APPLET
  else
    echo "Building $APPLET..."
    gcc -Os -o build/$APPLET applets/individual.c $j libbb/libbb.a -Iinclude -DAPPLET_main=${APPLET}_main -DAPPLET_full_usage=${APPLET}_full_usage
    if [ $? -ne 0 ];
    then
      echo "Failed."
    fi
  fi
done

strip build/*