Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/nesasm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Varenik <38311102+kotleni@users.noreply.github.com>2022-08-08 11:49:17 +0300
committerGitHub <noreply@github.com>2022-08-08 11:49:17 +0300
commit7f7c7bd68a065b5e680075c49b6b541271462a1f (patch)
tree4e6a8c6b5aefc9c2cd2aefaa4ebfe821501a313c
parent60f30143daa40677d6ab5560a44672f31b8ec426 (diff)
Added building support on arm macOS
Arm version of brew tool use custom directory for libs/includes files. Tested on M1
-rw-r--r--source/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/Makefile b/source/Makefile
index aad42c4..289994d 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -8,6 +8,21 @@ COMMIT :=
COMMIT_INFO = commit.h
EXTRA_CFLAGS ?= -O2 -Wall -Wno-restrict -Wno-unknown-warning-option
+
+IS_MACARM := 0
+
+# build on macos(arm) support
+ifneq ($(OS),Windows_NT)
+ UNAME_S := $(shell uname -s)
+ ifeq ($(UNAME_S),Darwin)
+ UNAME_P := $(shell uname -p)
+ ifneq ($(filter arm%,$(UNAME_P)),)
+ EXTRA_CFLAGS += -I$(shell brew --prefix)/include
+ IS_MACARM = 1
+ endif
+ endif
+endif
+
CFLAGS += ${EXTRA_CFLAGS} -I.
EXEDIR ?= ..
@@ -33,6 +48,11 @@ else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -largp
+
+ # build on macos(arm) support
+ ifeq ($(IS_MACARM), 1)
+ LDFLAGS += -L$(shell brew --prefix)/lib
+ endif
endif
endif