mirror of
https://github.com/libretro/PokeMini.git
synced 2024-11-23 07:49:39 +00:00
113 lines
2.8 KiB
Makefile
113 lines
2.8 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/amd64"):$(PATH)
|
|
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
|
|
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include")
|
|
LIB := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/lib/amd64")
|
|
|
|
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')
|
|
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')
|
|
|
|
WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include")
|
|
WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl")
|
|
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\x64")
|
|
|
|
export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKGlIncludeDir)
|
|
export LIB := $(LIB);$(WindowsSDKLibDir)
|
|
|
|
############
|
|
# Extensions
|
|
|
|
OBJEXT = .obj
|
|
SOEXT = .dll
|
|
|
|
################
|
|
# Platform setup
|
|
|
|
STATIC_LINKING = 0
|
|
PLATDEFS =
|
|
PLATCFLAGS = -DWIN32 -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -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) $(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
|
|
CFLAGS += -MTd
|
|
CXXFLAGS += -MTd
|
|
LDFLAGS += -DEBUG -DLL
|
|
else
|
|
CFLAGS += -O2 -DNDEBUG
|
|
CXXFLAGS += -O2 -DNDEBUG
|
|
CFLAGS += -MT
|
|
CXXFLAGS += -MT
|
|
LDFLAGS += -DLL
|
|
endif
|
|
|
|
ifneq ($(LOG_PERFORMANCE),)
|
|
CFLAGS += -DLOG_PERFORMANCE
|
|
CXXFLAGS += -DLOG_PERFORMANCE
|
|
endif
|
|
|
|
###############
|
|
# Include rules
|
|
|
|
include $(BUILD_DIR)/Makefile.rules
|
|
|
|
print-%:
|
|
@echo '$*=$($*)'
|