mirror of
https://github.com/libretro/mgba.git
synced 2024-11-23 16:10:01 +00:00
97 lines
1.8 KiB
Makefile
97 lines
1.8 KiB
Makefile
##############
|
|
# Works on hosts Linux
|
|
# apt-get install mingw-w64
|
|
|
|
#########################
|
|
# 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 = windows_x86
|
|
|
|
#################
|
|
# Toolchain setup
|
|
|
|
CC = i686-w64-mingw32-gcc
|
|
CXX = i686-w64-mingw32-g++
|
|
AS = i686-w64-mingw32-as
|
|
AR = i686-w64-mingw32-ar
|
|
|
|
############
|
|
# Extensions
|
|
|
|
OBJEXT = .windows_x86.o
|
|
SOEXT = .windows_x86.dll
|
|
LIBEXT = .windows_x86.a
|
|
|
|
################
|
|
# Platform setup
|
|
|
|
STATIC_LINKING = 0
|
|
platform = win
|
|
PLATDEFS =
|
|
PLATCFLAGS = -fstrict-aliasing
|
|
PLATCXXFLAGS = -fstrict-aliasing
|
|
PLATLDFLAGS = -shared -lm
|
|
PLATLDXFLAGS = -shared -lm
|
|
|
|
################
|
|
# 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
|