Biggish refactor to break cycles; my build rules were full of them. cpm builds,

which requires top and topgen.
This commit is contained in:
David Given
2016-08-14 01:39:40 +02:00
parent 10746f8b97
commit 262c5fedcf
14 changed files with 185 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
include("mach/proto/as/build.lua")
include("mach/proto/ncg/build.lua")
include("mach/proto/top/build.lua")
definerule("ackfile",
{
@@ -53,36 +54,6 @@ definerule("acklibrary",
end
)
definerule("build_plat_tools",
{
arch = { type="string" },
plat = { type="string" },
},
function(e)
local descr = "plat/"..e.plat.."/descr"
local as = build_as {
name = "as",
arch = e.arch
}
local ncg = build_ncg {
name = "ncg",
arch = e.arch,
}
return installable {
name = e.name,
map = {
["$(PLATDEP)/"..e.plat.."/as"] = as,
["$(PLATDEP)/"..e.plat.."/ncg"] = ncg,
["$(PLATIND)/descr/"..e.plat] = descr,
"util/opt+pkg",
}
}
end
)
definerule("build_plat_libs",
{
arch = { type="string" },
@@ -93,15 +64,13 @@ 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,
["$(PLATIND)/"..e.plat.."/libsys.a"] = "mach/"..e.arch.."/libsys+lib_"..e.plat,
}
}
end
)

View File

@@ -0,0 +1,11 @@
include("plat/build.lua")
acklibrary {
name = "headers",
hdrs = {
["ack/config.h"] = "./include/ack/config.h",
["unistd.h"] = "./include/unistd.h",
["cpm.h"] = "./include/cpm.h",
}
}

24
plat/cpm/build-pkg.lua Normal file
View File

@@ -0,0 +1,24 @@
include("plat/build.lua")
include("lang/build.lua")
ackfile {
name = "boot",
srcs = { "./boot.s" },
vars = { plat = "cpm" }
}
build_plat_libs {
name = "libs",
arch = "i80",
plat = "cpm",
}
installable {
name = "pkg",
map = {
"+tools",
"+libs",
["$(PLATIND)/cpm/boot.o"] = "+boot"
}
}

27
plat/cpm/build-tools.lua Normal file
View File

@@ -0,0 +1,27 @@
include("plat/build.lua")
build_as {
name = "as",
arch = "i80",
}
build_ncg {
name = "ncg",
arch = "i80",
}
build_top {
name = "top",
arch = "i80",
}
return installable {
name = "tools",
map = {
["$(PLATDEP)/cpm/as"] = "+as",
["$(PLATDEP)/cpm/ncg"] = "+ncg",
["$(PLATDEP)/cpm/top"] = "+top",
["$(PLATIND)/descr/cpm"] = "./descr",
"util/opt+pkg",
}
}

View File

@@ -0,0 +1,10 @@
include("plat/build.lua")
acklibrary {
name = "headers",
hdrs = {
["ack/config.h"] = "./include/ack/config.h",
["unistd.h"] = "./include/unistd.h",
}
}

View File

@@ -1,11 +1,4 @@
include("plat/build.lua")
include("lang/build.lua")
build_plat_tools {
name = "tools",
arch = "i86",
plat = "pc86",
}
ackfile {
name = "boot",
@@ -13,14 +6,6 @@ ackfile {
vars = { plat = "pc86" }
}
acklibrary {
name = "headers",
hdrs = {
["ack/config.h"] = "./include/ack/config.h",
["unistd.h"] = "./include/unistd.h",
}
}
build_plat_libs {
name = "libs",
arch = "i86",

21
plat/pc86/build-tools.lua Normal file
View File

@@ -0,0 +1,21 @@
include("plat/build.lua")
build_as {
name = "as",
arch = "i86",
}
build_ncg {
name = "ncg",
arch = "i86",
}
return installable {
name = "tools",
map = {
["$(PLATDEP)/pc86/as"] = "+as",
["$(PLATDEP)/pc86/ncg"] = "+ncg",
["$(PLATIND)/descr/pc86"] = "./descr",
"util/opt+pkg",
}
}