mirror of
https://github.com/yquake2/zaero.git
synced 2024-11-22 03:51:13 +00:00
Merge pull request #28 from devnexen/build_macos_arm_fix
Forcing proper native arch build on darwin mainly due to arm64.
This commit is contained in:
commit
a91b12a4af
1 changed files with 20 additions and 2 deletions
22
Makefile
22
Makefile
|
@ -44,8 +44,12 @@ YQ2_ARCH ?= $(PROCESSOR_ARCHITECTURE)
|
||||||
endif
|
endif
|
||||||
endif # windows but MINGW_CHOST not defined
|
endif # windows but MINGW_CHOST not defined
|
||||||
else
|
else
|
||||||
|
ifneq ($(YQ2_OSTYPE), Darwin)
|
||||||
# Normalize some abiguous YQ2_ARCH strings
|
# Normalize some abiguous YQ2_ARCH strings
|
||||||
YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/^arm.*/arm/')
|
YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/^arm.*/arm/')
|
||||||
|
else
|
||||||
|
YQ2_ARCH ?= $(shell uname -m)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Detect the compiler
|
# Detect the compiler
|
||||||
|
@ -81,7 +85,7 @@ endif
|
||||||
# -MMD to generate header dependencies.
|
# -MMD to generate header dependencies.
|
||||||
ifeq ($(YQ2_OSTYPE), Darwin)
|
ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
|
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
|
||||||
-Wall -pipe -g -fwrapv -arch i386 -arch x86_64
|
-Wall -pipe -g -fwrapv -arch $(YQ2_ARCH)
|
||||||
else
|
else
|
||||||
CFLAGS := -O0 -fno-strict-aliasing -fomit-frame-pointer \
|
CFLAGS := -O0 -fno-strict-aliasing -fomit-frame-pointer \
|
||||||
-Wall -pipe -ggdb -MMD -fwrapv
|
-Wall -pipe -ggdb -MMD -fwrapv
|
||||||
|
@ -122,7 +126,7 @@ CFLAGS += -DYQ2OSTYPE=\"$(YQ2_OSTYPE)\" -DYQ2ARCH=\"$(YQ2_ARCH)\"
|
||||||
|
|
||||||
# Base LDFLAGS.
|
# Base LDFLAGS.
|
||||||
ifeq ($(YQ2_OSTYPE), Darwin)
|
ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
LDFLAGS := -shared -arch i386 -arch x86_64
|
LDFLAGS := -shared -arch $(YQ2_ARCH)
|
||||||
else
|
else
|
||||||
LDFLAGS := -shared
|
LDFLAGS := -shared
|
||||||
endif
|
endif
|
||||||
|
@ -164,6 +168,16 @@ zaero:
|
||||||
${Q}mkdir -p release
|
${Q}mkdir -p release
|
||||||
${MAKE} release/game.dll
|
${MAKE} release/game.dll
|
||||||
|
|
||||||
|
build/%.o: %.c
|
||||||
|
@echo "===> CC $<"
|
||||||
|
${Q}mkdir -p $(@D)
|
||||||
|
${Q}$(CC) -c $(CFLAGS) -o $@ $<
|
||||||
|
else ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
|
zaero:
|
||||||
|
@echo "===> Building game.dylib"
|
||||||
|
${Q}mkdir -p release
|
||||||
|
$(MAKE) release/game.dylib
|
||||||
|
|
||||||
build/%.o: %.c
|
build/%.o: %.c
|
||||||
@echo "===> CC $<"
|
@echo "===> CC $<"
|
||||||
${Q}mkdir -p $(@D)
|
${Q}mkdir -p $(@D)
|
||||||
|
@ -268,6 +282,10 @@ ifeq ($(YQ2_OSTYPE), Windows)
|
||||||
release/game.dll : $(ZAERO_OBJS)
|
release/game.dll : $(ZAERO_OBJS)
|
||||||
@echo "===> LD $@"
|
@echo "===> LD $@"
|
||||||
${Q}$(CC) $(LDFLAGS) -o $@ $(ZAERO_OBJS)
|
${Q}$(CC) $(LDFLAGS) -o $@ $(ZAERO_OBJS)
|
||||||
|
else ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
|
release/game.dylib : $(ZAERO_OBJS)
|
||||||
|
@echo "===> LD $@"
|
||||||
|
${Q}$(CC) $(LDFLAGS) -o $@ $(ZAERO_OBJS)
|
||||||
else
|
else
|
||||||
release/game.so : $(ZAERO_OBJS)
|
release/game.so : $(ZAERO_OBJS)
|
||||||
@echo "===> LD $@"
|
@echo "===> LD $@"
|
||||||
|
|
Loading…
Reference in a new issue