summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7c50323..9689dae 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,11 @@ CFLAGS := -Wall -Wextra -O2 $(INCLUDES)
LDFLAGS := -lglfw
# Detect OS
-UNAME_S := $(shell uname -s)
+ifeq ($(OS),Windows_NT)
+ DETECTED_OS := Windows
+else
+ DETECTED_OS := $(shell uname -s)
+endif
# Directories
SRC_DIR := src
@@ -18,6 +22,11 @@ EXAMPLES_DIR := examples
SRCS := $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/**/*.c)
OBJS := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRCS))
+# Add Metal backend written in Objective C only on Mac platform
+ifeq ($(DETECTED_OS),Darwin)
+ SRCS += $(SRC_DIR)/backend_mtl.m
+endif
+
# Library outputs
STATIC_LIB := $(BUILD_DIR)/libceleritas.a
ifeq ($(UNAME_S),Darwin)