diff --git a/Makefile b/Makefile index 9f6139e..0442dfd 100644 --- a/Makefile +++ b/Makefile @@ -12,15 +12,13 @@ include $(DEVKITARM)/base_tools UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) - sed := gsed - du := gdu + size := stat -f%z else - sed := sed - du := du + size := stat -c%s endif name := Luma3DS -revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | $(sed) 's/-[0-9]*-g/-/i') +revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/') version_major := $(shell git describe --tags --match v[0-9]* | cut -c2- | cut -f1 -d- | cut -f1 -d.) version_minor := $(shell git describe --tags --match v[0-9]* | cut -c2- | cut -f1 -d- | cut -f2 -d.) version_build := $(shell git describe --tags --match v[0-9]* | cut -c2- | cut -f1 -d- | cut -f3 -d.) @@ -154,12 +152,12 @@ $(dir_build)/config.o: CFLAGS += -DCONFIG_TITLE="\"$(name) $(revision) configura $(dir_build)/patches.o: CFLAGS += -DVERSION_MAJOR="$(version_major)" -DVERSION_MINOR="$(version_minor)"\ -DVERSION_BUILD="$(version_build)" -DISRELEASE="$(is_release)" -DCOMMIT_HASH="0x$(commit)" $(dir_build)/firm.o: $(dir_build)/modules.bin -$(dir_build)/firm.o: CFLAGS += -DLUMA_SECTION0_SIZE="$(shell $(du) -b $(dir_build)/modules.bin | cut -f1)" +$(dir_build)/firm.o: CFLAGS += -DLUMA_SECTION0_SIZE="$(shell $(size) $(dir_build)/modules.bin)" $(dir_build)/bundled.h: $(bundled) @$(foreach f, $(bundled),\ - echo "extern const u8" `(echo $(basename $(notdir $(f))) | $(sed) -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> $@;\ - echo "extern const u32" `(echo $(basename $(notdir $(f)))| $(sed) -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> $@;\ + echo "extern const u8" `(echo $(basename $(notdir $(f))) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> $@;\ + echo "extern const u32" `(echo $(basename $(notdir $(f)))| sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> $@;\ ) $(dir_build)/%.o: $(dir_source)/%.c $(dir_build)/bundled.h