libretro, build fixes

This commit is contained in:
kub 2020-07-10 17:53:32 +02:00
parent 55c3c2b02f
commit 03d5f5105c
7 changed files with 63 additions and 168 deletions

View file

@ -24,7 +24,6 @@ endif
ifndef NO_ALIGN_FUNCTIONS
CFLAGS += -falign-functions=2
endif
LDFLAGS += -Wl,--gc-sections
# profiling
pprof ?= 0
@ -64,27 +63,13 @@ asm_cdmemory ?= 1
asm_mix ?= 1
asm_32xdraw ?= 1
asm_32xmemory ?= 1
else ifneq (,$(findstring 86,$(ARCH)))
use_fame ?= 1
use_cz80 ?= 1
use_sh2drc ?= 1
else ifneq (,$(findstring mips,$(ARCH)))
use_fame ?= 1
use_cz80 ?= 1
use_sh2drc ?= 1
else ifneq (,$(findstring aarch64,$(ARCH)))
use_fame ?= 1
use_cz80 ?= 1
use_sh2drc ?= 1
else ifneq (,$(findstring riscv,$(ARCH)))
use_fame ?= 1
use_cz80 ?= 1
use_sh2drc ?= 1
else ifneq (,$(findstring powerpc,$(ARCH)))
else
use_fame ?= 1
use_cz80 ?= 1
ifneq (,$(filter "$(ARCH)","x86" "i386" "mips" "aarch64" "riscv" "powerpc"))
use_sh2drc ?= 1
endif
endif
-include Makefile.local

View file

