Refactor makefile

Refactor the makefile and move some code files to more logical places.
This commit is contained in:
Ilari Liusvaara 2012-02-06 04:38:53 +02:00
parent 29d94212a8
commit d45b316380
61 changed files with 490 additions and 226 deletions

3
.gitignore vendored
View file

@ -3,8 +3,11 @@
*.lib
*.obj
*.exe
*.ldflags
docs
rom
lsnes
*.util
/core
src/fonts/font.cpp
src/core/version.cpp

179
Makefile
View file

@ -1,178 +1,45 @@
CROSS_PREFIX=
EXECUTABLE_SUFFIX = exe
DOT_EXECUTABLE_SUFFIX=
OBJECT_SUFFIX = o
ARCHIVE_SUFFIX = a
FONT_SRC := unifontfull-5.1.20080820.hex
USER_CFLAGS=
USER_LDFLAGS=
#Compilers.
CC := g++
LD := ld
REALCC = $(CROSS_PREFIX)$(CC)
REALLD = $(CROSS_PREFIX)$(LD)
HOSTCC = $(CC)
#Flags.
HOSTCCFLAGS = -std=gnu++0x
CFLAGS = -I$(BSNES_PATH) -Iinclude -Iavi -std=gnu++0x
LDFLAGS = -lboost_iostreams -lboost_filesystem -lboost_system -lz
PLATFORM_CFLAGS =
PLATFORM_LDFLAGS =
CFLAGS = -I$(BSNES_PATH) -std=gnu++0x $(USER_CFLAGS)
LDFLAGS = -lboost_iostreams -lboost_filesystem -lboost_system -lz $(USER_LDFLAGS)
#Platform defs.
GRAPHICS = SDL
SOUND = SDL
JOYSTICK = SDL
#Platform
GRAPHICS=SDL
SOUND=SDL
JOYSTICK=SDL
THREADS=BOOST
#Core objects and what to build.
CORE_OBJECTS = $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/core/*.cpp)) \
$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard avi/*.cpp)) \
src/fonts/font.$(OBJECT_SUFFIX) src/core/version.$(OBJECT_SUFFIX)
PROGRAMS = lsnes.$(EXECUTABLE_SUFFIX) movieinfo.$(EXECUTABLE_SUFFIX) lsnes-dumpavi.$(EXECUTABLE_SUFFIX) sdmp2sox.$(EXECUTABLE_SUFFIX)
all: $(PROGRAMS)
#Platform objects.
PLATFORM_OBJECTS=
#Lua.
ifndef LUA
CFLAGS += -DNO_LUA
else
CORE_OBJECTS += $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/lua/*.cpp))
CFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --cflags)
LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --libs)
endif
#Threads
ifdef THREADS
ifeq ($(THREADS), YES)
CFLAGS += -DNATIVE_THREADS
else
ifeq ($(THREADS), BOOST)
CFLAGS += -DBOOST_THREADS
ifdef BOOST_THREAD_LIB
LDFLAGS += -l$(BOOST_THREAD_LIB)
else
LDFLAGS += -lboost_thread-mt
endif
else
$(error "Bad value for THREADS (expected YES or BOOST)")
endif
endif
endif
#Some misc defines.
ifdef BSNES_IS_COMPAT
CFLAGS += -DBSNES_IS_COMPAT
endif
#Joystick.
ifeq ($(JOYSTICK), SDL)
ifneq ($(GRAPHICS), SDL)
$(error "SDL Joystick requires SDL graphics")
endif
PLATFORM_OBJECTS += src/plat-sdl/joystick.$(OBJECT_SUFFIX)
else
ifeq ($(JOYSTICK), DUMMY)
CFLAGS += -DSDL_NO_JOYSTICK
PLATFORM_OBJECTS += src/plat-dummy/joystick.$(OBJECT_SUFFIX)
else
ifeq ($(JOYSTICK), EVDEV)
CFLAGS += -DSDL_NO_JOYSTICK
PLATFORM_OBJECTS += $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/plat-evdev/*.cpp))
else
$(error "Unsupported joystick type")
endif
endif
endif
export DOT_EXECUTABLE_SUFFIX OBJECT_SUFFIX ARCHIVE_SUFFIX FONT_SRC REALCC HOSTCC REALLD HOSTCCFLAGS CFLAGS LDFLAGS GRAPHICS SOUND JOYSTICK THREADS
#Sound stuff.
ifeq ($(SOUND), SDL)
ifneq ($(GRAPHICS), SDL)
$(error "SDL Sound requires SDL graphics")
endif
PLATFORM_OBJECTS += src/plat-sdl/sound.$(OBJECT_SUFFIX)
else
ifeq ($(SOUND), PORTAUDIO)
PLATFORM_OBJECTS += src/plat-portaudio/sound.$(OBJECT_SUFFIX)
PLATFORM_CFLAGS += $(shell $(CROSS_PREFIX)pkg-config portaudio-2.0 --cflags)
PLATFORM_LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config portaudio-2.0 --libs)
else
ifeq ($(SOUND), DUMMY)
PLATFORM_OBJECTS += src/plat-dummy/sound.$(OBJECT_SUFFIX)
else
$(error "Unsupported sound type")
endif
endif
endif
all: src/__all_files__
#Graphics stuff.
ifeq ($(GRAPHICS), SDL)
PLATFORM_OBJECTS += src/plat-sdl/commandline.$(OBJECT_SUFFIX) src/plat-sdl/drawprim.$(OBJECT_SUFFIX) src/plat-sdl/graphicsfn.$(OBJECT_SUFFIX) src/plat-sdl/keyboard.$(OBJECT_SUFFIX) src/plat-sdl/main.$(OBJECT_SUFFIX) src/plat-sdl/thread.$(OBJECT_SUFFIX) src/plat-sdl/status.$(OBJECT_SUFFIX) src/plat-sdl/thread.$(OBJECT_SUFFIX)
PLATFORM_CFLAGS += $(shell $(CROSS_PREFIX)sdl-config --cflags)
PLATFORM_LDFLAGS += $(shell $(CROSS_PREFIX)sdl-config --libs)
else
ifeq ($(GRAPHICS), WXWIDGETS)
PLATFORM_OBJECTS += $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/plat-wxwidgets/*.cpp))
PLATFORM_CFLAGS += $(shell $(CROSS_PREFIX)wx-config --cxxflags) $(shell $(CROSS_PREFIX)pkg-config libswscale --cflags)
PLATFORM_LDFLAGS += $(shell $(CROSS_PREFIX)wx-config --libs) $(shell $(CROSS_PREFIX)pkg-config libswscale --libs)
else
$(error "Unsupported graphics type")
endif
endif
CORE_CFLAGS=$(CFLAGS) $(USER_CFLAGS)
SUPPORT_CFLAGS=$(CORE_CFLAGS) $(PLATFORM_CFLAGS) $(USER_PLATFORM_CFLAGS)
CORE_LDFLAGS=$(BSNES_PATH)/out/libsnes.$(ARCHIVE_SUFFIX) $(LDFLAGS) $(USER_LDFLAGS)
SUPPORT_LDFLAGS=$(CORE_LDFLAGS) $(PLATFORM_LDFLAGS) $(USER_PLATFORM_LDFLAGS)
PLAT_DUMMY_OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/plat-dummy/*.cpp))
HOST_CFLAGS=$(HOSTCCFLAGS) $(USER_HOSTCCFLAGS)
HOST_LDFLAGS=$(HOSTLDFLAGS) $(USER_HOSTLDFLAGS)
.PRECIOUS: %
#Stuff compiled with core CFLAGS.
avi/%.$(OBJECT_SUFFIX): avi/%.cpp
$(REALCC) -c -o $@ $< $(CORE_CFLAGS)
src/core/%.$(OBJECT_SUFFIX): src/core/%.cpp
$(REALCC) -c -o $@ $< $(CORE_CFLAGS)
src/lua/%.$(OBJECT_SUFFIX): src/lua/%.cpp
$(REALCC) -c -o $@ $< $(CORE_CFLAGS)
src/plat-dummy/%.$(OBJECT_SUFFIX): src/plat-dummy/%.cpp
$(REALCC) -c -o $@ $< $(CORE_CFLAGS)
src/util/%.$(OBJECT_SUFFIX): src/util/%.cpp
$(REALCC) -c -o $@ $< $(CORE_CFLAGS)
#Platform stuff to be compiled with support CFLAGS.
src/plat-evdev/%.$(OBJECT_SUFFIX): src/plat-evdev/%.cpp
$(REALCC) -c -o $@ $< $(SUPPORT_CFLAGS)
src/plat-portaudio/%.$(OBJECT_SUFFIX): src/plat-portaudio/%.cpp
$(REALCC) -c -o $@ $< $(SUPPORT_CFLAGS)
src/plat-sdl/%.$(OBJECT_SUFFIX): src/plat-sdl/%.cpp
$(REALCC) -c -o $@ $< $(SUPPORT_CFLAGS)
src/plat-wxwidgets/%.$(OBJECT_SUFFIX): src/plat-wxwidgets/%.cpp
$(REALCC) -c -o $@ $< $(SUPPORT_CFLAGS)
#lsnes main executable.
lsnes.$(EXECUTABLE_SUFFIX): $(CORE_OBJECTS) $(PLATFORM_OBJECTS)
$(REALCC) -o $@ $^ $(SUPPORT_LDFLAGS)
#Other executables.
%.$(EXECUTABLE_SUFFIX): src/util/%.$(OBJECT_SUFFIX) $(CORE_OBJECTS) $(PLAT_DUMMY_OBJECTS)
$(REALCC) -o $@ $^ $(CORE_LDFLAGS)
#Fonts.
src/fonts/font.$(OBJECT_SUFFIX): src/fonts/$(FONT_SRC)
echo "extern const char* font_hex_data = " >src/fonts/font.cpp
sed -E -f src/fonts/fonttransform.sed <$^ >>src/fonts/font.cpp
echo ";" >>src/fonts/font.cpp
$(REALCC) $(CORE_CFLAGS) -c -o $@ src/fonts/font.cpp
#Version info.
buildaux/version.exe: buildaux/version.cpp VERSION
$(HOSTCC) $(HOSTCCFLAGS) -o $@ $<
src/core/version.cpp: buildaux/version.exe FORCE
buildaux/version.exe >$@
.PHONY: FORCE
src/__all_files__: forcelook
$(MAKE) -C src precheck
$(MAKE) -C src
cp src/lsnes$(DOT_EXECUTABLE_SUFFIX) .
clean:
rm -f $(PROGRAMS) src/*.$(OBJECT_SUFFIX) src/*/*.$(OBJECT_SUFFIX) avi/*.$(OBJECT_SUFFIX) src/fonts/font.o src/fonts/font.cpp
$(MAKE) -C src clean
forcelook:
@true

View file

@ -1,12 +1,6 @@
#ifndef _output_cscd__hpp__included__
#define _output_cscd__hpp__included__
#if defined(__linux__) && !defined(BOOST_THREADS)
#define NATIVE_THREADS 1
#endif
#ifdef NATIVE_THREADS
#include <thread>
#include <condition_variable>

83
src/Makefile Normal file
View file

@ -0,0 +1,83 @@
__all_files__: util/__all_files__ \
lsnes$(DOT_EXECUTABLE_SUFFIX) \
$(patsubst %.cpp,%.util$(DOT_EXECUTABLE_SUFFIX),$(wildcard util/*.cpp))
DUMMY_LIBRARY=core lua fonts video dummy
PLATFORM_LIBRARY=core lua fonts video plat-dummy plat-evdev plat-portaudio plat-sdl plat-wxwidgets
ALLOBJECT=__all__.$(OBJECT_SUFFIX)
ALLFLAGS=__all__.ldflags
DUMMY_LIBRARY_OBJS=$(patsubst %,%/$(ALLOBJECT),$(DUMMY_LIBRARY))
PLATFORM_LIBRARY_OBJS=$(patsubst %,%/$(ALLOBJECT),$(PLATFORM_LIBRARY))
DUMMY_LIBRARY_FLAGS=$(patsubst %,%/$(ALLFLAGS),$(DUMMY_LIBRARY))
PLATFORM_LIBRARY_FLAGS=$(patsubst %,%/$(ALLFLAGS),$(PLATFORM_LIBRARY))
core/$(ALLOBJECT): forcelook
$(MAKE) -C core
fonts/$(ALLOBJECT): forcelook
$(MAKE) -C fonts
lua/$(ALLOBJECT): forcelook
$(MAKE) -C lua
dummy/$(ALLOBJECT): forcelook
$(MAKE) -C dummy
plat-dummy/$(ALLOBJECT): forcelook
$(MAKE) -C plat-dummy
plat-evdev/$(ALLOBJECT): forcelook
$(MAKE) -C plat-evdev
plat-portaudio/$(ALLOBJECT): forcelook
$(MAKE) -C plat-portaudio
plat-sdl/$(ALLOBJECT): forcelook
$(MAKE) -C plat-sdl
plat-wxwidgets/$(ALLOBJECT): forcelook
$(MAKE) -C plat-wxwidgets
util/__all_files__: forcelook
$(MAKE) -C util
util/%.$(OBJECT_SUFFIX): util/__all_files__
@true;
video/$(ALLOBJECT): forcelook
$(MAKE) -C video
.PRECIOUS: %.$(OBJECT_SUFFIX) util/%.$(OBJECT_SUFFIX)
%.util$(DOT_EXECUTABLE_SUFFIX): %.$(OBJECT_SUFFIX) $(DUMMY_LIBRARY_OBJS)
$(REALCC) -o $@ $^ $(LDFLAGS) $(BSNES_PATH)/out/libsnes.a `cat $(DUMMY_LIBRARY_FLAGS)`
lsnes$(DOT_EXECUTABLE_SUFFIX): $(PLATFORM_LIBRARY_OBJS)
$(REALCC) -o $@ $^ $(LDFLAGS) $(BSNES_PATH)/out/libsnes.a `cat $(PLATFORM_LIBRARY_FLAGS)`
precheck:
$(MAKE) -C core precheck
$(MAKE) -C lua precheck
$(MAKE) -C plat-dummy precheck
$(MAKE) -C plat-evdev precheck
$(MAKE) -C plat-portaudio precheck
$(MAKE) -C plat-sdl precheck
$(MAKE) -C plat-wxwidgets precheck
$(MAKE) -C util precheck
$(MAKE) -C video precheck
clean:
rm -f *.ldflags
$(MAKE) -C core clean
$(MAKE) -C lua clean
$(MAKE) -C plat-dummy clean
$(MAKE) -C plat-evdev clean
$(MAKE) -C plat-portaudio clean
$(MAKE) -C plat-sdl clean
$(MAKE) -C plat-wxwidgets clean
$(MAKE) -C util clean
$(MAKE) -C video clean
forcelook:
@true

16
src/core/Makefile Normal file
View file

@ -0,0 +1,16 @@
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
touch __all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) $(CFLAGS) -c -o $@ $< -I../../include
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

View file

@ -2,7 +2,7 @@
#include "core/command.hpp"
#include "core/dispatch.hpp"
#include "core/globalwrap.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include <map>
#include <string>

View file

@ -1,7 +1,7 @@
#include "core/command.hpp"
#include "core/dispatch.hpp"
#include "core/framebuffer.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/misc.hpp"
#include "core/render.hpp"
#include "core/triplebuffer.hpp"

View file

@ -2,11 +2,10 @@
#include "core/dispatch.hpp"
#include "core/globalwrap.hpp"
#include "core/keymapper.hpp"
#include "core/lua.hpp"
#include "core/memorymanip.hpp"
#include "core/misc.hpp"
#include "core/window.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include <stdexcept>
#include <stdexcept>

View file

@ -7,7 +7,7 @@
#include "core/dispatch.hpp"
#include "core/framebuffer.hpp"
#include "core/framerate.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/mainloop.hpp"
#include "core/movie.hpp"
#include "core/moviedata.hpp"

View file

@ -7,7 +7,7 @@
#include "core/dispatch.hpp"
#include "core/framebuffer.hpp"
#include "core/framerate.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/misc.hpp"
#include "core/moviedata.hpp"
#include "core/rrdata.hpp"

16
src/dummy/Makefile Normal file
View file

@ -0,0 +1,16 @@
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
touch __all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

19
src/dummy/joystick.cpp Normal file
View file

@ -0,0 +1,19 @@
#include "core/window.hpp"
void joystick_plugin::init() throw()
{
}
void joystick_plugin::quit() throw()
{
}
void joystick_plugin::thread_fn() throw()
{
}
void joystick_plugin::signal() throw()
{
}
const char* joystick_plugin::name = "Dummy joystick plugin";

46
src/dummy/sound.cpp Normal file
View file

@ -0,0 +1,46 @@
#include "core/command.hpp"
#include "core/window.hpp"
#include <cstdlib>
#include <iostream>
void sound_plugin::init() throw()
{
}
void sound_plugin::quit() throw()
{
}
void sound_plugin::enable(bool enable) throw()
{
}
void sound_plugin::sample(uint16_t left, uint16_t right) throw()
{
}
bool sound_plugin::initialized()
{
return true;
}
void sound_plugin::set_device(const std::string& dev) throw(std::bad_alloc, std::runtime_error)
{
if(dev != "null")
throw std::runtime_error("Bad sound device '" + dev + "'");
}
std::string sound_plugin::get_device() throw(std::bad_alloc)
{
return "null";
}
std::map<std::string, std::string> sound_plugin::get_devices() throw(std::bad_alloc)
{
std::map<std::string, std::string> ret;
ret["null"] = "NULL sound output";
return ret;
}
const char* sound_plugin::name = "Dummy sound plugin";

23
src/fonts/Makefile Normal file
View file

@ -0,0 +1,23 @@
OBJECTS=font.$(OBJECT_SUFFIX)
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
touch __all__.ldflags
.PRECIOUS: font.$(OBJECT_SUFFIX) font.cpp
font.$(OBJECT_SUFFIX): font.cpp
$(REALCC) $(CORE_CFLAGS) -c -o $@ font.cpp
font.cpp : $(FONT_SRC)
echo "extern const char* font_hex_data = " >font.cpp
sed -E -f fonttransform.sed <$^ >>font.cpp
echo ";" >>font.cpp
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) font.cpp *.ldflags

24
src/lua/Makefile Normal file
View file

@ -0,0 +1,24 @@
ifndef LUA
CFLAGS += -DNO_LUA
OBJECTS = dummy.$(OBJECT_SUFFIX)
else
OBJECTS = $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard src/lua/*.cpp))
LUA_CFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --cflags)
LUA_LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --libs)
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
echo $(LUA_LDFLAGS) >__all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS) $(LUA_CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#define BITWISE_BITS 48
#define BITWISE_MASK ((1ULL << (BITWISE_BITS)) - 1)
@ -115,4 +115,4 @@ namespace
lua_shifter<shift_lshift> bit_lshift("bit.lshift");
lua_shifter<shift_arshift> bit_arshift("bit.arshift");
lua_shifter<shift_lrshift> bit_lrshift("bit.lrshift");
}
}

View file

@ -1,5 +1,5 @@
#include "core/command.hpp"
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/window.hpp"
namespace

28
src/lua/dummy.cpp Normal file
View file

@ -0,0 +1,28 @@
#include "lua/lua.hpp"
#ifdef NO_LUA
struct lua_State { int x; };
lua_function::lua_function(const std::string& name) throw(std::bad_alloc) {}
lua_function::~lua_function() throw() {}
void lua_callback_do_paint(struct lua_render_context* ctx) throw() {}
void lua_callback_do_video(struct lua_render_context* ctx) throw() {}
void lua_callback_do_input(controller_frame& data, bool subframe) throw() {}
void lua_callback_do_reset() throw() {}
void lua_callback_do_frame() throw() {}
void lua_callback_do_readwrite() throw() {}
void lua_callback_startup() throw() {}
void lua_callback_pre_load(const std::string& name) throw() {}
void lua_callback_err_load(const std::string& name) throw() {}
void lua_callback_post_load(const std::string& name, bool was_state) throw() {}
void lua_callback_pre_save(const std::string& name, bool is_state) throw() {}
void lua_callback_err_save(const std::string& name) throw() {}
void lua_callback_post_save(const std::string& name, bool is_state) throw() {}
void lua_callback_snoop_input(uint32_t port, uint32_t controller, uint32_t index, short value) throw() {}
void lua_callback_quit() throw() {}
void lua_callback_keyhook(const std::string& key, const struct keygroup::parameters& p) throw() {}
void init_lua() throw() {}
void quit_lua() throw() {}
bool lua_requests_repaint = false;
bool lua_requests_subframe_paint = false;
bool lua_supported = false;
#endif

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/render.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/window.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/render.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/render.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/render.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/render.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/render.hpp"
namespace

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/moviedata.hpp"
namespace

View file

@ -1,5 +1,5 @@
#include "core/keymapper.hpp"
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
namespace
{

View file

@ -1,35 +1,7 @@
#include "core/lua.hpp"
#ifdef NO_LUA
struct lua_State { int x; };
lua_function::lua_function(const std::string& name) throw(std::bad_alloc) {}
lua_function::~lua_function() throw() {}
void lua_callback_do_paint(struct lua_render_context* ctx) throw() {}
void lua_callback_do_video(struct lua_render_context* ctx) throw() {}
void lua_callback_do_input(controller_frame& data, bool subframe) throw() {}
void lua_callback_do_reset() throw() {}
void lua_callback_do_frame() throw() {}
void lua_callback_do_readwrite() throw() {}
void lua_callback_startup() throw() {}
void lua_callback_pre_load(const std::string& name) throw() {}
void lua_callback_err_load(const std::string& name) throw() {}
void lua_callback_post_load(const std::string& name, bool was_state) throw() {}
void lua_callback_pre_save(const std::string& name, bool is_state) throw() {}
void lua_callback_err_save(const std::string& name) throw() {}
void lua_callback_post_save(const std::string& name, bool is_state) throw() {}
void lua_callback_snoop_input(uint32_t port, uint32_t controller, uint32_t index, short value) throw() {}
void lua_callback_quit() throw() {}
void lua_callback_keyhook(const std::string& key, const struct keygroup::parameters& p) throw() {}
void init_lua() throw() {}
void quit_lua() throw() {}
bool lua_requests_repaint = false;
bool lua_requests_subframe_paint = false;
bool lua_supported = false;
#else
#include "core/command.hpp"
#include "core/globalwrap.hpp"
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "lua/lua.hpp"
#include "core/mainloop.hpp"
#include "core/memorymanip.hpp"
#include "core/misc.hpp"
@ -531,4 +503,3 @@ void quit_lua() throw()
bool lua_requests_repaint = false;
bool lua_requests_subframe_paint = false;
bool lua_supported = true;
#endif

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/memorymanip.hpp"
#include "core/rom.hpp"

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/movie.hpp"
#include "core/moviedata.hpp"

View file

@ -1,5 +1,5 @@
#include "core/framebuffer.hpp"
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
namespace
{

View file

@ -1,4 +1,4 @@
#include "core/lua-int.hpp"
#include "lua/internal.hpp"
#include "core/settings.hpp"
namespace

22
src/plat-dummy/Makefile Normal file
View file

@ -0,0 +1,22 @@
OBJECTS=dummy.$(OBJECT_SUFFIX)
ifeq ($(SOUND),DUMMY)
OBJECTS += sound.$(OBJECT_SUFFIX)
endif
ifeq ($(JOYSTICK),DUMMY)
OBJECTS += joystick.$(OBJECT_SUFFIX)
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
touch __all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

0
src/plat-dummy/dummy.cpp Normal file
View file

20
src/plat-evdev/Makefile Normal file
View file

@ -0,0 +1,20 @@
ifeq ($(JOYSTICK), EVDEV)
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
else
OBJECTS=dummy.$(OBJECT_SUFFIX)
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
touch __all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

0
src/plat-evdev/dummy.cpp Normal file
View file

View file

@ -0,0 +1,23 @@
ifeq ($(SOUND), PORTAUDIO)
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
PA_CFLAGS += $(shell $(CROSS_PREFIX)pkg-config portaudio-2.0 --cflags)
PA_LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config portaudio-2.0 --libs)
else
OBJECTS = dummy.$(OBJECT_SUFFIX)
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
echo $(PA_LDFLAGS) >__all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS) $(PA_CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

View file

36
src/plat-sdl/Makefile Normal file
View file

@ -0,0 +1,36 @@
ifeq ($(GRAPHICS), SDL)
OBJECTS = commandline.$(OBJECT_SUFFIX) drawprim.$(OBJECT_SUFFIX) graphicsfn.$(OBJECT_SUFFIX) keyboard.$(OBJECT_SUFFIX) main.$(OBJECT_SUFFIX) thread.$(OBJECT_SUFFIX) status.$(OBJECT_SUFFIX)
SDL_CFLAGS += $(shell $(CROSS_PREFIX)sdl-config --cflags)
SDL_LDFLAGS += $(shell $(CROSS_PREFIX)sdl-config --libs)
else
OBJECTS = dummy.$(OBJECT_SUFFIX)
endif
ifeq ($(SOUND), SDL)
ifneq ($(GRAPHICS), SDL)
$(error "SDL sound requires SDL graphics")
endif
OBJECTS += sound.$(OBJECT_SUFFIX)
endif
ifeq ($(JOYSTICK), SDL)
ifneq ($(GRAPHICS), SDL)
$(error "SDL joystick requires SDL graphics")
endif
OBJECTS += joystick.$(OBJECT_SUFFIX)
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
echo $(SDL_LDFLAGS) >__all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS) $(SDL_CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

0
src/plat-sdl/dummy.cpp Normal file
View file

View file

@ -5,7 +5,7 @@
#include "core/command.hpp"
#include "core/framerate.hpp"
#include "core/keymapper.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/mainloop.hpp"
#include "core/misc.hpp"
#include "core/moviedata.hpp"

View file

@ -0,0 +1,23 @@
ifeq ($(GRAPHICS), WXWIDGETS)
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
WXW_CFLAGS += $(shell $(CROSS_PREFIX)wx-config --cxxflags) $(shell $(CROSS_PREFIX)pkg-config libswscale --cflags)
WXW_LDFLAGS += $(shell $(CROSS_PREFIX)wx-config --libs) $(shell $(CROSS_PREFIX)pkg-config libswscale --libs)
else
OBJECTS = dummy.$(OBJECT_SUFFIX)
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
echo $(WXW_LDFLAGS) >__all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS) $(WXW_CFLAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

View file

View file

@ -9,7 +9,7 @@
#include "core/controller.hpp"
#include "core/dispatch.hpp"
#include "core/framerate.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/mainloop.hpp"
#include "core/misc.hpp"
#include "core/moviedata.hpp"

View file

@ -6,7 +6,7 @@
#include "core/dispatch.hpp"
#include "core/framebuffer.hpp"
#include "core/framerate.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/mainloop.hpp"
#include "core/memorywatch.hpp"
#include "core/misc.hpp"

16
src/util/Makefile Normal file
View file

@ -0,0 +1,16 @@
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all_files__: $(OBJECTS)
@true
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) -c -o $@ $< -I../../include $(CFLAGS)
touch $(patsubst %.$(OBJECT_SUFFIX),%.ldflags,$^)
precheck:
@true
clean:
rm -f $(OBJECTS) *.ldflags

View file

@ -7,7 +7,7 @@
#include "core/dispatch.hpp"
#include "core/framerate.hpp"
#include "core/keymapper.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/mainloop.hpp"
#include "core/misc.hpp"
#include "core/moviedata.hpp"

35
src/video/Makefile Normal file
View file

@ -0,0 +1,35 @@
OBJECTS=$(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(wildcard *.cpp))
#Threads
ifdef THREADS
ifeq ($(THREADS), NATIVE)
VIDEO_CFLAGS += -DNATIVE_THREADS
else
ifeq ($(THREADS), BOOST)
VIDEO_CFLAGS += -DBOOST_THREADS
ifdef BOOST_THREAD_LIB
VIDEO_LDFLAGS += -l$(BOOST_THREAD_LIB)
else
VIDEO_LDFLAGS += -lboost_thread-mt
endif
else
$(error "Bad value for THREADS (expected NATIVE or BOOST)")
endif
endif
endif
.PRECIOUS: %.$(OBJECT_SUFFIX)
__all__.$(OBJECT_SUFFIX): $(OBJECTS)
$(REALLD) -r -o $@ $^
echo $(VIDEO_LDFLAGS) >__all__.ldflags
%.$(OBJECT_SUFFIX): %.cpp
$(REALCC) $(CFLAGS) -c -o $@ $< -I../../include $(VIDEO_CLFAGS)
precheck:
@true
clean:
rm -f *.$(OBJECT_SUFFIX) *.ldflags

View file

@ -1,4 +1,4 @@
#include "avi_structure.hpp"
#include "video/avi_structure.hpp"
#include "library/serialization.hpp"
#include <cstring>

View file

@ -1,9 +1,9 @@
#include "cscd.hpp"
#include "sox.hpp"
#include "video/cscd.hpp"
#include "video/sox.hpp"
#include "core/advdumper.hpp"
#include "core/dispatch.hpp"
#include "core/lua.hpp"
#include "lua/lua.hpp"
#include "core/misc.hpp"
#include "core/settings.hpp"

View file

@ -1,4 +1,4 @@
#include "cscd.hpp"
#include "video/cscd.hpp"
#include <zlib.h>
#include <cstring>
#include <iomanip>
@ -7,7 +7,7 @@
#include <vector>
#include <iostream>
#include <list>
#include "avi_structure.hpp"
#include "video/avi_structure.hpp"
#include "library/serialization.hpp"
#define AVI_CUTOFF_SIZE 2100000000

View file

@ -1,4 +1,4 @@
#include "sox.hpp"
#include "video/sox.hpp"
#include <iostream>