summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--makefile25
-rw-r--r--scripts/genie.lua9
-rw-r--r--scripts/toolchain.lua41
3 files changed, 74 insertions, 1 deletions
diff --git a/makefile b/makefile
index b065c4480c8..4f88a0403d2 100644
--- a/makefile
+++ b/makefile
@@ -844,6 +844,7 @@ FULLTARGET := $(TARGET)$(SUBTARGET)
endif
PROJECTDIR := $(BUILDDIR)/projects/$(OSD)/$(FULLTARGET)
PROJECTDIR_MINI := $(BUILDDIR)/projects/osdmini/$(FULLTARGET)
+PROJECTDIR_SDL := $(BUILDDIR)/projects/sdl/$(FULLTARGET)
PROJECTDIR_WIN := $(BUILDDIR)/projects/windows/$(FULLTARGET)
.PHONY: all clean regenie generate
@@ -1307,6 +1308,30 @@ steamlink: generate $(PROJECTDIR)/gmake-steamlink/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-steamlink config=$(CONFIG)
#-------------------------------------------------
+# gmake-rpi
+#-------------------------------------------------
+
+$(PROJECTDIR_SDL)/gmake-rpi/Makefile: makefile $(SCRIPTS) $(GENIE)
+ifndef RASPBERRY_SDK_PATH
+ $(error RASPBERRY_SDK_PATH is not set)
+endif
+ifndef RASPBERRY_SYSROOT
+ $(error RASPBERRY_SYSROOT is not set)
+endif
+ $(SILENT) $(GENIE) $(PARAMS) --gcc=rpi --gcc_version=4.9.2 --osd=sdl --targetos=rpi --targetos=rpi --NO_USE_MIDI=1 --PLATFORM=arm --NOASM=1 --USE_QTDEBUG=0 --SDL_INSTALL_ROOT=$(RASPBERRY_SYSROOT)/usr gmake
+
+.PHONY: rpi
+ifndef RASPBERRY_SDK_PATH
+ $(error RASPBERRY_SDK_PATH is not set)
+endif
+ifndef RASPBERRY_SYSROOT
+ $(error RASPBERRY_SYSROOT is not set)
+endif
+rpi: generate $(PROJECTDIR_SDL)/gmake-rpi/Makefile
+ $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-rpi config=$(CONFIG) precompile
+ $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-rpi config=$(CONFIG)
+
+#-------------------------------------------------
# cmake
#-------------------------------------------------
.PHONY: cmake
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 0a7c79d5825..ff6872a5f36 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -114,6 +114,7 @@ newoption {
{ "haiku", "Haiku" },
{ "solaris", "Solaris SunOS" },
{ "steamlink", "Steam Link" },
+ { "rpi", "Raspberry Pi" },
},
}
@@ -1098,7 +1099,7 @@ configuration { "pnacl" }
}
archivesplit_size "20"
-configuration { "linux-*" }
+configuration { "linux-* or rpi"}
links {
"dl",
"rt",
@@ -1123,6 +1124,12 @@ configuration { "steamlink" }
"EGL_API_FB",
}
+configuration { "rpi" }
+ links {
+ "SDL2",
+ "fontconfig",
+ }
+
configuration { "osx* or xcode4" }
links {
"pthread",
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua
index 0181f14616f..072f4b214ea 100644
--- a/scripts/toolchain.lua
+++ b/scripts/toolchain.lua
@@ -245,6 +245,16 @@ function toolchain(_buildDir, _subDir)
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-steamlink")
end
+ if "rpi" == _OPTIONS["gcc"] then
+ if not os.getenv("RASPBERRY_SDK_PATH") then
+ print("Set RASPBERRY_SDK_PATH envrionment variable.")
+ end
+ premake.gcc.cc = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-gcc"
+ premake.gcc.cxx = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-g++"
+ premake.gcc.ar = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-ar"
+ location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi")
+ end
+
if "mingw32-gcc" == _OPTIONS["gcc"] then
if not os.getenv("MINGW32") then
print("Set MINGW32 envrionment variable.")
@@ -511,6 +521,37 @@ function toolchain(_buildDir, _subDir)
configuration { "steamlink", "Debug" }
targetdir (_buildDir .. "steamlink/bin/Debug")
+ configuration { "rpi" }
+ objdir ( _buildDir .. "rpi/obj")
+ libdirs {
+ "$(RASPBERRY_SYSROOT)/opt/vc/lib",
+ }
+ includedirs {
+ "$(RASPBERRY_SYSROOT)/opt/vc/include",
+ "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vcos/pthreads",
+ "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vmcs_host/linux",
+ }
+ links {
+ "rt",
+ }
+ linkoptions {
+ "-Wl,--gc-sections",
+ }
+ buildoptions {
+ "--sysroot=$(RASPBERRY_SYSROOT)",
+ }
+ linkoptions {
+ "-static-libgcc",
+ "-static-libstdc++",
+ "--sysroot=$(RASPBERRY_SYSROOT)",
+ }
+
+ configuration { "rpi", "Release" }
+ targetdir (_buildDir .. "rpi/bin/Release")
+
+ configuration { "rpi", "Debug" }
+ targetdir (_buildDir .. "rpi/bin/Debug")
+
configuration { "mingw-clang" }
linkoptions {
"-Wl,--allow-multiple-definition",