blob: c0a819bf9e942e6e2ef14ecfa6dac08ad3e26891 [file] [log] [blame]
include $(COMMON_BASE_MK)
NAME=busybox
SRC_DIR=$(APP_DIR)/$(NAME)/src
INSTALL_DIR=$(APP_DIR)/$(NAME)/install
BUILD_DIR=$(APP_DIR)/$(NAME)/build
GEN_MAKEFILE=$(BUILD_DIR)/Makefile
INSTALLER=$(SRC_DIR)/install-romfs.sh
TARGETDIR=$(ROOTFS_DIR)
all: $(GEN_MAKEFILE)
make -C $(SRC_DIR) O=$(BUILD_DIR) all
cp -v $(BUILD_DIR)/busybox_unstripped $(BUILD_DIR)/busybox_unstripped.elf
$(GEN_MAKEFILE):
mkdir -p $(BUILD_DIR)
make -C $(SRC_DIR) O=$(BUILD_DIR) zte_defconfig
clean:
-rm -fr $(BUILD_DIR) $(INSTALL_DIR)
$(BUILD_DIR)/busybox.links:
make -C $(SRC_DIR) O=$(BUILD_DIR) busybox.links
# Before copying, remove all existing busybox links
romfs: $(INSTALLER) $(BUILD_DIR)/busybox.links
mkdir -p $(TARGETDIR)/bin $(TARGETDIR)/etc
if [ -f "$(TARGETDIR)/bin/busybox" ]; then \
inode=`ls -i $(TARGETDIR)/bin/busybox | awk '{print $$1}'`; \
ls -iL "$(TARGETDIR)/bin" | grep "^ *$$inode" | awk '{print $$2}' | \
sed "s:^:$(TARGETDIR)/bin/:" | env -i xargs rm -f; \
fi
$(ROMFSINST) $(BUILD_DIR)/busybox /bin/busybox
bash $(INSTALLER) $(TARGETDIR) $(BUILD_DIR)/busybox.links