From 7e88ff941c138d8c548716712fab9b799e2a660f Mon Sep 17 00:00:00 2001 From: Ignacio Sanchez Gines <863613+drhelius@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:39:41 +0100 Subject: [PATCH] [libretro] Fix build with C sources --- platforms/libretro/Makefile | 7 ++-- platforms/libretro/Makefile.common | 58 +++++++++++++++--------------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/platforms/libretro/Makefile b/platforms/libretro/Makefile index cb7ad8ff..6fbbee8c 100644 --- a/platforms/libretro/Makefile +++ b/platforms/libretro/Makefile @@ -339,10 +339,13 @@ ifeq ($(STATIC_LINKING), 1) else $(CXX) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS) endif - -%.o: %.c + +%.o: %.cpp $(CXX) $(CXXFLAGS) $(fpic) -c -o $@ $< +%.o: %.c + $(CC) $(CXXFLAGS) $(fpic) -c -o $@ $< + clean: rm -f $(OBJECTS) $(TARGET) diff --git a/platforms/libretro/Makefile.common b/platforms/libretro/Makefile.common index a5129ff8..22aba96d 100644 --- a/platforms/libretro/Makefile.common +++ b/platforms/libretro/Makefile.common @@ -1,29 +1,29 @@ -SOURCES_C := -SOURCES_CXX := $(CORE_DIR)/libretro.cpp \ - $(SOURCE_DIR)/GearsystemCore.cpp \ - $(SOURCE_DIR)/Memory.cpp \ - $(SOURCE_DIR)/Processor.cpp \ - $(SOURCE_DIR)/Video.cpp \ - $(SOURCE_DIR)/Audio.cpp \ - $(SOURCE_DIR)/Input.cpp \ - $(SOURCE_DIR)/Cartridge.cpp \ - $(SOURCE_DIR)/MemoryRule.cpp \ - $(SOURCE_DIR)/CodemastersMemoryRule.cpp \ - $(SOURCE_DIR)/GameGearIOPorts.cpp \ - $(SOURCE_DIR)/RomOnlyMemoryRule.cpp \ - $(SOURCE_DIR)/SegaMemoryRule.cpp \ - $(SOURCE_DIR)/KoreanMemoryRule.cpp \ - $(SOURCE_DIR)/MSXMemoryRule.cpp \ - $(SOURCE_DIR)/SG1000MemoryRule.cpp \ - $(SOURCE_DIR)/JanggunMemoryRule.cpp \ - $(SOURCE_DIR)/BootromMemoryRule.cpp \ - $(SOURCE_DIR)/SmsIOPorts.cpp \ - $(SOURCE_DIR)/YM2413.cpp \ - $(SOURCE_DIR)/opcodes.cpp \ - $(SOURCE_DIR)/opcodes_cb.cpp \ - $(SOURCE_DIR)/opcodes_ed.cpp \ - $(SOURCE_DIR)/audio/Blip_Buffer.cpp \ - $(SOURCE_DIR)/audio/Effects_Buffer.cpp \ - $(SOURCE_DIR)/audio/Sms_Apu.cpp \ - $(SOURCE_DIR)/audio/Multi_Buffer.cpp - $(SOURCE_DIR)/audio/emu2413/emu2413.cpp \ +SOURCES_C := $(SOURCE_DIR)/audio/emu2413/emu2413.c + +SOURCES_CXX := $(CORE_DIR)/libretro.cpp \ + $(SOURCE_DIR)/GearsystemCore.cpp \ + $(SOURCE_DIR)/Memory.cpp \ + $(SOURCE_DIR)/Processor.cpp \ + $(SOURCE_DIR)/Video.cpp \ + $(SOURCE_DIR)/Audio.cpp \ + $(SOURCE_DIR)/Input.cpp \ + $(SOURCE_DIR)/Cartridge.cpp \ + $(SOURCE_DIR)/MemoryRule.cpp \ + $(SOURCE_DIR)/CodemastersMemoryRule.cpp \ + $(SOURCE_DIR)/GameGearIOPorts.cpp \ + $(SOURCE_DIR)/RomOnlyMemoryRule.cpp \ + $(SOURCE_DIR)/SegaMemoryRule.cpp \ + $(SOURCE_DIR)/KoreanMemoryRule.cpp \ + $(SOURCE_DIR)/MSXMemoryRule.cpp \ + $(SOURCE_DIR)/SG1000MemoryRule.cpp \ + $(SOURCE_DIR)/JanggunMemoryRule.cpp \ + $(SOURCE_DIR)/BootromMemoryRule.cpp \ + $(SOURCE_DIR)/SmsIOPorts.cpp \ + $(SOURCE_DIR)/YM2413.cpp \ + $(SOURCE_DIR)/opcodes.cpp \ + $(SOURCE_DIR)/opcodes_cb.cpp \ + $(SOURCE_DIR)/opcodes_ed.cpp \ + $(SOURCE_DIR)/audio/Blip_Buffer.cpp \ + $(SOURCE_DIR)/audio/Effects_Buffer.cpp \ + $(SOURCE_DIR)/audio/Sms_Apu.cpp \ + $(SOURCE_DIR)/audio/Multi_Buffer.cpp