mirror of
https://github.com/libretro/snes9x2010.git
synced 2024-12-11 18:26:11 +00:00
103 lines
2.6 KiB
Makefile
103 lines
2.6 KiB
Makefile
##############
|
|
# Works on hosts Linux
|
|
# apt-get install mingw-w64
|
|
|
|
##########################
|
|
# 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 = cl.exe
|
|
CXX = cl.exe
|
|
|
|
PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin"):$(PATH)
|
|
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
|
|
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include")
|
|
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/lib")
|
|
|
|
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib
|
|
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib
|
|
|
|
export INCLUDE := $(INCLUDE)
|
|
export LIB := $(LIB);$(WindowsSdkDir)
|
|
|
|
############
|
|
# Extensions
|
|
|
|
OBJEXT = .obj
|
|
SOEXT = .dll
|
|
|
|
################
|
|
# Platform setup
|
|
|
|
STATIC_LINKING = 0
|
|
platform = win
|
|
PLATDEFS =
|
|
PLATCFLAGS = -DWIN32 -DCORRECT_VRAM_READS -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -DMSVC2010_EXPORTS -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
|
|
PLATCXXFLAGS = $(PLATCFLAGS)
|
|
#PLATLDFLAGS = -shared -lm
|
|
#PLATLDXFLAGS = -shared -lm
|
|
|
|
################
|
|
# libretro setup
|
|
|
|
RETRODEFS = -D__LIBRETRO__ -wd4710 -wd4711 -wd4127 -wd4204 -wd4242 -wd4244 -wd4820 -wd4214 -wd4100 -wd4738 -wd4706 -wd4668 -wd4245 -wd4255 -wd4389 -wd4305 -wd4113
|
|
RETROCFLAGS =
|
|
RETROCXXFLAGS =
|
|
RETROLDFLAGS =
|
|
RETROLDXFLAGS =
|
|
|
|
#################
|
|
# Final variables
|
|
|
|
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
|
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
|
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
|
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
|
LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
|
|
|
|
########
|
|
# Tuning
|
|
|
|
ifeq ($(DEBUG),1)
|
|
CFLAGS += -Od -Zi -D_DEBUG
|
|
CXXFLAGS += -Od -Zi -D_DEBUG
|
|
LDFLAGS += -DEBUG -DLL
|
|
else
|
|
CFLAGS += -O2 -DNDEBUG
|
|
CXXFLAGS += -O2 -DNDEBUG
|
|
LDFLAGS += -DLL
|
|
endif
|
|
|
|
ifneq ($(LOG_PERFORMANCE),)
|
|
CFLAGS += -DLOG_PERFORMANCE
|
|
CXXFLAGS += -DLOG_PERFORMANCE
|
|
endif
|
|
|
|
###############
|
|
# Include rules
|
|
|
|
include $(BUILD_DIR)/Makefile.rules
|