diff --git a/.gitignore b/.gitignore index 7f6a571b..d327a9f7 100755 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ m2cfiles/ dkr_hot_reload.py lastRomPath.txt gcc_safe_files.mk +*.DS_Store diff --git a/Makefile b/Makefile index 53ebf55d..d6606c87 100755 --- a/Makefile +++ b/Makefile @@ -184,7 +184,16 @@ LIB_DIRS := lib ASM_DIRS := asm asm/boot asm/assets lib/asm lib/asm/non_decompilable SRC_DIRS := $(sort $(patsubst %/,%,$(dir $(wildcard src/* src/**/* lib/src/* lib/src/**/* lib/src/**/**/*)))) -GLOBAL_ASM_C_FILES != grep -rl 'GLOBAL_ASM(' $(SRC_DIRS) +OS := $(shell uname) + +# MacOS has a slightly different name for grep, so check to see if it needs to be used. +ifeq ($(OS), Darwin) + GREP_FILE := ggrep +else + GREP_FILE := grep +endif + +GLOBAL_ASM_C_FILES != $(GREP_FILE) -rl 'GLOBAL_ASM(' $(SRC_DIRS) GLOBAL_ASM_O_FILES = $(foreach file,$(GLOBAL_ASM_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s)) diff --git a/tools/Makefile b/tools/Makefile index 6bcc6b04..2888d02c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -5,10 +5,20 @@ CXX := g++ CFLAGS := -I . -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 $(OPT) -s # List of specific errors to ignore IGNORE_W_ERRORS := -Wno-unused-parameter -Wno-misleading-indentation -Wno-extra -CXXFLAGS := -I . -I dkr_assets_tool_src/ -Werror -Wall $(IGNORE_W_ERRORS) -std=c++17 $(OPT) -lpcre2-8 +CXXFLAGS := -I . -I dkr_assets_tool_src/ -std=c++17 $(OPT) LDFLAGS := -lm PROGRAMS := n64crc dkr_assets_tool +OS := $(shell uname) + +# MacOS has a slightly different name for grep, so check to see if it needs to be used. +ifeq ($(OS), Darwin) + CXXFLAGS += -I/opt/homebrew/include + LDFLAGS += -I/opt/homebrew/lib -lpcre2-8 +else + CXXFLAGS += -Werror -Wall $(IGNORE_W_ERRORS) -lpcre2-8 +endif + BUILD_DIR := dkr_assets_tool_src/_build ENUMS_HEADER := ../include/enums.h diff --git a/tools/dkr_assets_tool_src/helpers/fileHelper.h b/tools/dkr_assets_tool_src/helpers/fileHelper.h index 142b4bfd..66654099 100644 --- a/tools/dkr_assets_tool_src/helpers/fileHelper.h +++ b/tools/dkr_assets_tool_src/helpers/fileHelper.h @@ -14,7 +14,7 @@ namespace fs = std::filesystem; // Using path as a key doesn't seem to work on raspberry pi OS? struct PathHash { - std::size_t operator()(const std::filesystem::__cxx11::path& p) const { + std::size_t operator()(const std::filesystem::path& p) const { return std::filesystem::hash_value(p); } };