From 204f932ed276cd6abde0d03523d32fabc3fa3d26 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 20 Aug 2016 12:40:13 +0200 Subject: [PATCH] Raspberry Pi backend now builds. --- build.lua | 2 ++ mach/proto/as/build.lua | 5 ++++- mach/vc4/libem/build.lua | 8 ++++++++ mach/vc4/libend/build.lua | 8 ++++++++ plat/rpi/build-pkg.lua | 25 +++++++++++++++++++++++++ plat/rpi/build-tools.lua | 21 +++++++++++++++++++++ plat/rpi/include/build.lua | 27 +++++++++++++++++++++++++++ plat/rpi/libsys/build.lua | 15 +++++++++++++++ 8 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 mach/vc4/libem/build.lua create mode 100644 mach/vc4/libend/build.lua create mode 100644 plat/rpi/build-pkg.lua create mode 100644 plat/rpi/build-tools.lua create mode 100644 plat/rpi/include/build.lua create mode 100644 plat/rpi/libsys/build.lua diff --git a/build.lua b/build.lua index dc2178fb8..24dcb39b4 100644 --- a/build.lua +++ b/build.lua @@ -9,6 +9,7 @@ vars.plats = { "linux386", "linux68k", "pc86", + "rpi", } installable { @@ -21,6 +22,7 @@ installable { "plat/cpm+pkg", "plat/linux386+pkg", "plat/linux68k+pkg", + "plat/rpi+pkg", "plat/pc86+pkg", "util/ack+pkg", "util/amisc+pkg", diff --git a/mach/proto/as/build.lua b/mach/proto/as/build.lua index 37f6cd336..6d846682e 100644 --- a/mach/proto/as/build.lua +++ b/mach/proto/as/build.lua @@ -10,7 +10,10 @@ definerule("build_as", local archlib = clibrary { name = e.name.."/archlib", srcs = {}, - hdrs = { "mach/"..e.arch.."/as/mach*.c" } + hdrs = { + "mach/"..e.arch.."/as/mach*.c", + "mach/"..e.arch.."/as/*.h" + } } local preprocessedy = cppfile { diff --git a/mach/vc4/libem/build.lua b/mach/vc4/libem/build.lua new file mode 100644 index 000000000..ca5a13c65 --- /dev/null +++ b/mach/vc4/libem/build.lua @@ -0,0 +1,8 @@ +for _, plat in ipairs(vars.plats) do + acklibrary { + name = "lib_"..plat, + srcs = { "./*.s" }, + vars = { plat = plat }, + } +end + diff --git a/mach/vc4/libend/build.lua b/mach/vc4/libend/build.lua new file mode 100644 index 000000000..ca5a13c65 --- /dev/null +++ b/mach/vc4/libend/build.lua @@ -0,0 +1,8 @@ +for _, plat in ipairs(vars.plats) do + acklibrary { + name = "lib_"..plat, + srcs = { "./*.s" }, + vars = { plat = plat }, + } +end + diff --git a/plat/rpi/build-pkg.lua b/plat/rpi/build-pkg.lua new file mode 100644 index 000000000..b6bc4ab56 --- /dev/null +++ b/plat/rpi/build-pkg.lua @@ -0,0 +1,25 @@ +include("plat/build.lua") + +ackfile { + name = "boot", + srcs = { "./boot.s" }, + vars = { plat = "rpi" } +} + +build_plat_libs { + name = "libs", + arch = "vc4", + plat = "rpi", +} + +installable { + name = "pkg", + map = { + "+tools", + "+libs", + "./include+pkg", + ["$(PLATIND)/rpi/boot.o"] = "+boot", + ["$(PLATIND)/rpi/libsys.a"] = "./libsys+lib", + } +} + diff --git a/plat/rpi/build-tools.lua b/plat/rpi/build-tools.lua new file mode 100644 index 000000000..eb3cbfef2 --- /dev/null +++ b/plat/rpi/build-tools.lua @@ -0,0 +1,21 @@ +include("plat/build.lua") + +build_as { + name = "as", + arch = "vc4", +} + +build_ncg { + name = "ncg", + arch = "vc4", +} + +return installable { + name = "tools", + map = { + ["$(PLATDEP)/rpi/as"] = "+as", + ["$(PLATDEP)/rpi/ncg"] = "+ncg", + ["$(PLATIND)/descr/rpi"] = "./descr", + "util/opt+pkg", + } +} diff --git a/plat/rpi/include/build.lua b/plat/rpi/include/build.lua new file mode 100644 index 000000000..4e6b8521b --- /dev/null +++ b/plat/rpi/include/build.lua @@ -0,0 +1,27 @@ +include("plat/build.lua") + +headermap = {} +packagemap = {} + +local function addheader(h) + headermap[h] = "./"..h + packagemap["$(PLATIND)/rpi/include/"..h] = "./"..h +end + +addheader("ack/config.h") +addheader("pi.h") +addheader("sys/select.h") +addheader("termios.h") +addheader("unistd.h") + +acklibrary { + name = "headers", + hdrs = headermap +} + +installable { + name = "pkg", + map = packagemap +} + + diff --git a/plat/rpi/libsys/build.lua b/plat/rpi/libsys/build.lua new file mode 100644 index 000000000..db579d41b --- /dev/null +++ b/plat/rpi/libsys/build.lua @@ -0,0 +1,15 @@ +acklibrary { + name = "lib", + srcs = { + "./*.c", + "./*.s", + }, + deps = { + "lang/cem/libcc.ansi/headers+headers", + "plat/rpi/include+headers", + }, + vars = { + plat = "rpi" + } +} +