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" + } +} +