mirror of
https://github.com/libretro/mgba.git
synced 2024-11-26 17:50:26 +00:00
97 lines
2.1 KiB
Makefile
97 lines
2.1 KiB
Makefile
##############
|
|
# Works on hosts Linux
|
|
# Install vitasdk
|
|
|
|
#########################
|
|
# Check the host platform
|
|
|
|
HOST_PLATFORM = linux
|
|
ifeq ($(shell uname -a),)
|
|
HOST_PLATFORM = windows
|
|
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
|
HOST_PLATFORM = windows
|
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
HOST_PLATFORM = darwin
|
|
else ifneq ($(findstring win,$(shell uname -a)),)
|
|
HOST_PLATFORM = windows
|
|
endif
|
|
|
|
#########################
|
|
# Set the target platform
|
|
|
|
TARGET_PLATFORM = vita_arm
|
|
|
|
#################
|
|
# Toolchain setup
|
|
|
|
CC = $(VITASDK)/bin/arm-vita-eabi-gcc
|
|
CXX = $(VITASDK)/bin/arm-vita-eabi-g++
|
|
AS = $(VITASDK)/bin/arm-vita-eabi-as
|
|
AR = $(VITASDK)/bin/arm-vita-eabi-ar
|
|
|
|
############
|
|
# Extensions
|
|
|
|
OBJEXT = .vita_arm.o
|
|
SOEXT = .vita_arm.so
|
|
LIBEXT = .vita_arm.a
|
|
|
|
################
|
|
# Platform setup
|
|
|
|
STATIC_LINKING = 1
|
|
platform = vita
|
|
PLATDEFS = -DVITA
|
|
PLATCFLAGS = -ftree-vectorize -mfloat-abi=hard -ffast-math -fsingle-precision-constant -funroll-loops -fno-short-enums
|
|
PLATCXXFLAGS = -ftree-vectorize -mfloat-abi=hard -ffast-math -fsingle-precision-constant -funroll-loops -fno-short-enums
|
|
PLATLDFLAGS = -shared -lm -mthumb -mcpu=cortex-a9 -mfloat-abi=hard
|
|
PLATLDXFLAGS = -shared -lm -mthumb -mcpu=cortex-a9 -mfloat-abi=hard
|
|
|
|
################
|
|
# libretro setup
|
|
|
|
RETRODEFS = -D__LIBRETRO__
|
|
RETROCFLAGS =
|
|
RETROCXXFLAGS =
|
|
RETROLDFLAGS =
|
|
RETROLDXFLAGS =
|
|
|
|
#################
|
|
# Final variables
|
|
|
|
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
|
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
|
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
|
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
|
LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
|
|
|
|
########
|
|
# Tuning
|
|
|
|
ifneq ($(DEBUG),)
|
|
CFLAGS += -O0 -g
|
|
CXXFLAGS += -O0 -g
|
|
else
|
|
CFLAGS += -O3 -DNDEBUG
|
|
CXXFLAGS += -O3 -DNDEBUG
|
|
endif
|
|
|
|
ifneq ($(LOG_PERFORMANCE),)
|
|
CFLAGS += -DLOG_PERFORMANCE
|
|
CXXFLAGS += -DLOG_PERFORMANCE
|
|
endif
|
|
|
|
####################################
|
|
# Variable setup for Makefile.common
|
|
|
|
CORE_DIR ?= ..
|
|
BUILD_DIR ?= .
|
|
INCLUDES =
|
|
|
|
include $(BUILD_DIR)/Makefile.common
|
|
|
|
###############
|
|
# Include rules
|
|
|
|
include $(BUILD_DIR)/Makefile.rules
|