asm_cdmemory = 0
asm_mix = 0
+fpic :=
# Unix
ifeq ($(platform), unix)
TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
SHARED := -shared
DONT_COMPILE_IN_ZLIB = 1
CFLAGS += -DFAMEC_NO_GOTOS
else ifeq ($(platform), linux-portable)
TARGET := $(TARGET_NAME)_libretro.so
SHARED := -shared -nostdlib
+ fpic := -fPIC
LIBM :=
DONT_COMPILE_IN_ZLIB = 1
CFLAGS += -DFAMEC_NO_GOTOS
else ifeq ($(platform), osx)
TARGET := $(TARGET_NAME)_libretro.dylib
SHARED := -dynamiclib
+ fpic := -fPIC
APPLE := 1
arch = intel
ifeq ($(shell uname -p),powerpc)
else ifeq ($(platform), ios)
TARGET := $(TARGET_NAME)_libretro_ios.dylib
SHARED := -dynamiclib
+ fpic := -fPIC
APPLE := 1
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
# QNX
else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_qnx.so
+ fpic := -fPIC
CC = qcc -Vgcc_ntoarmv7le
CC_AS = $(CC)
CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
else ifneq (,$(findstring armv,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
SHARED := -shared -Wl,--no-undefined
+ fpic := -fPIC
ifneq (,$(findstring cortexa5,$(platform)))
CFLAGS += -marm -mcpu=cortex-a5
ASFLAGS += -mcpu=cortex-a5
else
TARGET := $(TARGET_NAME)_libretro.dll
CC = gcc
- LD_FLAGS := -fPIC
+ fpic := -fPIC
SHARED := -shared -static-libgcc -static-libstdc++
CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
asm_mix = 1
endif
-CFLAGS += -fPIC
+CFLAGS += $(fpic)
ifeq ($(findstring Haiku,$(shell uname -a)),)
LDLIBS += $(LIBM)
endif
SHARED ?= -shared
-LDFLAGS += $(SHARED)
+LDFLAGS += $(SHARED) $(fpic)
PLATFORM = libretro
NO_CONFIG_MAK = yes