diff --git a/Makefile b/Makefile index 1235e14..07e0d72 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,6 @@ all: @rake $@ -.PHONY: library -library: - @rake $@ - -.PHONY: gui -gui: - @rake $@ - .PHONY: test test: @rake $@ diff --git a/Rakefile.rb b/Rakefile.rb index 3821f82..ba44d73 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -9,19 +9,12 @@ GTEST_VERSION = "1.7.0" base_env = Rscons::Environment.new do |env| env.build_root = "build" - env["CPPPATH"] << "src/lib/include" env["CCFLAGS"] += ["-Wall", "-O2"] env["CFLAGS"] << "-std=gnu99" env["CXXFLAGS"] << "-std=gnu++11" end -task :library do - base_env.clone(clone: :all) do |env| - env.Library("lib/lib#{NAME}.a", Dir["src/lib/**/*.{cc,c}"]) - end -end - -task :gui => :library do +task :default do base_env.clone(clone: :all) do |env| env.parse_flags!("!sdl2-config --cflags --libs") env.parse_flags!("!freetype-config --cflags --libs") @@ -31,18 +24,19 @@ task :gui => :library do else env["LIBS"] += ["GL"] end - env.Program("bin/jes", Dir["src/gui/**/*.{cc,c}", "lib/lib#{NAME}.a"]) + env.Program("bin/jes", Dir["src/**/*.{cc,c}"]) end end -task :test => :library do +task :test => :default do base_env.clone(clone: :all) do |env| + env["CPPPATH"] << "src" env["CPPPATH"] << "gtest-#{GTEST_VERSION}/include" env["CPPPATH"] << "gtest-#{GTEST_VERSION}" sources = Dir["gtest-#{GTEST_VERSION}/src/gtest-all.cc", "gtest-#{GTEST_VERSION}/src/gtest_main.cc", - "test/src/**/*.cc", - "lib/lib#{NAME}.a"] + "src/**/*.{cc,c}", + "test/src/**/*.cc"] env.Program("build/tests", sources) if RUBY_PLATFORM =~ /linux/ env["LIBS"] << "pthread" @@ -51,9 +45,7 @@ task :test => :library do system("./build/tests") end -task :default => :all - -task :all => [:library, :gui] +task :all => :default task :clean do Rscons.clean diff --git a/src/lib/src/Core.cc b/src/Core.cc similarity index 87% rename from src/lib/src/Core.cc rename to src/Core.cc index e01354f..d9104bb 100644 --- a/src/lib/src/Core.cc +++ b/src/Core.cc @@ -1,4 +1,4 @@ -#include "jes/Core.h" +#include "Core.h" namespace jes { diff --git a/src/lib/include/jes/Core.h b/src/Core.h similarity index 90% rename from src/lib/include/jes/Core.h rename to src/Core.h index 40ca056..10cb299 100644 --- a/src/lib/include/jes/Core.h +++ b/src/Core.h @@ -1,8 +1,8 @@ #ifndef JES_CORE_H #define JES_CORE_H -#include "jes/Ref.h" -#include "jes/Path.h" +#include "Ref.h" +#include "Path.h" #include #ifdef _WIN32 diff --git a/src/lib/src/FileLoader.cc b/src/FileLoader.cc similarity index 96% rename from src/lib/src/FileLoader.cc rename to src/FileLoader.cc index 05c0345..d6ce454 100644 --- a/src/lib/src/FileLoader.cc +++ b/src/FileLoader.cc @@ -1,7 +1,6 @@ -#include "jes.h" -#include "jes/FileLoader.h" -#include "jes/FileReader.h" -#include "jes/Text.h" +#include "FileLoader.h" +#include "FileReader.h" +#include "Text.h" #include #include #include diff --git a/src/lib/include/jes/FileLoader.h b/src/FileLoader.h similarity index 96% rename from src/lib/include/jes/FileLoader.h rename to src/FileLoader.h index 1d0cf13..807cdcb 100644 --- a/src/lib/include/jes/FileLoader.h +++ b/src/FileLoader.h @@ -1,8 +1,8 @@ #ifndef JES_FILELOADER_H #define JES_FILELOADER_H -#include "jes/Ref.h" -#include "jes/Text.h" +#include "Ref.h" +#include "Text.h" #include #include diff --git a/src/lib/src/FileReader.cc b/src/FileReader.cc similarity index 96% rename from src/lib/src/FileReader.cc rename to src/FileReader.cc index 76f3aa1..d6c00c4 100644 --- a/src/lib/src/FileReader.cc +++ b/src/FileReader.cc @@ -1,5 +1,4 @@ -#include "jes.h" -#include "jes/FileReader.h" +#include "FileReader.h" #include #include #include diff --git a/src/lib/include/jes/FileReader.h b/src/FileReader.h similarity index 86% rename from src/lib/include/jes/FileReader.h rename to src/FileReader.h index 430827d..019e046 100644 --- a/src/lib/include/jes/FileReader.h +++ b/src/FileReader.h @@ -1,7 +1,8 @@ #ifndef JES_FILEREADER_H #define JES_FILEREADER_H -#include "jes/Ref.h" +#include "Core.h" +#include "Ref.h" #include namespace jes diff --git a/src/gui/Font.cc b/src/Font.cc similarity index 100% rename from src/gui/Font.cc rename to src/Font.cc diff --git a/src/gui/Font.h b/src/Font.h similarity index 98% rename from src/gui/Font.h rename to src/Font.h index 9348461..8d71d5f 100644 --- a/src/gui/Font.h +++ b/src/Font.h @@ -1,7 +1,7 @@ #ifndef JES_FONT_H #define JES_FONT_H -#include "jes/Ref.h" +#include "Ref.h" #include #include FT_FREETYPE_H #include "gl3w.h" diff --git a/src/gui/FontManager.cc b/src/FontManager.cc similarity index 97% rename from src/gui/FontManager.cc rename to src/FontManager.cc index 4e031fb..817ab05 100644 --- a/src/gui/FontManager.cc +++ b/src/FontManager.cc @@ -1,5 +1,5 @@ #include "FontManager.h" -#include "jes/Runtime.h" +#include "Runtime.h" #include namespace jes diff --git a/src/gui/FontManager.h b/src/FontManager.h similarity index 95% rename from src/gui/FontManager.h rename to src/FontManager.h index 0dfed44..58d1334 100644 --- a/src/gui/FontManager.h +++ b/src/FontManager.h @@ -1,7 +1,7 @@ #ifndef JES_FONTMANAGER_H #define JES_FONTMANAGER_H -#include "jes/Ref.h" +#include "Ref.h" #include "Font.h" #include #include FT_FREETYPE_H diff --git a/src/gui/GLBuffer.cc b/src/GLBuffer.cc similarity index 100% rename from src/gui/GLBuffer.cc rename to src/GLBuffer.cc diff --git a/src/gui/GLBuffer.h b/src/GLBuffer.h similarity index 96% rename from src/gui/GLBuffer.h rename to src/GLBuffer.h index ea91f8d..87bd243 100644 --- a/src/gui/GLBuffer.h +++ b/src/GLBuffer.h @@ -1,8 +1,8 @@ #ifndef GLBUFFER_H #define GLBUFFER_H +#include "Ref.h" #include "gl3w.h" -#include "jes.h" namespace jes { diff --git a/src/gui/GLProgram.cc b/src/GLProgram.cc similarity index 100% rename from src/gui/GLProgram.cc rename to src/GLProgram.cc diff --git a/src/gui/GLProgram.h b/src/GLProgram.h similarity index 96% rename from src/gui/GLProgram.h rename to src/GLProgram.h index ca5c143..e7ba0a9 100644 --- a/src/gui/GLProgram.h +++ b/src/GLProgram.h @@ -1,7 +1,7 @@ #ifndef GLPROGRAM_H #define GLPROGRAM_H -#include "jes/Ref.h" +#include "Ref.h" #include "GLShader.h" #include #include diff --git a/src/gui/GLShader.cc b/src/GLShader.cc similarity index 100% rename from src/gui/GLShader.cc rename to src/GLShader.cc diff --git a/src/gui/GLShader.h b/src/GLShader.h similarity index 91% rename from src/gui/GLShader.h rename to src/GLShader.h index e440754..9598fd4 100644 --- a/src/gui/GLShader.h +++ b/src/GLShader.h @@ -1,8 +1,8 @@ #ifndef GLSHADER_H #define GLSHADER_H -#include "jes/Ref.h" -#include "jes/Path.h" +#include "Ref.h" +#include "Path.h" #include "gl3w.h" namespace jes diff --git a/src/gui/GLTexture.cc b/src/GLTexture.cc similarity index 100% rename from src/gui/GLTexture.cc rename to src/GLTexture.cc diff --git a/src/gui/GLTexture.h b/src/GLTexture.h similarity index 96% rename from src/gui/GLTexture.h rename to src/GLTexture.h index 34c8fd2..b724ccd 100644 --- a/src/gui/GLTexture.h +++ b/src/GLTexture.h @@ -1,7 +1,7 @@ #ifndef GLTEXTURE_H #define GLTEXTURE_H -#include "jes/Ref.h" +#include "Ref.h" #include "gl3w.h" #include diff --git a/src/gui/GUI.cc b/src/GUI.cc similarity index 99% rename from src/gui/GUI.cc rename to src/GUI.cc index 4f593f3..e0b3599 100644 --- a/src/gui/GUI.cc +++ b/src/GUI.cc @@ -1,7 +1,7 @@ #include "GUI.h" #include "gl3w.h" #include -#include "jes/Runtime.h" +#include "Runtime.h" #define WIDTH 500 #define HEIGHT 500 diff --git a/src/gui/GUI.h b/src/GUI.h similarity index 97% rename from src/gui/GUI.h rename to src/GUI.h index cd6e501..dd4099b 100644 --- a/src/gui/GUI.h +++ b/src/GUI.h @@ -1,7 +1,7 @@ #ifndef JES_GUI_H #define JES_GUI_H -#include "jes/Ref.h" +#include "Ref.h" #include #include "FontManager.h" #include "GLProgram.h" diff --git a/src/lib/src/Path.cc b/src/Path.cc similarity index 98% rename from src/lib/src/Path.cc rename to src/Path.cc index 2c31ba9..1f5acf7 100644 --- a/src/lib/src/Path.cc +++ b/src/Path.cc @@ -1,5 +1,5 @@ -#include "jes/Path.h" -#include "jes/FileReader.h" +#include "Path.h" +#include "FileReader.h" #include #include #include diff --git a/src/lib/include/jes/Path.h b/src/Path.h similarity index 96% rename from src/lib/include/jes/Path.h rename to src/Path.h index 0b06453..daa2b1b 100644 --- a/src/lib/include/jes/Path.h +++ b/src/Path.h @@ -1,7 +1,7 @@ #ifndef JES_PATH_H #define JES_PATH_H -#include "jes/Ref.h" +#include "Ref.h" #include #include #include diff --git a/src/lib/include/jes/Ref.h b/src/Ref.h similarity index 100% rename from src/lib/include/jes/Ref.h rename to src/Ref.h diff --git a/src/lib/src/Runtime.cc b/src/Runtime.cc similarity index 98% rename from src/lib/src/Runtime.cc rename to src/Runtime.cc index 924e5b8..46424ae 100644 --- a/src/lib/src/Runtime.cc +++ b/src/Runtime.cc @@ -1,4 +1,4 @@ -#include "jes/Runtime.h" +#include "Runtime.h" namespace jes { diff --git a/src/lib/include/jes/Runtime.h b/src/Runtime.h similarity index 86% rename from src/lib/include/jes/Runtime.h rename to src/Runtime.h index c90b246..70a4633 100644 --- a/src/lib/include/jes/Runtime.h +++ b/src/Runtime.h @@ -1,8 +1,8 @@ #ifndef JES_RUNTIME_H #define JES_RUNTIME_H -#include "jes/Core.h" -#include "jes/Path.h" +#include "Core.h" +#include "Path.h" namespace jes { diff --git a/src/lib/src/Text.cc b/src/Text.cc similarity index 97% rename from src/lib/src/Text.cc rename to src/Text.cc index abf62fb..c29c005 100644 --- a/src/lib/src/Text.cc +++ b/src/Text.cc @@ -1,4 +1,4 @@ -#include "jes/Text.h" +#include "Text.h" #include namespace jes diff --git a/src/lib/include/jes/Text.h b/src/Text.h similarity index 96% rename from src/lib/include/jes/Text.h rename to src/Text.h index 2f39756..624ba0a 100644 --- a/src/lib/include/jes/Text.h +++ b/src/Text.h @@ -2,7 +2,7 @@ #define JES_TEXT_H #include -#include "jes/Ref.h" +#include "Ref.h" #include namespace jes diff --git a/src/gui/gl3w.c b/src/gl3w.c similarity index 100% rename from src/gui/gl3w.c rename to src/gl3w.c diff --git a/src/gui/gl3w.h b/src/gl3w.h similarity index 100% rename from src/gui/gl3w.h rename to src/gl3w.h diff --git a/src/gui/glcorearb.h b/src/glcorearb.h similarity index 100% rename from src/gui/glcorearb.h rename to src/glcorearb.h diff --git a/src/lib/include/jes.h b/src/lib/include/jes.h deleted file mode 100644 index 834b649..0000000 --- a/src/lib/include/jes.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef JES_H -#define JES_H - -#include "jes/Core.h" -#include "jes/Ref.h" - -namespace jes -{ - static inline void JES_Init(const std::string & bin_path) - { - Core::instance.init(bin_path); - } -} - -#endif diff --git a/src/gui/main.cc b/src/main.cc similarity index 92% rename from src/gui/main.cc rename to src/main.cc index 16eadb4..481aea7 100644 --- a/src/gui/main.cc +++ b/src/main.cc @@ -1,7 +1,7 @@ #include #include "GUI.h" -#include "jes.h" +#include "Core.h" using namespace std;