SOURCE=busybox-1.22.1

.PHONY: all clean distclean openSource install
all: openSource
clean:
	make -C $(SOURCE) clean

distclean:
	make -C $(SOURCE) distclean
	rm -f $(SOURCE)/.config

openSource: $(SOURCE)/.config
	make -C $(SOURCE) CROSS_COMPILE=$(PJ_TARGET)- ARCH=$(PJ_ARCH) 

$(SOURCE)/.config: $(SOURCE)/busy_box.config
	[ "$$PJ_PREFIX" != "" ]
	[ "$$PJ_TARGET" != "" ]
	cp $(SOURCE)/busy_box.config $(SOURCE)/.config
	make -C $(SOURCE) oldconfig



install: $(SOURCE)/.config
	make -C $(SOURCE) CONFIG_PREFIX=$(PJ_PREFIX) CROSS_COMPILE=$(PJ_TARGET)- ARCH=$(PJ_ARCH)  install
