mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Added support for Raspberry Pi cross-compile (nw)
This commit is contained in:
parent
d2fe9e454b
commit
6590600990
25
makefile
25
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
|
||||
@ -1306,6 +1307,30 @@ steamlink: generate $(PROJECTDIR)/gmake-steamlink/Makefile
|
||||
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-steamlink config=$(CONFIG) precompile
|
||||
$(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
|
||||
#-------------------------------------------------
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user