Update Makefile

This commit is contained in:
negativeExponent 2020-10-14 23:37:10 +08:00
parent 12c75b6f1a
commit 61855e585e

View File

@ -6,31 +6,23 @@ CORE_DIR := .
ifeq ($(platform),) ifeq ($(platform),)
platform = unix platform = unix
ifeq ($(shell uname -a),) ifeq ($(shell uname -s),)
platform = win platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),) else ifneq ($(findstring Darwin,$(shell uname -s)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx platform = osx
else ifneq ($(findstring win,$(shell uname -a)),) arch = intel
platform = win
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
ifeq ($(shell uname -p),powerpc) ifeq ($(shell uname -p),powerpc)
arch = ppc arch = ppc
else
arch = intel
endif endif
else ifneq ($(findstring MINGW,$(shell uname -a)),) else ifneq ($(findstring MINGW,$(shell uname -s)),)
system_platform = win platform = win
endif
else ifneq (,$(findstring armv,$(platform)))
ifeq (,$(findstring classic_,$(platform)))
override platform += unix
endif
else ifneq (,$(findstring rpi,$(platform)))
override platform += unix
endif endif
core = lynx core = lynx
@ -60,12 +52,31 @@ filter_out2 = $(call filter_out1,$(call filter_out1,$1))
unixpath = $(subst \,/,$1) unixpath = $(subst \,/,$1)
unixcygpath = /$(subst :,,$(call unixpath,$1)) unixcygpath = /$(subst :,,$(call unixpath,$1))
ifeq ($(platform), unix) ifneq (,$(findstring unix,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
ifneq ($(shell uname -p | grep -E '((i.|x)86|amd64)'),) ifneq (,$(findstring Haiku,$(shell uname -s)))
IS_X86 = 1 LDFLAGS += -lroot
CXXFLAGS += -fpermissive
else
LDFLAGS += -lrt
endif
ifneq ($(findstring Linux,$(shell uname -s)),)
HAVE_CDROM = 1
endif
# Raspberry Pi
ifneq (,$(findstring rpi,$(platform)))
FLAGS += -fomit-frame-pointer -ffast-math
ifneq (,$(findstring rpi1,$(platform)))
FLAGS += -DARM -marm -march=armv6j -mfpu=vfp -mfloat-abi=hard
else ifneq (,$(findstring rpi2,$(platform)))
FLAGS += -DARM -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
else ifneq (,$(findstring rpi3,$(platform)))
FLAGS += -DARM -marm -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
endif
endif endif
FLAGS += -DHAVE_MKDIR FLAGS += -DHAVE_MKDIR
else ifeq ($(platform), osx) else ifeq ($(platform), osx)