diff options
-rw-r--r-- | mk/vars.mk | 2 | ||||
-rw-r--r-- | target/cris/Makefile | 2 | ||||
-rw-r--r-- | target/mipsel/Makefile | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/mk/vars.mk b/mk/vars.mk index 39c35e52a..e50710f7d 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -155,6 +155,8 @@ else RSTRIP:= prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh endif +STATCMD:=$(shell if stat -qs .>/dev/null 2>&1; then echo 'stat -f %z';else echo 'stat -c %s';fi) + EXTRACT_CMD= mkdir -p ${WRKDIR}; \ cd ${WRKDIR} && \ for file in ${FULLDISTFILES}; do case $$file in \ diff --git a/target/cris/Makefile b/target/cris/Makefile index 80ec16d6a..9255cede9 100644 --- a/target/cris/Makefile +++ b/target/cris/Makefile @@ -24,7 +24,7 @@ ifeq ($(ADK_TARGET_FS),squashfs) imageinstall: kernel-install $(BUILD_DIR)/$(ROOTFSSQUASHFS) dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ bs=4063232 conv=sync $(MAKE_TRACE) - @if [ $$(stat --format=%s ${BIN_DIR}/${ROOTFSSQUASHFS}) -gt 4063232 ];then \ + @if [ $$($(STATCMD) ${BIN_DIR}/${ROOTFSSQUASHFS}) -gt 4063232 ];then \ echo 'Image is too big!'; \ else \ echo 'Use sudo ./boot_linux -F -i $(ROOTFSSQUASHFS) to flash'; \ diff --git a/target/mipsel/Makefile b/target/mipsel/Makefile index 0caacc1db..f04709bb0 100644 --- a/target/mipsel/Makefile +++ b/target/mipsel/Makefile @@ -60,7 +60,7 @@ imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSUSERTARBALL) endif ifeq ($(ADK_TARGET_FS),squashfs) imageinstall: kernel-install ${BUILD_DIR}/${ROOTFSSQUASHFS} - @if [ $$(stat -f %z ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 3801088 ];then \ + @if [ $$($(STATCMD) ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 3801088 ];then \ echo 'Image is too big!'; \ else \ ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} ${BIN_DIR}/${ROOTFSSQUASHFS}; \ |