data, e = fp:read("*a")
fp:close()
if not e then
- local thisglobals = {_G = thisglobals}
+ local thisglobals = {}
+ thisglobals._G = thisglobals
setmetatable(thisglobals, {__index = globals})
chunk, e = load(data, "@"..filename, "text", thisglobals)
end
vars.cflags = {}
parente.vars = vars
+setmetatable(_G,
+ {
+ __index = function(self, k)
+ local value = rawget(_G, k)
+ if not value then
+ error(string.format("access of undefined variable '%s'", k))
+ end
+ return value
+ end
+ }
+)
+
do
local emitter_type = install_make_emitter
parse_arguments(
include("util/cmisc/build.lua")
-local allocd_header = definerule(null,
+local allocd_header = definerule(nil,
{
srcs = { type="targets" }
},
srcs = {
"mach/proto/ncg/*.c",
"mach/"..e.arch.."/ncg/mach.h",
- archlib, -- for .c file
- tables, -- for .c file
+ matching(filenamesof(tables), "%.c$")
},
deps = {
"h+emheaders",