mirror of
https://github.com/libretro/bsnes-libretro.git
synced 2024-11-27 02:50:32 +00:00
5d29700fa1
byuu says: Changelog: - nall/GNUmakefile: added `openmp=(true,false)` option; can be toggled when building higan/bsnes - defaults to disabled on macOS, because Xcode doesn't stupidly doesn't ship with support for it - higan/GNUmakefile: forgot to switch target,profile back from bsnes,fast to higan,accurate - this is just gonna happen from time to time, sorry - sfc/dsp: when using the fast profile, the DSP syncs per sample instead of per clock - should only negatively impact Koushien 2, but is a fairly significant speedup otherwise - sfc/ppc,ppu-fast: optimized the code a bit (ppu 130fps to 133fps) - sfc/ppu-fast: basic vertical mosaic support (not accurate, but should look okay hopefully) - sfc/ppu-fast: added missing mode7 hflip support - sfc/ppu-fast: added support to render at 256-width and/or 240-height - gives a decent speed boost, and also allows all of the older quark shaders to work nicely again - it does violate the contract of Emulator::Interface, but oh well, it works fine in the bsnes GUI - sfc/ppu-fast: use cached CGRAM values for mode7 and sprites - sfc/ppu-fast: use global range/time over flags in object rendering - may not actually work as we intended since it's a race condition even if it's only ORing the flags - really don't want to have to make those variables atomic if I don't have to - sfc/ppu-fast: should fully support interlace and overscan modes now - hiro/cocoa: updated macOS Gatekeeper disable support to work on 10.13+ - ruby: forgot to fix macOS input driver, sorry - nall/GNUmakefile: if uname is present, then just default to rm instead of del (fixes Msys) Note: blur emulation option will break pretty badly in 256x240 output mode. I'll fix it later.
191 lines
4.3 KiB
Makefile
191 lines
4.3 KiB
Makefile
# disable built-in rules and variables
|
|
MAKEFLAGS := Rr
|
|
.SUFFIXES:
|
|
|
|
[0-9] = 0 1 2 3 4 5 6 7 8 9
|
|
[A-Z] = A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
|
|
[a-z] = a b c d e f g h i j k l m n o p q r s t u v w x y z
|
|
[markup] = ` ~ ! @ \# $$ % ^ & * ( ) - _ = + [ { ] } \ | ; : ' " , < . > / ?
|
|
[all] = $([0-9]) $([A-Z]) $([a-z]) $([markup])
|
|
[space] :=
|
|
[space] +=
|
|
|
|
# platform detection
|
|
ifeq ($(platform),)
|
|
uname := $(shell uname)
|
|
ifeq ($(uname),)
|
|
platform := windows
|
|
else ifneq ($(findstring Windows,$(uname)),)
|
|
platform := windows
|
|
else ifneq ($(findstring NT,$(uname)),)
|
|
platform := windows
|
|
else ifneq ($(findstring Darwin,$(uname)),)
|
|
platform := macos
|
|
else ifneq ($(findstring Linux,$(uname)),)
|
|
platform := linux
|
|
else ifneq ($(findstring BSD,$(uname)),)
|
|
platform := bsd
|
|
else
|
|
$(error unknown platform, please specify manually.)
|
|
endif
|
|
|
|
# common commands
|
|
ifeq ($(uname),)
|
|
rm = del /q $(subst /,\,$1)
|
|
rmdir = del /s /q $(subst /,\,$1) && if exist $(subst /,\,$1) (rmdir /s /q $(subst /,\,$1))
|
|
else
|
|
rm = rm -f $1
|
|
rmdir = rm -rf $1
|
|
endif
|
|
endif
|
|
|
|
cflags := -x c -std=c11
|
|
objcflags := -x objective-c -std=c11
|
|
cppflags := -x c++ -std=c++14
|
|
objcppflags := -x objective-c++ -std=c++14
|
|
flags :=
|
|
link :=
|
|
|
|
# compiler detection
|
|
ifeq ($(compiler),)
|
|
ifeq ($(platform),windows)
|
|
compiler := g++
|
|
cppflags := -x c++ -std=gnu++14
|
|
else ifeq ($(platform),macos)
|
|
compiler := clang++
|
|
else ifeq ($(platform),linux)
|
|
compiler := g++
|
|
else ifeq ($(platform),bsd)
|
|
compiler := g++49
|
|
else
|
|
compiler := g++
|
|
endif
|
|
endif
|
|
|
|
# build optimization levels
|
|
ifeq ($(build),debug)
|
|
flags += -Og -DBUILD_DEBUG
|
|
else ifeq ($(build),stable)
|
|
flags += -O1 -DBUILD_STABLE
|
|
else ifeq ($(build),size)
|
|
flags += -Os -DBUILD_SIZE
|
|
else ifeq ($(build),release)
|
|
flags += -O2 -DBUILD_RELEASE
|
|
else ifeq ($(build),performance)
|
|
flags += -O3 -DBUILD_PERFORMANCE
|
|
endif
|
|
|
|
# openmp support
|
|
ifeq ($(openmp),true)
|
|
# macOS Xcode does not ship with OpenMP support
|
|
ifneq ($(platform),macos)
|
|
flags += -fopenmp
|
|
link += -fopenmp
|
|
endif
|
|
endif
|
|
|
|
# clang settings
|
|
ifeq ($(findstring clang++,$(compiler)),clang++)
|
|
flags += -fno-strict-aliasing -fwrapv
|
|
# gcc settings
|
|
else ifeq ($(findstring g++,$(compiler)),g++)
|
|
flags += -fno-strict-aliasing -fwrapv
|
|
endif
|
|
|
|
# windows settings
|
|
ifeq ($(platform),windows)
|
|
link += -mthreads -lpthread -lws2_32 -lole32
|
|
link += $(if $(findstring g++,$(compiler)),-static -static-libgcc -static-libstdc++)
|
|
link += $(if $(findstring true,$(console)),-mconsole,-mwindows)
|
|
windres := windres
|
|
endif
|
|
|
|
# macos settings
|
|
ifeq ($(platform),macos)
|
|
flags += -stdlib=libc++
|
|
link += -lc++ -lobjc
|
|
endif
|
|
|
|
# linux settings
|
|
ifeq ($(platform),linux)
|
|
link += -ldl
|
|
endif
|
|
|
|
# bsd settings
|
|
ifeq ($(platform),bsd)
|
|
flags += -I/usr/local/include
|
|
link += -Wl,-rpath=/usr/local/lib
|
|
link += -Wl,-rpath=/usr/local/lib/gcc49
|
|
endif
|
|
|
|
# threading support
|
|
ifeq ($(threaded),true)
|
|
ifneq ($(filter $(platform),linux bsd),)
|
|
flags += -pthread
|
|
link += -pthread -lrt
|
|
endif
|
|
endif
|
|
|
|
# paths
|
|
prefix := $(HOME)/.local
|
|
|
|
# function rwildcard(directory, pattern)
|
|
rwildcard = \
|
|
$(strip \
|
|
$(filter $(if $2,$2,%), \
|
|
$(foreach f, \
|
|
$(wildcard $1*), \
|
|
$(eval t = $(call rwildcard,$f/)) \
|
|
$(if $t,$t,$f) \
|
|
) \
|
|
) \
|
|
)
|
|
|
|
# function unique(source)
|
|
unique = \
|
|
$(eval __temp :=) \
|
|
$(strip \
|
|
$(foreach s,$1,$(if $(filter $s,$(__temp)),,$(eval __temp += $s))) \
|
|
$(__temp) \
|
|
)
|
|
|
|
# function strtr(source, from, to)
|
|
strtr = \
|
|
$(eval __temp := $1) \
|
|
$(strip \
|
|
$(foreach c, \
|
|
$(join $(addsuffix :,$2),$3), \
|
|
$(eval __temp := \
|
|
$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),$(__temp)) \
|
|
) \
|
|
) \
|
|
$(__temp) \
|
|
)
|
|
|
|
# function strupper(source)
|
|
strupper = $(call strtr,$1,$([a-z]),$([A-Z]))
|
|
|
|
# function strlower(source)
|
|
strlower = $(call strtr,$1,$([A-Z]),$([a-z]))
|
|
|
|
# function strlen(source)
|
|
strlen = \
|
|
$(eval __temp := $(subst $([space]),_,$1)) \
|
|
$(words \
|
|
$(strip \
|
|
$(foreach c, \
|
|
$([all]), \
|
|
$(eval __temp := \
|
|
$(subst $c,$c ,$(__temp)) \
|
|
) \
|
|
) \
|
|
$(__temp) \
|
|
) \
|
|
)
|
|
|
|
# function streq(source)
|
|
streq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),,1)
|
|
|
|
# function strne(source)
|
|
strne = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),1,)
|