Skip to content

Commit

Permalink
Update Makefile to build on Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
amalchuk committed Oct 16, 2024
1 parent cb2c346 commit 5e73cbe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ else ifeq ($(YQ2_OSTYPE),OpenBSD)
INCLUDE ?= -I/usr/local/include
else ifeq ($(YQ2_OSTYPE),Windows)
INCLUDE ?= -I/usr/include
else ifeq ($(YQ2_OSTYPE),Darwin)
INCLUDE ?= -I/usr/local/include -I/opt/homebrew/include
endif

# ----------
Expand All @@ -300,6 +302,8 @@ else ifeq ($(YQ2_OSTYPE),OpenBSD)
LDFLAGS ?= -L/usr/local/lib
else ifeq ($(YQ2_OSTYPE),Windows)
LDFLAGS ?= -L/usr/lib
else ifeq ($(YQ2_OSTYPE),Darwin)
LDFLAGS ?= -L/usr/local/lib -L/opt/homebrew/lib
endif

# Link address sanitizer if requested.
Expand Down Expand Up @@ -409,7 +413,17 @@ ref_gl4:
release/ref_gl4.dll : GLAD_INCLUDE = -Isrc/client/refresh/gl4/glad/include
release/ref_gl4.dll : LDFLAGS += -shared

else # not Windows or Darwin - macOS doesn't support OpenGL 4.6
else ifeq ($(YQ2_OSTYPE), Darwin)

ref_gl4:
@echo "===> Building ref_gl4.dylib"
${Q}mkdir -p release
$(MAKE) release/ref_gl4.dylib

release/ref_gl4.dylib : GLAD_INCLUDE = -Isrc/client/refresh/gl4/glad/include
release/ref_gl4.dylib : LDFLAGS += -shared

else # not Windows or Darwin

ref_gl4:
@echo "===> Building ref_gl4.so"
Expand Down Expand Up @@ -485,6 +499,11 @@ release/ref_gl4.dll : $(REFGL4_OBJS)
${Q}$(CC) $(LDFLAGS) $(REFGL4_OBJS) $(LDLIBS) $(DLL_SDLLDFLAGS) -o $@
$(Q)strip $@

else ifeq ($(YQ2_OSTYPE), Darwin)
release/ref_gl4.dylib : $(REFGL4_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(LDFLAGS) $(REFGL4_OBJS) $(LDLIBS) $(SDLLDFLAGS) -o $@

else
release/ref_gl4.so : $(REFGL4_OBJS)
@echo "===> LD $@"
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Type `make` to compile the library. If the compilation is successfull,
the library can be found under *release/ref_gl4.dll* (Windows) or
*release/ref_gl4.so* (unixoid systems).

## Supported platforms

* FreeBSD
* Linux
* NetBSD
* OpenBSD
* Windows

## Usage

Copy the library next to your Yamagi Quake II executable. You can select
Expand Down

0 comments on commit 5e73cbe

Please sign in to comment.