diff --git a/Makefile.libretro b/Makefile.libretro index ebd17ad..6bd88e2 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -231,7 +231,52 @@ else ifeq ($(platform), gcw0) PLATFORM_DEFINES := -DCC_RESAMPLER -DCC_RESAMPLER_NO_HIGHPASS CFLAGS += -fomit-frame-pointer -march=mips32 -mtune=mips32r2 -mhard-float CXXFLAGS += $(CFLAGS) +# Windows MSVC 2010 x64 +else ifeq ($(platform), windows_msvc2010_x64) + CC = cl.exe + CXX = cl.exe +PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin/amd64"):$(PATH) +PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE") +LIB := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/lib/amd64") +INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include") + +WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64 +WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64 + +WindowsSdkDirInc := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include +WindowsSdkDirInc ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include + + +INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)" +export INCLUDE := $(INCLUDE) +export LIB := $(LIB);$(WindowsSdkDir) +TARGET := $(TARGET_NAME)_libretro.dll +PSS_STYLE :=2 +LDFLAGS += -DLL +# Windows MSVC 2010 x86 +else ifeq ($(platform), windows_msvc2010_x86) + CC = cl.exe + CXX = cl.exe + +PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin"):$(PATH) +PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE") +LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/lib") +INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include") + +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 + +WindowsSdkDirInc := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include +WindowsSdkDirInc ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include + + +INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)" +export INCLUDE := $(INCLUDE) +export LIB := $(LIB);$(WindowsSdkDir) +TARGET := $(TARGET_NAME)_libretro.dll +PSS_STYLE :=2 +LDFLAGS += -DLL # Windows else TARGET := $(TARGET_NAME)_libretro.dll @@ -275,11 +320,16 @@ CXXFLAGS += $(fpic) $(DEFINES) LIBS := -%.o: %.cpp - $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) $(INCFLAGS) +OBJOUT = -o +LINKOUT = -o -%.o: %.c - $(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS) $(INCFLAGS) +ifneq (,$(findstring msvc,$(platform))) + OBJOUT = -Fo + LINKOUT = -out: + LD = link.exe +else + LD = $(CC) +endif ifeq ($(platform), theos_ios) COMMON_FLAGS := -DIOS $(COMMON_DEFINES) $(INCFLAGS) -I$(THEOS_INCLUDE_PATH) -Wno-error @@ -302,9 +352,14 @@ $(TARGET): $(OBJS) ifeq ($(STATIC_LINKING), 1) $(AR) rcs $@ $(OBJS) else - $(CXX) -o $@ $(SHARED) $(OBJS) $(LDFLAGS) $(LIBS) + $(LD) $(LINKOUT)$@ $(SHARED) $(OBJS) $(LDFLAGS) $(LIBS) endif +%.o: %.cpp + $(CXX) -c $(OBJOUT)$@ $< $(CPPFLAGS) $(CXXFLAGS) $(INCFLAGS) + +%.o: %.c + $(CC) -c $(OBJOUT)$@ $< $(CPPFLAGS) $(CFLAGS) $(INCFLAGS) clean-objs: rm -f $(OBJS)