@ -8,10 +8,6 @@ ifeq ($(platform),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
@ -31,15 +27,6 @@ ifneq ($(GIT_VERSION),"unknown")
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
asm_memory = 0
asm_render = 0
asm_ym2612 = 0
asm_misc = 0
asm_cdmemory = 0
asm_mix = 0
asm_32xdraw = 0
asm_32xmemory = 0
fpic :=
ifeq ($(STATIC_LINKING),1)
@ -54,7 +41,6 @@ ifeq ($(platform), unix)
SHARED := -shared
DONT_COMPILE_IN_ZLIB = 1
CFLAGS += -DFAMEC_NO_GOTOS
use_sh2drc = 1
# Portable Linux
else ifeq ($(platform), linux-portable)
@ -65,7 +51,6 @@ else ifeq ($(platform), linux-portable)
LIBM :=
DONT_COMPILE_IN_ZLIB = 1
CFLAGS += -DFAMEC_NO_GOTOS
use_sh2drc = 1
# OS X
else ifeq ($(platform), osx)
@ -74,14 +59,8 @@ else ifeq ($(platform), osx)
SHARED := -dynamiclib
fpic := -fPIC
APPLE := 1
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
ifeq ($(arch),ppc)
CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
else
use_sh2drc = 1
endif
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
@ -103,15 +82,8 @@ else ifeq ($(platform), staticios)
CXX += -miphoneos-version-min=8.0
CC_AS += -miphoneos-version-min=8.0
CFLAGS += -miphoneos-version-min=8.0
ARCH := aarch64
STATIC_LINKING = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
use_svpdrc = 0
# iOS
else ifneq (,$(findstring ios,$(platform)))
@ -139,15 +111,8 @@ else
CXX += -miphoneos-version-min=5.0
CC_AS += -miphoneos-version-min=5.0
CFLAGS += -miphoneos-version-min=5.0
use_svpdrc = 0
endif
ARCH := arm
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
use_svpdrc = 1
# PS3
else ifeq ($(platform), ps3)
@ -159,14 +124,9 @@ else ifeq ($(platform), ps3)
NO_MMAP = 1
DONT_COMPILE_IN_ZLIB = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
# sncps3
else ifeq ($(platform), sncps3)
ARCH = powerpc
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
@ -175,12 +135,6 @@ else ifeq ($(platform), sncps3)
NO_MMAP = 1
DONT_COMPILE_IN_ZLIB = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
# Lightweight PS3 Homebrew SDK
else ifeq ($(platform), psl1ght)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
@ -191,12 +145,6 @@ else ifeq ($(platform), psl1ght)
NO_MMAP = 1
DONT_COMPILE_IN_ZLIB = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
# PSP
else ifeq ($(platform), psp1)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
@ -209,11 +157,6 @@ else ifeq ($(platform), psp1)
DONT_COMPILE_IN_ZLIB = 1
asm_render = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
# CTR (3DS)
else ifeq ($(platform), ctr)
@ -228,15 +171,6 @@ else ifeq ($(platform), ctr)
STATIC_LINKING = 1
NO_MMAP = 1
DONT_COMPILE_IN_ZLIB = 1
ARCH = arm
ARM_ASM = 1
use_cyclone = 1
use_fame = 0
use_drz80 = 1
use_cz80 = 0
use_sh2drc = 1
use_svpdrc = 1
OBJS +=platform/libretro/3ds/3ds_utils.o
@ -245,21 +179,12 @@ else ifeq ($(platform), raspberrypi)
CFLAGS += -marm -mfpu=vfp -mfloat-abi=hard -march=armv6j
CFLAGS += -Wall -mword-relocations
CFLAGS += -fomit-frame-pointer -ffast-math
ARCH = arm
ARM_ASM = 1
TARGET := $(TARGET_NAME)_libretro.so
SHARED := -shared
fpic := -fPIC
DONT_COMPILE_IN_ZLIB = 1
use_cyclone = 1
use_fame = 0
use_drz80 = 1
use_cz80 = 0
use_sh2drc = 1
use_svpdrc = 1
# Vita
else ifeq ($(platform), vita)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
@ -273,15 +198,6 @@ else ifeq ($(platform), vita)
STATIC_LINKING = 1
NO_MMAP = 1
DONT_COMPILE_IN_ZLIB = 1
ARCH = arm
ARM_ASM = 1
use_cyclone = 1
use_fame = 0
use_drz80 = 1
use_cz80 = 0
use_sh2drc = 1
use_svpdrc = 1
# Xbox 360
else ifeq ($(platform), xenon)
@ -313,14 +229,6 @@ else ifeq ($(platform), qnx)
CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
ARCH = arm
ARM_ASM = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
use_svpdrc = 1
# ARM
else ifneq (,$(findstring armv,$(platform)))
@ -353,21 +261,16 @@ else ifneq (,$(findstring armv,$(platform)))
CFLAGS += -mfloat-abi=hard
ASFLAGS += -mfloat-abi=hard
endif
ifneq (,$(findstring armasm,$(platform)))
ARM_ASM = 1
ifeq (,$(findstring armasm,$(platform)))
NO_ARM_ASM = 1
endif
ARCH = arm
# Emscripten
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
STATIC_LINKING = 1
ARCH = unknown
DONT_COMPILE_IN_ZLIB = 1
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
# GCW0
else ifeq ($(platform), gcw0)
TARGET := $(TARGET_NAME)_libretro.so
@ -379,12 +282,6 @@ else ifeq ($(platform), gcw0)
DONT_COMPILE_IN_ZLIB = 1
CFLAGS += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float
use_cyclone = 0
use_fame = 1
use_drz80 = 0
use_cz80 = 1
use_sh2drc = 1
# Windows
else
TARGET := $(TARGET_NAME)_libretro.dll
@ -401,15 +298,20 @@ ifeq ($(NO_MMAP),1)
CFLAGS += -DNO_MMAP
endif
ifeq ($(ARM_ASM),1)
asm_memory = 1
asm_render = 1
asm_ym2612 = 1
asm_misc = 1
asm_cdmemory = 1
asm_mix = 1
asm_32xdraw = 1
asm_32xmemory = 1
ifeq ($(NO_ARM_ASM),1)
use_cyclone = 0
use_fame ?= 1
use_drz80 = 0
use_cz80 ?= 1
asm_memory = 0
asm_render = 0
asm_ym2612 = 0
asm_misc = 0
asm_cdmemory = 0
asm_mix = 0
asm_32xdraw = 0
asm_32xmemory = 0
endif
CFLAGS += $(fpic)
@ -421,7 +323,7 @@ endif
SHARED ?= -shared
LDFLAGS += $(SHARED) $(fpic)
ifneq ($(ARCH), arm)
ifeq ($(ARCH),)
ARCH = $(shell $(CC) -dumpmachine | awk -F '-' '{print $$1}')
endif
PLATFORM = libretro

View file

@ -33,12 +33,14 @@ extern "C" {
#endif
#ifdef UTYPES_DEFINED
typedef uint8_t u8;
typedef int8_t s8;
typedef uint16_t u16;
typedef int16_t s16;
typedef uint32_t u32;
typedef int32_t s32;
#endif
typedef uintptr_t uptr; // unsigned pointer-sized int
// ----------------------- 68000 CPU -----------------------

View file

@ -98,6 +98,9 @@ ifeq "$(profile)" "1"
endif
../../tools/textfilter: ../../tools/textfilter.c
make -C ../../tools/ textfilter
readme.txt: ../../tools/textfilter ../base_readme.txt
../../tools/textfilter ../base_readme.txt $@ GIZ

View file

@ -11,7 +11,7 @@ endif
all: rel
../../tools/textfilter: ../../tools/textfilter.c
make -C ../../tools/
make -C ../../tools/ textfilter
readme.txt: ../../tools/textfilter ../base_readme.txt ../../ChangeLog
../../tools/textfilter ../base_readme.txt $@ GP2X

View file

@ -13,7 +13,7 @@ PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
all: rel
../../tools/textfilter: ../../tools/textfilter.c
make -C ../../tools/
make -C ../../tools/ textfilter
#readme.txt: ../../tools/textfilter ../base_readme.txt ../../ChangeLog
# ../../tools/textfilter ../base_readme.txt $@ PANDORA

View file

@ -1,9 +1,12 @@
TARGETS = amalgamate textfilter
OBJS = $(addsuffix .o,$(TARGETS))
HOSTCC ?= cc
all: $(TARGETS)
all:
CC="$(XCC)" CFLAGS="$(XCFLAGS)" sh ./mkoffsets.sh ../pico
$(TARGETS): $(addsuffix .c,$(TARGETS))
$(HOSTCC) -o $@ -O $@.c
clean:
$(RM) $(TARGETS) $(OBJS)