snes9x2010/build/Makefile.windows_msvc2015_x64
2017-06-27 02:53:18 +02:00

106 lines
2.5 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 "$(VS140COMNTOOLS)../../VC/bin/amd64"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/include")
LIB := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/lib/amd64")
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -v "KitsRoot10" | grep -o '[A-Z]:\\.*')lib/x64
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -v "KitsRoot10" | grep -o '[A-Z]:\\.*')lib/x64
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 -DINLINE=_inline -D_USRDLL -DRIGHTSHIFT_IS_SAR -DCORRECT_VRAM_READS -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__
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
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
print-%:
@echo '$*=$($*)'