# Make our prerequisites.
-make busybox.links include/bb_config.h
+make busybox.links include/bb_config.h $(pwd)/{libbb/libbb.a,archival/libunarchive/libunarchive.a,coreutils/libcoreutils/libcoreutils.a,networking/libiproute/libiproute.a}
-# 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 ..
-
-# Same problem.
-
-cd archival/libunarchive
-make
-cd ../..
-
-# And again
-
-cd coreutils/libcoreutils
-make
-cd ../..
-
-# Sensing a pattern here?
+else
+# Could very well be that we want to build an individual applet but have no
+# 'build' dir yet..
-#cd networking/libiproute
-#make
-#cd ../..
+test -d ./build || mkdir build
fi
gcc -Os -o build/$APPLET applets/individual.c $j \
`extra_libraries $APPFILT` libbb/libbb.a -Iinclude \
-DBUILD_INDIVIDUAL \
- '-Drun_applet_by_name(...)' '-Dfind_applet_by_name(...)=0' \
+ '-Drun_applet_and_exit(...)' '-Dfind_applet_by_name(...)=0' \
-DAPPLET_main=${APPFILT}_main -DAPPLET_full_usage=${HELPNAME}
if [ $? -ne 0 ];
then