From f253b6a169d0e23d0c4bb4f899dae2718e0363f5 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 14 Aug 2016 10:37:55 +0200 Subject: [PATCH] linux386 builds. Also, forgot to turn back on the language runtimes. --- Makefile | 2 +- build.lua | 4 +++- mach/i386/libem/build.lua | 8 ++++++++ mach/i386/libend/build.lua | 8 ++++++++ plat/build.lua | 6 +++--- plat/linux386/build-headers.lua | 11 +++++++++++ plat/linux386/build-pkg.lua | 23 +++++++++++++++++++++++ plat/linux386/build-tools.lua | 21 +++++++++++++++++++++ 8 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 mach/i386/libem/build.lua create mode 100644 mach/i386/libend/build.lua create mode 100644 plat/linux386/build-headers.lua create mode 100644 plat/linux386/build-pkg.lua create mode 100644 plat/linux386/build-tools.lua diff --git a/Makefile b/Makefile index 78d3f9c2b..0f6938b1e 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ PLATIND = $(INSDIR)/share/ack PLATDEP = $(INSDIR)/lib/ack MAKECMDGOALS ?= +ack -BUILD_FILES = $(shell find * -name build.lua) +BUILD_FILES = $(shell find * -name '*.lua') NINJA := $(shell which ninja) ifneq ($(findstring +, $(MAKECMDGOALS)),) diff --git a/build.lua b/build.lua index c5a59a135..98b381dc2 100644 --- a/build.lua +++ b/build.lua @@ -5,8 +5,9 @@ vars.ackcflags = { "-O" } vars.plats = { - "pc86", "cpm", + "linux386", + "pc86", } installable { @@ -17,6 +18,7 @@ installable { "lang/m2/comp+pkg", "lang/pc/comp+pkg", "plat/cpm+pkg", + "plat/linux386+pkg", "plat/pc86+pkg", "util/ack+pkg", "util/amisc+pkg", diff --git a/mach/i386/libem/build.lua b/mach/i386/libem/build.lua new file mode 100644 index 000000000..ca5a13c65 --- /dev/null +++ b/mach/i386/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/i386/libend/build.lua b/mach/i386/libend/build.lua new file mode 100644 index 000000000..ca5a13c65 --- /dev/null +++ b/mach/i386/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/build.lua b/plat/build.lua index deb2e4647..f46db0bbe 100644 --- a/plat/build.lua +++ b/plat/build.lua @@ -64,9 +64,9 @@ definerule("build_plat_libs", name = e.name, map = { "lang/basic/lib+pkg_"..e.plat, - --"lang/cem/libcc.ansi+pkg_"..e.plat, - --"lang/m2/libm2+pkg_"..e.plat, - --"lang/pc/libpc+pkg_"..e.plat, + "lang/cem/libcc.ansi+pkg_"..e.plat, + "lang/m2/libm2+pkg_"..e.plat, + "lang/pc/libpc+pkg_"..e.plat, ["$(PLATIND)/"..e.plat.."/libem.a"] = "mach/"..e.arch.."/libem+lib_"..e.plat, ["$(PLATIND)/"..e.plat.."/libend.a"] = "mach/"..e.arch.."/libend+lib_"..e.plat, } diff --git a/plat/linux386/build-headers.lua b/plat/linux386/build-headers.lua new file mode 100644 index 000000000..5b91bdc75 --- /dev/null +++ b/plat/linux386/build-headers.lua @@ -0,0 +1,11 @@ +include("plat/build.lua") + +acklibrary { + name = "headers", + hdrs = { + ["ack/config.h"] = "./include/ack/config.h", + ["sys/ioctl.h"] = "./include/sys/ioctl.h", + ["unistd.h"] = "./include/unistd.h", + } +} + diff --git a/plat/linux386/build-pkg.lua b/plat/linux386/build-pkg.lua new file mode 100644 index 000000000..47fb9ce43 --- /dev/null +++ b/plat/linux386/build-pkg.lua @@ -0,0 +1,23 @@ +include("plat/build.lua") + +ackfile { + name = "boot", + srcs = { "./boot.s" }, + vars = { plat = "linux386" } +} + +build_plat_libs { + name = "libs", + arch = "i386", + plat = "linux386", +} + +installable { + name = "pkg", + map = { + "+tools", + "+libs", + ["$(PLATIND)/linux386/boot.o"] = "+boot" + } +} + diff --git a/plat/linux386/build-tools.lua b/plat/linux386/build-tools.lua new file mode 100644 index 000000000..d711f85fd --- /dev/null +++ b/plat/linux386/build-tools.lua @@ -0,0 +1,21 @@ +include("plat/build.lua") + +build_as { + name = "as", + arch = "i386", +} + +build_ncg { + name = "ncg", + arch = "i386", +} + +return installable { + name = "tools", + map = { + ["$(PLATDEP)/linux386/as"] = "+as", + ["$(PLATDEP)/linux386/ncg"] = "+ncg", + ["$(PLATIND)/descr/linux386"] = "./descr", + "util/opt+pkg", + } +}