target_: $(TARGET)
$(TARGET): $(OBJS)
-ifeq ($(STATIC_LINKING), 1)
- $(AR) rcs $@ $(OBJS)
+ifeq ($(PARTIAL_LINKING), 1)
+ sed -e 's/.*/EXTERN(\0)/' frontend/libretro-extern > frontend/libretro-extern.T
+ $(LD) -o $(basename $(TARGET))1.o -r --gc-sections -T frontend/libretro-extern.T $^
+ $(OBJCOPY) --keep-global-symbols=frontend/libretro-extern $(basename $(TARGET))1.o $(basename $(TARGET)).o
+ $(AR) rcs $@ $(basename $(TARGET)).o
+else ifeq ($(STATIC_LINKING), 1)
+ $(AR) rcs $@ $^
else
$(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS)
endif
clean: $(PLAT_CLEAN) clean_plugins
- $(RM) $(TARGET) $(OBJS) $(TARGET).map frontend/revision.h
+ $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map frontend/revision.h
+ $(RM) frontend/libretro-extern.T
ifneq ($(PLUGINS),)
plugins_: $(PLUGINS)
else ifeq ($(platform), psp1)
CC = psp-gcc$(EXE_EXT)
AR = psp-ar$(EXE_EXT)
+ LD = psp-ld$(EXE_EXT)
else ifeq ($(platform), vita)
CC = arm-vita-eabi-gcc$(EXE_EXT)
AR = arm-vita-eabi-ar$(EXE_EXT)
+ LD = arm-vita-eabi-ld$(EXE_EXT)
+ OBJCOPY = arm-vita-eabi-objcopy$(EXE_EXT)
else ifeq ($(platform), ctr)
ifeq ($(strip $(DEVKITARM)),)
$(error "DEVKITARM env var is not set")
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT)
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
+ LD = $(DEVKITARM)/bin/arm-none-eabi-ld$(EXE_EXT)
+ OBJCOPY = $(DEVKITARM)/bin/arm-none-eabi-objcopy$(EXE_EXT)
else ifeq ($(platform), libnx)
export DEPSDIR := $(CURDIR)/
ifeq ($(strip $(DEVKITPRO)),)
else ifeq ($(platform), xenon)
CC = xenon-gcc$(EXE_EXT)
AR = xenon-ar$(EXE_EXT)
+ LD = xenon-ld$(EXE_EXT)
else ifneq (,$(filter $(platform),ngc wii wiiu))
ifeq ($(strip $(DEVKITPPC)),)
$(error "DEVKITPPC env var is not set")
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
+ LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
else ifeq ($(platform), qnx)
CC = qcc -Vgcc_ntoarmv7le
else ifeq ($(platform), miyoo)
NO_PTHREAD=1
NO_MMAP := 1 # for psxmem
LIBPTHREAD :=
- STATIC_LINKING=1
+ PARTIAL_LINKING = 1
BUILTIN_GPU = neon
HAVE_NEON = 1
DYNAREC = ari64
DYNAREC = ari64
ARCH = arm
- STATIC_LINKING = 1
+ PARTIAL_LINKING = 1
NO_PTHREAD=1
NO_POSIX_MEMALIGN := 1
HAVE_PHYSICAL_CDROM = 0
DYNAREC = ari64
ARCH = arm
HAVE_NEON = 0
- STATIC_LINKING = 1
+ PARTIAL_LINKING = 1
+ WANT_ZLIB = 0
NO_POSIX_MEMALIGN := 1
NO_MMAP := 1 # for psxmem
HAVE_PHYSICAL_CDROM = 0
endif
ifeq ($(NO_UNDEF_CHECK)$(shell $(LD) -v 2> /dev/null | awk '{print $$1}'),GNU)
ifeq (,$(findstring $(platform),win32))
- MAIN_LDFLAGS += -Wl,-version-script=frontend/link.T
+ MAIN_LDFLAGS += -Wl,-version-script=frontend/libretro-version-script
endif
MAIN_LDFLAGS += -Wl,--no-undefined
endif