diff --git a/.gitignore b/.gitignore index 7a13a41..be0840d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ exceptions/arm11/build *.d *.elf *.cxi +.DS_Store \ No newline at end of file diff --git a/Makefile b/Makefile index 06d4e6e..1d910fa 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,17 @@ endif include $(DEVKITARM)/base_tools +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + sed := gsed + du := gdu +else + sed := sed + du := du +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/-/i') 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.) @@ -145,12 +154,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 $(du) -b $(dir_build)/modules.bin | cut -f1)" $(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