diff options
-rw-r--r-- | applets/individual.c | 26 | ||||
-rwxr-xr-x | scripts/individual | 37 |
2 files changed, 63 insertions, 0 deletions
diff --git a/applets/individual.c b/applets/individual.c new file mode 100644 index 000000000..0af256c6c --- /dev/null +++ b/applets/individual.c | |||
@@ -0,0 +1,26 @@ | |||
1 | /* Minimal wrapper to build an individual busybox applet. | ||
2 | * | ||
3 | * Copyright 2005 Rob Landley <rob@landley.net | ||
4 | * | ||
5 | * Licensed under GPLv2 or later, see file License in this tarball for details | ||
6 | */ | ||
7 | |||
8 | const char *bb_applet_name; | ||
9 | |||
10 | #include <stdio.h> | ||
11 | #include <stdlib.h> | ||
12 | #include "usage.h" | ||
13 | |||
14 | int main(int argc, char *argv[]) | ||
15 | { | ||
16 | bb_applet_name=argv[0]; | ||
17 | |||
18 | return APPLET_main(argc,argv); | ||
19 | } | ||
20 | |||
21 | void bb_show_usage(void) | ||
22 | { | ||
23 | printf(APPLET_full_usage "\n"); | ||
24 | |||
25 | exit(1); | ||
26 | } | ||
diff --git a/scripts/individual b/scripts/individual new file mode 100755 index 000000000..a4e433ca8 --- /dev/null +++ b/scripts/individual | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Make our prerequisites. | ||
4 | |||
5 | make busybox.links include/bb_config.h | ||
6 | |||
7 | # Adding "libbb/libbb.a" to the previous line doesn't work, nor does going | ||
8 | # "make libbb.a" in the libb directory. The busybox makefile has layers and | ||
9 | # layers of overcomplicated brokenness... | ||
10 | |||
11 | cd libbb | ||
12 | make | ||
13 | cd .. | ||
14 | |||
15 | # Here are a few that build in a standard way. Others are easy to get to | ||
16 | # build, for example miscutils/dc needs -lm and most of loginutils/* needs | ||
17 | # -lcrypt... | ||
18 | |||
19 | rm -rf build | ||
20 | mkdir build | ||
21 | for APPLET in `sed 's .*/ ' busybox.links` | ||
22 | do | ||
23 | j=`find . -name "$APPLET.c"` | ||
24 | if [ -z "$j" ] | ||
25 | then | ||
26 | echo no file for $APPLET | ||
27 | else | ||
28 | echo "Building $APPLET..." | ||
29 | gcc -Os -o build/$APPLET applets/individual.c $j libbb/libbb.a -Iinclude -DAPPLET_main=${APPLET}_main -DAPPLET_full_usage=${APPLET}_full_usage | ||
30 | if [ $? -ne 0 ]; | ||
31 | then | ||
32 | echo "Failed." | ||
33 | fi | ||
34 | fi | ||
35 | done | ||
36 | |||
37 | strip build/* | ||