2016-08-10 22:30:32 +00:00
|
|
|
include("plat/build.lua")
|
2016-08-08 21:55:47 +00:00
|
|
|
|
|
|
|
tabgen {
|
|
|
|
name = "ctype_tab",
|
|
|
|
srcs = { "./ctype/char.tab" }
|
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "ctype_files",
|
|
|
|
ins = { "./ctype/genfiles" },
|
|
|
|
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 20:47:02 +00:00
|
|
|
"./pure/string/*.c",
|
2018-06-21 20:52:31 +00:00
|
|
|
"./pure/stdlib/*.c",
|
2018-06-21 20:54:25 +00:00
|
|
|
"./pure/locale/*.c",
|
2016-08-08 21:55:47 +00:00
|
|
|
"./ctype/*.c",
|
|
|
|
"./errno/*.c",
|
|
|
|
"./locale/*.c",
|
2016-08-10 22:30:32 +00:00
|
|
|
"./malloc/*.c",
|
2017-10-28 17:06:38 +00:00
|
|
|
"./math/*.c", -- hypot.c
|
2016-08-20 12:04:17 +00:00
|
|
|
"./math/*.e",
|
2016-08-08 21:55:47 +00:00
|
|
|
"./misc/environ.c", -- don't build everything here as it's all obsolete
|
|
|
|
"./setjmp/*.c",
|
|
|
|
"./setjmp/*.e",
|
|
|
|
"./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",
|
|
|
|
"./math/localmath.h",
|
|
|
|
"./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
|
|
|
|
|