Marking of more classes, might get rid of in the future and optimize; Implement shrin...
[SquirrelJME.git] / ratufacoat / libretro / Makefile.windows_msvc2015_x64
blobfbf5b5324906c3f34613f81ddf378e17ae17a100
1 ##############
2 # Works on hosts Linux
3 # apt-get install mingw-w64
5 ##########################
6 # Checks the host platform
8 include $(BUILD_DIR)/Makefile.common.hostcheck
11 ####################################
12 # Variable setup for Makefile.common
14 CORE_DIR  ?= ..
15 BUILD_DIR ?= .
16 INCLUDES   =
18 include $(BUILD_DIR)/Makefile.common
20 #################
21 # Toolchain setup
23 CC  = cl.exe
24 CXX = cl.exe
26 PATH := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/bin/amd64"):$(PATH)
27 PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../IDE")
28 INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/include")
29 LIB := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/lib/amd64")
31 reg_query = $(call filter_out2,$(subst $2,,$(shell reg query "$2" -v "$1" 2>nul)))
32 fix_path = $(subst $(SPACE),\ ,$(subst \,/,$1))
33 WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0)
34 WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0)
35 WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0)
36 WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0)
37 WindowsSdkDir := $(WindowsSdkDir)
39 WindowsSDKVersion ?= $(firstword $(foreach folder,$(subst $(subst \,/,$(WindowsSdkDir)Include/),,$(wildcard $(call fix_path,$(WindowsSdkDir)Include\*))),$(if $(wildcard $(call fix_path,$(WindowsSdkDir)Include/$(folder)/um/Windows.h)),$(folder),)))$(BACKSLASH)
40 WindowsSDKVersion := $(WindowsSDKVersion)
42 export INCLUDE := $(INCLUDE);$(VCINSTALLDIR)INCLUDE;$(VCINSTALLDIR)ATLMFC\INCLUDE;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um;
43 export LIB := $(LIB);$(VCINSTALLDIR)LIB\amd64;$(VCINSTALLDIR)ATLMFC\LIB\amd64;$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\x64;$(WindowsSdkDir)lib\$(WindowsSDKVersion)um\x64;
45 ############
46 # Extensions
48 OBJEXT = .obj
49 SOEXT  = .dll
51 ################
52 # Platform setup
54 STATIC_LINKING = 0
55 platform       = win
56 PLATDEFS       =
57 PLATCFLAGS     = -DWIN32 -DCORRECT_VRAM_READS -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -DMSVC2010_EXPORTS -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
58 PLATCXXFLAGS   = $(PLATCFLAGS)
59 #PLATLDFLAGS   = -shared -lm
60 #PLATLDXFLAGS   = -shared -lm
62 ################
63 # libretro setup
65 RETRODEFS     = -D__LIBRETRO__
66 RETROCFLAGS   =
67 RETROCXXFLAGS =
68 RETROLDFLAGS  =
69 RETROLDXFLAGS =
71 #################
72 # Final variables
74 DEFINES  = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
75 CFLAGS   = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
76 CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
77 LDFLAGS  = $(PLATLDFLAGS) $(RETROLDFLAGS)
78 LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
80 ########
81 # Tuning
83 ifeq ($(DEBUG),1)
84   CFLAGS   += -Od -Zi -D_DEBUG
85   CXXFLAGS += -Od -Zi -D_DEBUG
86   LDFLAGS  += -DEBUG -DLL
87 else
88   CFLAGS   += -O2 -DNDEBUG
89   CXXFLAGS += -O2 -DNDEBUG
90   LDFLAGS  += -DLL
91 endif
93 ifneq ($(LOG_PERFORMANCE),)
94   CFLAGS   += -DLOG_PERFORMANCE
95   CXXFLAGS += -DLOG_PERFORMANCE
96 endif
98 ###############
99 # Include rules
101 include $(BUILD_DIR)/Makefile.rules
103 print-%:
104         @echo '$*=$($*)'