2015-08-04 03:52:00 +00:00
|
|
|
##############
|
|
|
|
# Works on hosts Linux
|
|
|
|
# apt-get install g++-multilib libc6-dev-i386
|
|
|
|
|
|
|
|
##########################
|
|
|
|
# Checks 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
|
|
|
|
|
|
|
|
|
|
|
|
####################################
|
|
|
|
# Variable setup for Makefile.common
|
|
|
|
|
|
|
|
CORE_DIR ?= ..
|
|
|
|
BUILD_DIR ?= .
|
|
|
|
INCLUDES =
|
|
|
|
|
|
|
|
include $(BUILD_DIR)/Makefile.common
|
|
|
|
|
|
|
|
#################
|
|
|
|
# Toolchain setup
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
AS = as
|
|
|
|
AR = ar
|
|
|
|
|
|
|
|
############
|
|
|
|
# Extensions
|
|
|
|
|
2015-08-17 00:29:11 +00:00
|
|
|
OBJEXT = .linux-portable_x86.o
|
|
|
|
SOEXT = .linux-portable_x86.so
|
2015-08-04 03:52:00 +00:00
|
|
|
|
|
|
|
################
|
|
|
|
# Platform setup
|
|
|
|
|
|
|
|
STATIC_LINKING = 0
|
|
|
|
platform = unix
|
|
|
|
PLATDEFS =
|
|
|
|
PLATCFLAGS = -m32 -fpic -fstrict-aliasing
|
|
|
|
PLATCXXFLAGS = -m32 -fpic -fstrict-aliasing
|
|
|
|
PLATLDFLAGS = -m32 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T
|
|
|
|
PLATLDXFLAGS = -m32 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T
|
|
|
|
|
|
|
|
################
|
|
|
|
# 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
|
|
|
|
|
2015-08-17 00:29:11 +00:00
|
|
|
ifneq ($(DEBUG),)
|
2015-08-04 03:52:00 +00:00
|
|
|
CFLAGS += -O0 -g
|
|
|
|
CXXFLAGS += -O0 -g
|
|
|
|
else
|
|
|
|
CFLAGS += -O3 -DNDEBUG
|
|
|
|
CXXFLAGS += -O3 -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
2015-08-17 00:29:11 +00:00
|
|
|
ifneq ($(LOG_PERFORMANCE),)
|
2015-08-04 03:52:00 +00:00
|
|
|
CFLAGS += -DLOG_PERFORMANCE
|
|
|
|
CXXFLAGS += -DLOG_PERFORMANCE
|
|
|
|
endif
|
|
|
|
|
|
|
|
###############
|
|
|
|
# Include rules
|
|
|
|
|
|
|
|
include $(BUILD_DIR)/Makefile.rules
|