+ PREFIX = `pwd`/_install
+endif
+
+# Additional complications due to support for pristine source dir.
+# Include files in the build directory should take precedence over
+# the copy in BB_SRC_DIR, both during the compilation phase and the
+# shell script that finds the list of object files.
+# Work in progress by <ldoolitt@recycle.lbl.gov>.
+#
+ifneq ($(strip $(BB_SRC_DIR)),)
+ VPATH = $(BB_SRC_DIR)
+endif
+#ifneq ($(strip $(VPATH)),)
+# CFLAGS += -I- -I. $(patsubst %,-I%,$(subst :, ,$(VPATH)))
+#endif
+
+# We need to set APPLET_SOURCES to something like
+# $(shell busybox.sh Config.h)
+# but in a manner that works with VPATH and BB_SRC_DIR.
+# Possible ways to approach this:
+#
+# 1. Explicitly search through .:$(VPATH) for busybox.sh and config.h,
+# then $(shell $(BUSYBOX_SH) $(CONFIG_H) $(BB_SRC_DIR))
+#
+# 2. Explicity search through .:$(VPATH) for slist.mk,
+# then $(shell $(MAKE) -f $(SLIST_MK) VPATH=$(VPATH) BB_SRC_DIR=$(BB_SRC_DIR))
+#
+# 3. Create slist.mk in this directory, with commands embedded in
+# a $(shell ...) command, and $(MAKE) it immediately.
+#
+# 4. Use a real rule within this makefile to create a file that sets
+# APPLET_SOURCE_LIST, then include that file. Has complications
+# with the first trip through the makefile (before processing the
+# include) trying to do too much, and a spurious warning the first
+# time make is run.
+#
+# This is option 3:
+#
+#APPLET_SOURCES = $(shell \
+# echo -e 'all: busybox.sh Config.h\n\t@ $$(SHELL) $$^ $$(BB_SRC_DIR)' >slist.mk; \
+# make -f slist.mk VPATH=$(VPATH) BB_SRC_DIR=$(BB_SRC_DIR) \
+#)
+# And option 4:
+-include applet_source_list
+
+OBJECTS = $(APPLET_SOURCES:.c=.o) busybox.o messages.o usage.o applets.o
+CFLAGS += $(CROSS_CFLAGS)
+CFLAGS += -DBB_VER='"$(VERSION)"'
+CFLAGS += -DBB_BT='"$(BUILDTIME)"'
+ifdef BB_INIT_SCRIPT
+ CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
+endif
+
+ifneq ($(strip $(USE_SYSTEM_PWD_GRP)),true)
+ PWD_GRP = pwd_grp
+ PWD_GRP_DIR = $(BB_SRC_DIR:=/)$(PWD_GRP)
+ PWD_LIB = libpwd.a
+ PWD_CSRC=__getpwent.c pwent.c getpwnam.c getpwuid.c putpwent.c getpw.c \
+ fgetpwent.c __getgrent.c grent.c getgrnam.c getgrgid.c fgetgrent.c \
+ initgroups.c setgroups.c
+ PWD_OBJS=$(patsubst %.c,$(PWD_GRP)/%.o, $(PWD_CSRC))
+ PWD_CFLAGS = -I$(PWD_GRP_DIR)
+else
+ CFLAGS += -DUSE_SYSTEM_PWD_GRP