summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--makefile24
-rw-r--r--scripts/src/3rdparty.lua12
-rw-r--r--scripts/toolchain.lua29
3 files changed, 64 insertions, 1 deletions
diff --git a/makefile b/makefile
index 04d0a748baf..499d4ace282 100644
--- a/makefile
+++ b/makefile
@@ -296,6 +296,10 @@ ifeq ($(TARGETOS),freebsd)
OSD := sdl
endif
+ifeq ($(TARGETOS),netbsd)
+OSD := sdl
+endif
+
ifeq ($(TARGETOS),solaris)
OSD := sdl
endif
@@ -1005,6 +1009,26 @@ freebsd_x86: generate $(PROJECTDIR)/gmake-freebsd/Makefile
#-------------------------------------------------
+# gmake-netbsd
+#-------------------------------------------------
+
+
+$(PROJECTDIR)/gmake-netbsd/Makefile: makefile $(SCRIPTS) $(GENIE)
+ $(SILENT) $(GENIE) $(PARAMS) --gcc=netbsd --gcc_version=$(GCC_VERSION) gmake
+
+.PHONY: netbsd_x64
+netbsd_x64: generate $(PROJECTDIR)/gmake-netbsd/Makefile
+ $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)64
+
+.PHONY: netbsd
+netbsd: netbsd_x86
+
+.PHONY: netbsd_x86
+netbsd_x86: generate $(PROJECTDIR)/gmake-netbsd/Makefile
+ $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)32
+
+
+#-------------------------------------------------
# Clean/bootstrap
#-------------------------------------------------
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 889a6737cd5..5247517dce0 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -534,6 +534,13 @@ project "portmidi"
MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c",
}
end
+ if _OPTIONS["targetos"]=="netbsd" then
+ files {
+ MAME_DIR .. "3rdparty/portmidi/pm_linux/pmlinux.c",
+ MAME_DIR .. "3rdparty/portmidi/pm_linux/finddefault.c",
+ MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c",
+ }
+ end
if _OPTIONS["targetos"]=="macosx" then
files {
MAME_DIR .. "3rdparty/portmidi/pm_mac/pmmac.c",
@@ -591,6 +598,11 @@ project "bgfx"
MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
}
+ configuration { "netbsd" }
+ includedirs {
+ MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
+ }
+
configuration { "gmake" }
buildoptions {
"-Wno-uninitialized",
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua
index 91d1f29884e..589db7bc6fa 100644
--- a/scripts/toolchain.lua
+++ b/scripts/toolchain.lua
@@ -24,6 +24,7 @@ newoption {
{ "mingw-clang", "MinGW (clang compiler)" },
{ "nacl", "Native Client" },
{ "nacl-arm", "Native Client - ARM" },
+ { "netbsd", "NetBSD" },
{ "osx", "OSX (GCC compiler)" },
{ "osx-clang", "OSX (Clang compiler)" },
{ "pnacl", "Native Client - PNaCl" },
@@ -147,6 +148,10 @@ function toolchain(_buildDir, _subDir)
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-freebsd")
end
+ if "netbsd" == _OPTIONS["gcc"] then
+ location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-netbsd")
+ end
+
if "ios-arm" == _OPTIONS["gcc"] then
premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
@@ -590,7 +595,29 @@ function toolchain(_buildDir, _subDir)
configuration { "freebsd", "x64", "Debug" }
targetdir (_buildDir .. "freebsd" .. "/bin/x64/Debug")
-
+
+ configuration { "netbsd", "x32" }
+ objdir (_buildDir .. "netbsd" .. "/obj")
+ buildoptions {
+ "-m32",
+ }
+ configuration { "netbsd", "x32", "Release" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x32/Release")
+
+ configuration { "netbsd", "x32", "Debug" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x32/Debug")
+
+ configuration { "netbsd", "x64" }
+ objdir (_buildDir .. "netbsd" .. "/obj")
+ buildoptions {
+ "-m64",
+ }
+ configuration { "netbsd", "x64", "Release" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x64/Release")
+
+ configuration { "netbsd", "x64", "Debug" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x64/Debug")
+
configuration { "android-*" }
includedirs {
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",