Fix makefile to work on 64 bit macOS, and split up into 32 and 64 bit mac targets

This commit is contained in:
UnknownShadow200 2021-11-14 18:59:39 +11:00
parent d0d008af48
commit ff90c8028b

View File

@ -13,6 +13,14 @@ ifndef $(PLAT)
else else
PLAT=$(shell uname -s | tr '[:upper:]' '[:lower:]') PLAT=$(shell uname -s | tr '[:upper:]' '[:lower:]')
endif endif
ifeq ($(PLAT),darwin)
ifeq ($(shell uname -m), x86_64)
PLAT=mac_x64
else
PLAT=mac_x32
endif
endif
endif endif
ifeq ($(PLAT),web) ifeq ($(PLAT),web)
@ -40,11 +48,19 @@ CFLAGS=-g -pipe -fno-math-errno
LIBS=-lm -lsocket -lX11 -lXi -lGL LIBS=-lm -lsocket -lX11 -lXi -lGL
endif endif
ifeq ($(PLAT),darwin) ifeq ($(PLAT),mac_x32)
LIBS= LIBS=
CFLAGS=-g -m32 -pipe -fno-math-errno
LDFLAGS=-rdynamic -framework Carbon -framework AGL -framework OpenGL -framework IOKit LDFLAGS=-rdynamic -framework Carbon -framework AGL -framework OpenGL -framework IOKit
endif endif
ifeq ($(PLAT),mac_x64)
SOURCES+=interop_cocoa.m
CFLAGS=-g -m64 -pipe -fno-math-errno
LIBS=
LDFLAGS=-rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
endif
ifeq ($(PLAT),freebsd) ifeq ($(PLAT),freebsd)
CFLAGS=-g -pipe -I /usr/local/include -fno-math-errno CFLAGS=-g -pipe -I /usr/local/include -fno-math-errno
LDFLAGS=-L /usr/local/lib -rdynamic LDFLAGS=-L /usr/local/lib -rdynamic
@ -89,8 +105,10 @@ mingw:
$(MAKE) $(ENAME) PLAT=mingw -j$(JOBS) $(MAKE) $(ENAME) PLAT=mingw -j$(JOBS)
sunos: sunos:
$(MAKE) $(ENAME) PLAT=sunos -j$(JOBS) $(MAKE) $(ENAME) PLAT=sunos -j$(JOBS)
darwin: mac_x32:
$(MAKE) $(ENAME) PLAT=darwin -j$(JOBS) $(MAKE) $(ENAME) PLAT=mac_x32 -j$(JOBS)
mac_x64:
$(MAKE) $(ENAME) PLAT=mac_x64 -j$(JOBS)
freebsd: freebsd:
$(MAKE) $(ENAME) PLAT=freebsd -j$(JOBS) $(MAKE) $(ENAME) PLAT=freebsd -j$(JOBS)
openbsd: openbsd: