Merge pull request #240 from turtleisaac/master

Fixed mac support
This commit is contained in:
PikalaxALT 2023-08-23 20:52:04 -04:00 committed by GitHub
commit 418d7712a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,11 +6,22 @@ default: all
PROJECT_ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ifeq ($(OS),Windows_NT)
REALPATH := realpath
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
REALPATH ?= grealpath
else
REALPATH := realpath
endif
endif
# Because mwldarm expects absolute paths to be WIN32 paths,
# all paths referring up from BUILD_DIR must be relative.
WORK_DIR := $(shell realpath --relative-to $(CURDIR) $(PROJECT_ROOT))
WORK_DIR := $(shell $(REALPATH) --relative-to $(CURDIR) $(PROJECT_ROOT))
$(shell mkdir -p $(BUILD_DIR))
BACK_REL := $(shell realpath --relative-to $(BUILD_DIR) $(CURDIR))
BACK_REL := $(shell $(REALPATH) --relative-to $(BUILD_DIR) $(CURDIR))
# Recursive wildcard function
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))