Linux/makefile fixes

This commit is contained in:
Sour 2021-04-10 01:01:31 -04:00
parent 04eb5b1ec6
commit 4874ec67f1
12 changed files with 99 additions and 105 deletions

View file

@ -79,7 +79,7 @@ extern "C" {
#ifdef _WIN32
_renderer.reset(new Renderer(_emu, (HWND)_viewerHandle, true));
#else
_renderer.reset(new SdlRenderer(_console, _viewerHandle, true));
_renderer.reset(new SdlRenderer(_emu, _viewerHandle, true));
#endif
}
@ -87,7 +87,7 @@ extern "C" {
#ifdef _WIN32
_soundManager.reset(new SoundManager(_emu, (HWND)_windowHandle));
#else
_soundManager.reset(new SdlSoundManager(_console));
_soundManager.reset(new SdlSoundManager(_emu));
#endif
}
@ -95,7 +95,7 @@ extern "C" {
#ifdef _WIN32
_keyManager.reset(new WindowsKeyManager(_emu, (HWND)_windowHandle));
#else
_keyManager.reset(new LinuxKeyManager(_console));
_keyManager.reset(new LinuxKeyManager(_emu));
#endif
KeyManager::RegisterKeyManager(_keyManager.get());

View file

@ -1,8 +1,8 @@
#include "../Core/MessageManager.h"
#include "../Core/Console.h"
#include "../Core/EmuSettings.h"
#include "Core/Shared/MessageManager.h"
#include "Core/Shared/Emulator.h"
#include "Core/Shared/EmuSettings.h"
#include "LinuxGameController.h"
#include <libevdev/libevdev.h>
#include "libevdev/libevdev.h"
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@ -12,7 +12,7 @@
#include <fcntl.h>
#include <iostream>
std::shared_ptr<LinuxGameController> LinuxGameController::GetController(shared_ptr<Console> console, int deviceID, bool logInformation)
std::shared_ptr<LinuxGameController> LinuxGameController::GetController(shared_ptr<Emulator> emu, int deviceID, bool logInformation)
{
std::string deviceName = "/dev/input/event" + std::to_string(deviceID);
struct stat buffer;
@ -38,7 +38,7 @@ std::shared_ptr<LinuxGameController> LinuxGameController::GetController(shared_p
if((libevdev_has_event_type(device, EV_KEY) && libevdev_has_event_code(device, EV_KEY, BTN_GAMEPAD)) ||
(libevdev_has_event_type(device, EV_ABS) && libevdev_has_event_code(device, EV_ABS, ABS_X))) {
MessageManager::Log(std::string("[Input Connected] Name: ") + libevdev_get_name(device) + " Vendor: " + std::to_string(libevdev_get_id_vendor(device)) + " Product: " + std::to_string(libevdev_get_id_product(device)));
return std::shared_ptr<LinuxGameController>(new LinuxGameController(console, deviceID, fd, device));
return std::shared_ptr<LinuxGameController>(new LinuxGameController(emu, deviceID, fd, device));
} else {
MessageManager::Log(std::string("[Input] Device ignored (Not a gamepad) - Name: ") + libevdev_get_name(device) + " Vendor: " + std::to_string(libevdev_get_id_vendor(device)) + " Product: " + std::to_string(libevdev_get_id_product(device)));
close(fd);
@ -47,9 +47,9 @@ std::shared_ptr<LinuxGameController> LinuxGameController::GetController(shared_p
return nullptr;
}
LinuxGameController::LinuxGameController(shared_ptr<Console> console, int deviceID, int fileDescriptor, libevdev* device)
LinuxGameController::LinuxGameController(shared_ptr<Emulator> emu, int deviceID, int fileDescriptor, libevdev* device)
{
_console = console;
_emu = emu;
_deviceID = deviceID;
_stopFlag = false;
_device = device;
@ -122,7 +122,7 @@ void LinuxGameController::Calibrate()
bool LinuxGameController::CheckAxis(unsigned int code, bool forPositive)
{
double deadZoneRatio = _console->GetSettings()->GetControllerDeadzoneRatio();
double deadZoneRatio = _emu->GetSettings()->GetControllerDeadzoneRatio();
int deadZoneNegative = (_axisDefaultValue[code] - libevdev_get_abs_minimum(_device, code)) * 0.400 * deadZoneRatio;
int deadZonePositive = (libevdev_get_abs_maximum(_device, code) - _axisDefaultValue[code]) * 0.400 * deadZoneRatio;

View file

@ -3,7 +3,7 @@
#include <atomic>
struct libevdev;
class Console;
class Emulator;
class LinuxGameController
{
@ -14,17 +14,17 @@ private:
bool _disconnected = false;
std::thread _eventThread;
std::atomic<bool> _stopFlag;
shared_ptr<Console> _console;
shared_ptr<Emulator> _emu;
int _axisDefaultValue[0x100];
LinuxGameController(shared_ptr<Console> console, int deviceID, int fileDescriptor, libevdev *device);
LinuxGameController(shared_ptr<Emulator> emu, int deviceID, int fileDescriptor, libevdev *device);
bool CheckAxis(unsigned int code, bool forPositive);
void Calibrate();
public:
~LinuxGameController();
static std::shared_ptr<LinuxGameController> GetController(shared_ptr<Console> console, int deviceID, bool logInformation);
static std::shared_ptr<LinuxGameController> GetController(shared_ptr<Emulator> emu, int deviceID, bool logInformation);
bool IsDisconnected();
int GetDeviceID();

View file

@ -1,9 +1,8 @@
#include <algorithm>
#include "LinuxKeyManager.h"
#include "LinuxGameController.h"
#include "../Utilities/FolderUtilities.h"
#include "../Core/ControlManager.h"
#include "../Core/Console.h"
#include "Utilities/FolderUtilities.h"
#include "Core/Shared/Emulator.h"
static vector<KeyDefinition> _keyDefinitions = {
{ "None", 0 },
@ -214,9 +213,9 @@ static vector<KeyDefinition> _keyDefinitions = {
{ "FnDownArrow", 10004 }
};
LinuxKeyManager::LinuxKeyManager(shared_ptr<Console> console)
LinuxKeyManager::LinuxKeyManager(shared_ptr<Emulator> emu)
{
_console = console;
_emu = emu;
ResetKeyState();
@ -357,7 +356,7 @@ void LinuxKeyManager::CheckForGamepads(bool logInformation)
}
if(std::find(connectedIDs.begin(), connectedIDs.end(), deviceId) == connectedIDs.end()) {
std::shared_ptr<LinuxGameController> controller = LinuxGameController::GetController(_console, deviceId, logInformation);
std::shared_ptr<LinuxGameController> controller = LinuxGameController::GetController(_emu, deviceId, logInformation);
if(controller) {
_controllers.push_back(controller);
}
@ -382,14 +381,14 @@ void LinuxKeyManager::StartUpdateDeviceThread()
CheckForGamepads(false);
if(!indexesToRemove.empty() || !controllersToAdd.empty()) {
_console->Pause();
_emu->Pause();
for(int index : indexesToRemove) {
_controllers.erase(_controllers.begin()+index);
}
for(std::shared_ptr<LinuxGameController> controller : controllersToAdd) {
_controllers.push_back(controller);
}
_console->Resume();
_emu->Resume();
}
_stopSignal.Wait(5000);

View file

@ -2,11 +2,11 @@
#include <unordered_map>
#include <vector>
#include <thread>
#include "../Core/IKeyManager.h"
#include "../Utilities/AutoResetEvent.h"
#include "Core/Shared/Interfaces/IKeyManager.h"
#include "Utilities/AutoResetEvent.h"
class LinuxGameController;
class Console;
class Emulator;
struct KeyDefinition {
string name;
@ -16,7 +16,7 @@ struct KeyDefinition {
class LinuxKeyManager : public IKeyManager
{
private:
shared_ptr<Console> _console;
shared_ptr<Emulator> _emu;
std::vector<shared_ptr<LinuxGameController>> _controllers;
bool _keyState[0x200];
bool _mouseState[0x03];
@ -32,7 +32,7 @@ private:
void CheckForGamepads(bool logInformation);
public:
LinuxKeyManager(shared_ptr<Console> console);
LinuxKeyManager(shared_ptr<Emulator> emu);
virtual ~LinuxKeyManager();
void RefreshState();

View file

@ -1,28 +1,28 @@
#include "SdlRenderer.h"
#include "../Core/Console.h"
#include "../Core/Debugger.h"
#include "../Core/VideoRenderer.h"
#include "../Core/VideoDecoder.h"
#include "../Core/EmuSettings.h"
#include "../Core/MessageManager.h"
#include "Core/Debugger/Debugger.h"
#include "Core/Shared/Emulator.h"
#include "Core/Shared/Video/VideoRenderer.h"
#include "Core/Shared/Video/VideoDecoder.h"
#include "Core/Shared/EmuSettings.h"
#include "Core/Shared/MessageManager.h"
SimpleLock SdlRenderer::_frameLock;
SdlRenderer::SdlRenderer(shared_ptr<Console> console, void* windowHandle, bool registerAsMessageManager) : BaseRenderer(console, registerAsMessageManager), _windowHandle(windowHandle)
SdlRenderer::SdlRenderer(shared_ptr<Emulator> emu, void* windowHandle, bool registerAsMessageManager) : BaseRenderer(emu, registerAsMessageManager), _windowHandle(windowHandle)
{
_frameBuffer = nullptr;
_requiredWidth = 256;
_requiredHeight = 240;
shared_ptr<VideoRenderer> videoRenderer = _console->GetVideoRenderer();
shared_ptr<VideoRenderer> videoRenderer = _emu->GetVideoRenderer();
if(videoRenderer) {
_console->GetVideoRenderer()->RegisterRenderingDevice(this);
_emu->GetVideoRenderer()->RegisterRenderingDevice(this);
}
}
SdlRenderer::~SdlRenderer()
{
shared_ptr<VideoRenderer> videoRenderer = _console->GetVideoRenderer();
shared_ptr<VideoRenderer> videoRenderer = _emu->GetVideoRenderer();
if(videoRenderer) {
videoRenderer->UnregisterRenderingDevice(this);
}
@ -106,7 +106,7 @@ void SdlRenderer::Reset()
{
Cleanup();
if(Init()) {
_console->GetVideoRenderer()->RegisterRenderingDevice(this);
_emu->GetVideoRenderer()->RegisterRenderingDevice(this);
} else {
Cleanup();
}
@ -114,9 +114,9 @@ void SdlRenderer::Reset()
void SdlRenderer::SetScreenSize(uint32_t width, uint32_t height)
{
ScreenSize screenSize = _console->GetVideoDecoder()->GetScreenSize(false);
ScreenSize screenSize = _emu->GetVideoDecoder()->GetScreenSize(false);
VideoConfig cfg = _console->GetSettings()->GetVideoConfig();
VideoConfig cfg = _emu->GetSettings()->GetVideoConfig();
if(_screenHeight != (uint32_t)screenSize.Height || _screenWidth != (uint32_t)screenSize.Width || _nesFrameHeight != height || _nesFrameWidth != width || _useBilinearInterpolation != cfg.UseBilinearInterpolation || _vsyncEnabled != cfg.VerticalSync) {
_vsyncEnabled = cfg.VerticalSync;
_useBilinearInterpolation = cfg.UseBilinearInterpolation;
@ -160,7 +160,7 @@ void SdlRenderer::Render()
return;
}
bool paused = _console->IsPaused() && _console->IsRunning();
bool paused = _emu->IsPaused() && _emu->IsRunning();
if(_noUpdateCount > 10 || _frameChanged || paused || IsMessageShown()) {
SDL_RenderClear(_sdlRenderer);
@ -190,7 +190,7 @@ void SdlRenderer::Render()
SDL_Rect dest = {0, 0, (int)_screenWidth, (int)_screenHeight };
SDL_RenderCopy(_sdlRenderer, _sdlTexture, &source, &dest);
if(_console->IsRunning()) {
if(_emu->IsRunning()) {
if(paused) {
DrawPauseScreen();
}

View file

@ -1,9 +1,9 @@
#pragma once
#include <SDL2/SDL.h>
#include "../Core/IRenderingDevice.h"
#include "../Utilities/SimpleLock.h"
#include "../Core/VideoRenderer.h"
#include "../Core/BaseRenderer.h"
#include "Core/Shared/Interfaces/IRenderingDevice.h"
#include "Utilities/SimpleLock.h"
#include "Core/Shared/Video/VideoRenderer.h"
#include "Core/Shared/Video/BaseRenderer.h"
#include "SpriteFont.h"
struct SDL_Window
@ -20,7 +20,7 @@ struct SDL_Window
};
typedef struct SDL_Window SDL_Window;
class Console;
class Emulator;
class SdlRenderer : public IRenderingDevice, public BaseRenderer
{
@ -62,7 +62,7 @@ private:
bool ContainsCharacter(wchar_t character) override;
public:
SdlRenderer(shared_ptr<Console> console, void* windowHandle, bool registerAsMessageManager);
SdlRenderer(shared_ptr<Emulator> emu, void* windowHandle, bool registerAsMessageManager);
virtual ~SdlRenderer();
void UpdateFrame(void *frameBuffer, uint32_t width, uint32_t height) override;

View file

@ -1,15 +1,15 @@
#include "SdlSoundManager.h"
#include "../Core/EmuSettings.h"
#include "../Core/MessageManager.h"
#include "../Core/SoundMixer.h"
#include "../Core/Console.h"
#include "Core/Shared/EmuSettings.h"
#include "Core/Shared/MessageManager.h"
#include "Core/Shared/Audio/SoundMixer.h"
#include "Core/Shared/Emulator.h"
SdlSoundManager::SdlSoundManager(shared_ptr<Console> console)
SdlSoundManager::SdlSoundManager(shared_ptr<Emulator> emu)
{
_console = console;
_emu = emu;
if(InitializeAudio(44100, false)) {
_console->GetSoundMixer()->RegisterAudioDevice(this);
_emu->GetSoundMixer()->RegisterAudioDevice(this);
}
}
@ -50,7 +50,7 @@ bool SdlSoundManager::InitializeAudio(uint32_t sampleRate, bool isStereo)
_sampleRate = sampleRate;
_isStereo = isStereo;
_previousLatency = _console->GetSettings()->GetAudioConfig().AudioLatency;
_previousLatency = _emu->GetSettings()->GetAudioConfig().AudioLatency;
int bytesPerSample = 2 * (isStereo ? 2 : 1);
int32_t requestedByteLatency = (int32_t)((float)(sampleRate * _previousLatency) / 1000.0f * bytesPerSample);
@ -149,7 +149,7 @@ void SdlSoundManager::WriteToBuffer(uint8_t* input, uint32_t len)
void SdlSoundManager::PlayBuffer(int16_t *soundBuffer, uint32_t sampleCount, uint32_t sampleRate, bool isStereo)
{
uint32_t bytesPerSample = 2 * (isStereo ? 2 : 1);
uint32_t latency = _console->GetSettings()->GetAudioConfig().AudioLatency;
uint32_t latency = _emu->GetSettings()->GetAudioConfig().AudioLatency;
if(_sampleRate != sampleRate || _isStereo != isStereo || _needReset || _previousLatency != latency) {
Release();
InitializeAudio(sampleRate, isStereo);
@ -187,8 +187,8 @@ void SdlSoundManager::ProcessEndOfFrame()
{
ProcessLatency(_readPosition, _writePosition);
uint32_t emulationSpeed = _console->GetSettings()->GetEmulationSpeed();
if(_averageLatency > 0 && emulationSpeed <= 100 && emulationSpeed > 0 && std::abs(_averageLatency - _console->GetSettings()->GetAudioConfig().AudioLatency) > 50) {
uint32_t emulationSpeed = _emu->GetSettings()->GetEmulationSpeed();
if(_averageLatency > 0 && emulationSpeed <= 100 && emulationSpeed > 0 && std::abs(_averageLatency - _emu->GetSettings()->GetAudioConfig().AudioLatency) > 50) {
//Latency is way off (over 50ms gap), stop audio & start again
Stop();
}

View file

@ -1,13 +1,13 @@
#pragma once
#include <SDL2/SDL.h>
#include "../Core/BaseSoundManager.h"
#include "Core/Shared/Audio/BaseSoundManager.h"
class Console;
class Emulator;
class SdlSoundManager : public BaseSoundManager
{
public:
SdlSoundManager(shared_ptr<Console> console);
SdlSoundManager(shared_ptr<Emulator> emu);
~SdlSoundManager();
void PlayBuffer(int16_t *soundBuffer, uint32_t bufferSize, uint32_t sampleRate, bool isStereo);
@ -30,7 +30,7 @@ private:
void WriteToBuffer(uint8_t* output, uint32_t len);
private:
shared_ptr<Console> _console;
shared_ptr<Emulator> _emu;
SDL_AudioDeviceID _audioDeviceID;
string _deviceName;
bool _needReset = false;

View file

@ -20,7 +20,7 @@ namespace Mesen
.UseReactiveUI()
.UsePlatformDetect()
.With(new Win32PlatformOptions { AllowEglInitialization = true })
.With(new X11PlatformOptions { UseGpu = true, UseEGL = true })
.With(new X11PlatformOptions { UseGpu = false, UseEGL = false })
.With(new AvaloniaNativePlatformOptions { UseGpu = true })
.LogToTrace();
}

View file

@ -7,5 +7,7 @@
<configuration>
<packageSources>
<add key="AvaloniaCI" value="https://www.myget.org/F/avalonia-ci/api/v2" />
</packageSources>
<add key="DockAvaloniaCI" value="https://www.myget.org/F/dock-nightly/api/v2" />
</packageSources>
</configuration>

View file

@ -32,7 +32,7 @@ else
PROFILE_USE_FLAG = -fprofile-instr-use=$(CURDIR)/PGOHelper/pgo.profdata
endif
GCCOPTIONS=-fPIC -Wall --std=c++17 -O3 $(MESENFLAGS) -I/usr/include/SDL2
GCCOPTIONS=-fPIC -Wall --std=c++17 -O3 $(MESENFLAGS) -I/usr/include/SDL2 -I $(realpath ./) -I $(realpath ./Core)
CCOPTIONS=-fPIC -Wall -O3 $(MESENFLAGS)
LINKOPTIONS=
@ -67,24 +67,37 @@ ifeq ($(STATICLINK),true)
endif
OBJFOLDER=obj.$(MESENPLATFORM)
SHAREDLIB=libMesenSCore.$(MESENPLATFORM).dll
SHAREDLIB=libMesenSCore.dll
LIBRETROLIB=mesen-s_libretro.$(MESENPLATFORM).so
RELEASEFOLDER=bin/$(MESENPLATFORM)/Release
COREOBJ=$(patsubst Core/%.cpp,Core/$(OBJFOLDER)/%.o,$(wildcard Core/*.cpp))
UTILOBJ=$(patsubst Utilities/%.cpp,Utilities/$(OBJFOLDER)/%.o,$(wildcard Utilities/*.cpp)) $(patsubst Utilities/HQX/%.cpp,Utilities/$(OBJFOLDER)/%.o,$(wildcard Utilities/HQX/*.cpp)) $(patsubst Utilities/xBRZ/%.cpp,Utilities/$(OBJFOLDER)/%.o,$(wildcard Utilities/xBRZ/*.cpp)) $(patsubst Utilities/KreedSaiEagle/%.cpp,Utilities/$(OBJFOLDER)/%.o,$(wildcard Utilities/KreedSaiEagle/*.cpp)) $(patsubst Utilities/Scale2x/%.cpp,Utilities/$(OBJFOLDER)/%.o,$(wildcard Utilities/Scale2x/*.cpp))
LINUXOBJ=$(patsubst Linux/%.cpp,Linux/$(OBJFOLDER)/%.o,$(wildcard Linux/*.cpp))
SEVENZIPOBJ=$(patsubst SevenZip/%.c,SevenZip/$(OBJFOLDER)/%.o,$(wildcard SevenZip/*.c))
LUAOBJ=$(patsubst Lua/%.c,Lua/$(OBJFOLDER)/%.o,$(wildcard Lua/*.c))
DLLOBJ=$(patsubst InteropDLL/%.cpp,InteropDLL/$(OBJFOLDER)/%.o,$(wildcard InteropDLL/*.cpp))
CORESRC := $(shell find Core -name '*.cpp')
COREOBJ := $(CORESRC:.cpp=.o)
UTILSRC := $(shell find Utilities -name '*.cpp')
UTILOBJ := $(UTILSRC:.cpp=.o)
LINUXSRC := $(shell find Linux -name '*.cpp')
LINUXOBJ := $(LINUXSRC:.cpp=.o)
SEVENZIPSRC := $(shell find SevenZip -name '*.c')
SEVENZIPOBJ := $(SEVENZIPSRC:.c=.o)
LUASRC := $(shell find Lua -name '*.c')
LUAOBJ := $(LUASRC:.c=.o)
DLLSRC := $(shell find InteropDLL -name '*.cpp')
DLLOBJ := $(DLLSRC:.cpp=.o)
ifeq ($(SYSTEM_LIBEVDEV), true)
LIBEVDEVLIB=$(shell pkg-config --libs libevdev)
LIBEVDEVINC=$(shell pkg-config --cflags libevdev)
else
LIBEVDEVOBJ=$(patsubst Linux/libevdev/%.c,Linux/$(OBJFOLDER)/%.o,$(wildcard Linux/libevdev/*.c))
LIBEVDEVSRC := $(shell find Linux/libevdev -name '*.c')
LIBEVDEVOBJ := $(LIBEVDEVSRC:.c=.o)
LIBEVDEVINC=-I../
endif
SDL2LIB=$(shell sdl2-config --libs)
SDL2INC=$(shell sdl2-config --cflags)
FSLIB=-lstdc++fs
@ -94,12 +107,8 @@ all: ui
ui: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
mkdir -p $(RELEASEFOLDER)/Dependencies
rm -fr $(RELEASEFOLDER)/Dependencies/*
cd UpdateHelper && xbuild /property:Configuration="Release" /property:Platform="AnyCPU"
cp "bin/Any CPU/Release/MesenUpdater.exe" $(RELEASEFOLDER)/Dependencies/
cp -r UI/Dependencies/* $(RELEASEFOLDER)/Dependencies/
cp InteropDLL/$(OBJFOLDER)/$(SHAREDLIB) $(RELEASEFOLDER)/Dependencies/$(SHAREDLIB)
cd $(RELEASEFOLDER)/Dependencies && zip -r ../Dependencies.zip *
cd UI && xbuild /property:Configuration="Release" /property:Platform="$(MESENPLATFORM)" /property:PreBuildEvent="" /property:DefineConstants="HIDETESTMENU,DISABLEAUTOUPDATE"
cd NewUI && dotnet publish -c Release -r linux-x64 -p:Platform="$(MESENPLATFORM)" --self-contained true -p:PublishSingleFile=true
cp InteropDLL/$(OBJFOLDER)/$(SHAREDLIB) NewUI/bin/x64/Release/linux-x64/publish/$(SHAREDLIB)
libretro: Libretro/$(OBJFOLDER)/$(LIBRETROLIB)
mkdir -p bin
@ -117,30 +126,13 @@ testhelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
pgohelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
mkdir -p PGOHelper/$(OBJFOLDER) && cd PGOHelper/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -Wl,-z,defs -o pgohelper ../PGOHelper.cpp ../../bin/pgohelperlib.so -pthread $(FSLIB) $(SDL2LIB) $(LIBEVDEVLIB)
%.o: %.c
$(CC) $(CCOPTIONS) -c $< -o $@
SevenZip/$(OBJFOLDER)/%.o: SevenZip/%.c
mkdir -p SevenZip/$(OBJFOLDER) && cd SevenZip/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst SevenZip/%, ../%, $<)
Lua/$(OBJFOLDER)/%.o: Lua/%.c
mkdir -p Lua/$(OBJFOLDER) && cd Lua/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst Lua/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/%.cpp
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/HQX/%.cpp
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/xBRZ/%.cpp
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/KreedSaiEagle/%.cpp
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/Scale2x/%.cpp
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
Core/$(OBJFOLDER)/%.o: Core/%.cpp
mkdir -p Core/$(OBJFOLDER) && cd Core/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Core/%, ../%, $<)
Linux/$(OBJFOLDER)/%.o: Linux/%.cpp
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Linux/%, ../%, $<) $(SDL2INC) $(LIBEVDEVINC)
Linux/$(OBJFOLDER)/%.o: Linux/libevdev/%.c
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst Linux/%, ../%, $<)
InteropDLL/$(OBJFOLDER)/%.o: InteropDLL/%.cpp
mkdir -p InteropDLL/$(OBJFOLDER) && cd InteropDLL/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst InteropDLL/%, ../%, $<)
%.o: %.cpp
$(CPPC) $(GCCOPTIONS) -c $< -o $@
InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(LUAOBJ) $(UTILOBJ) $(COREOBJ) $(LIBEVDEVOBJ) $(LINUXOBJ) $(DLLOBJ)
mkdir -p bin
mkdir -p InteropDLL/$(OBJFOLDER)
@ -168,6 +160,7 @@ run:
mono $(RELEASEFOLDER)/Mesen-S.exe
clean:
rm -r $(COREOBJ)
rm -rf Lua/$(OBJFOLDER)
rm -rf SevenZip/$(OBJFOLDER)
rm -rf Utilities/$(OBJFOLDER)