2016-08-10 22:30:32 +00:00
|
|
|
include("plat/build.lua")
|
2016-08-08 21:55:47 +00:00
|
|
|
|
|
|
|
tabgen {
|
|
|
|
name = "ctype_tab",
|
2018-06-21 21:24:23 +00:00
|
|
|
srcs = { "./core/ctype/char.tab" }
|
2016-08-08 21:55:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "ctype_files",
|
2018-06-21 21:24:23 +00:00
|
|
|
ins = { "./core/ctype/genfiles" },
|
2016-08-08 21:55:47 +00:00
|
|
|
outleaves = {
|
|
|
|
"isalnum.c",
|
|
|
|
"isalpha.c",
|
|
|
|
"isascii.c",
|
|
|
|
"iscntrl.c",
|
|
|
|
"isdigit.c",
|
|
|
|
"isgraph.c",
|
|
|
|
"islower.c",
|
|
|
|
"isprint.c",
|
|
|
|
"ispunct.c",
|
|
|
|
"isspace.c",
|
|
|
|
"isupper.c",
|
|
|
|
"isxdigit.c",
|
|
|
|
},
|
|
|
|
commands = {
|
|
|
|
"sh %{ins[1]} %{dir}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-07 19:56:53 +00:00
|
|
|
for _, plat in ipairs(vars.plats) do
|
2016-11-06 20:49:47 +00:00
|
|
|
acklibrary {
|
|
|
|
name = "lib_"..plat,
|
|
|
|
srcs = {
|
2016-08-08 21:55:47 +00:00
|
|
|
"+ctype_files",
|
|
|
|
"+ctype_tab",
|
2018-06-21 21:24:23 +00:00
|
|
|
"./core/string/*.c",
|
|
|
|
"./core/stdlib/*.c",
|
|
|
|
"./core/locale/*.c",
|
|
|
|
"./core/setjmp/*.c",
|
|
|
|
"./core/setjmp/*.e",
|
|
|
|
"./core/math/*.c", -- hypot.c
|
|
|
|
"./core/math/*.e",
|
|
|
|
"./core/ctype/*.c",
|
2016-08-08 21:55:47 +00:00
|
|
|
"./errno/*.c",
|
2016-08-10 22:30:32 +00:00
|
|
|
"./malloc/*.c",
|
2016-08-08 21:55:47 +00:00
|
|
|
"./misc/environ.c", -- don't build everything here as it's all obsolete
|
|
|
|
"./signal/*.c",
|
2016-11-06 20:49:47 +00:00
|
|
|
"./assert/*.c",
|
2016-08-08 21:55:47 +00:00
|
|
|
"./stdio/*.c",
|
|
|
|
"./stdlib/*.c",
|
|
|
|
"./string/*.c",
|
|
|
|
"./time/*.c",
|
2016-11-06 20:49:47 +00:00
|
|
|
},
|
2016-08-08 21:55:47 +00:00
|
|
|
hdrs = {}, -- must be empty
|
|
|
|
deps = {
|
2016-12-05 20:05:24 +00:00
|
|
|
"lang/cem/libcc.ansi/headers+pkg",
|
|
|
|
"plat/"..plat.."/include+pkg",
|
2016-11-06 20:49:47 +00:00
|
|
|
"./malloc/malloc.h",
|
2018-06-21 21:24:23 +00:00
|
|
|
"./core/math/localmath.h",
|
2016-11-06 20:49:47 +00:00
|
|
|
"./stdio/loc_incl.h",
|
|
|
|
"./stdlib/ext_fmt.h",
|
|
|
|
"./time/loc_time.h",
|
2016-08-08 21:55:47 +00:00
|
|
|
},
|
2016-11-06 20:49:47 +00:00
|
|
|
vars = { plat = plat }
|
|
|
|
}
|
2016-08-07 19:56:53 +00:00
|
|
|
|
|
|
|
ackfile {
|
|
|
|
name = "crt_"..plat,
|
|
|
|
srcs = { "./head_ac.e" },
|
|
|
|
vars = { plat = plat },
|
|
|
|
deps = {
|
|
|
|
"h+emheaders"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-10 11:25:48 +00:00
|
|
|
local suffix = plat:find("^em") and "m" or "o"
|
2016-08-07 19:56:53 +00:00
|
|
|
installable {
|
|
|
|
name = "pkg_"..plat,
|
|
|
|
map = {
|
2016-08-10 22:30:32 +00:00
|
|
|
"lang/cem/libcc.ansi/headers+pkg",
|
2018-06-10 11:25:48 +00:00
|
|
|
["$(PLATIND)/"..plat.."/c-ansi."..suffix] = "+crt_"..plat,
|
2016-08-08 21:55:47 +00:00
|
|
|
["$(PLATIND)/"..plat.."/libc.a"] = "+lib_"..plat,
|
2016-08-07 19:56:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|