aboutsummaryrefslogtreecommitdiff
path: root/src/bin/bam.lua
blob: d529ece7c52c7f37febf2a31d137025047c4af7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
return function(s, lib)
	local function bin_settings(name)
		local s = TableDeepCopy(s.user_settings)
		s.link.flags:Add("-T src/lib/linker.ld")
		if name == 'lua' or name == 'luac' then
			s.cc.includes:Add("src/lib/lua")
		end
		return s
	end

	local function bin_exe(name, deps)
		local s = bin_settings(name)

		local src = Collect('src/bin/' .. name .. '/*.c')
		local obj = Compile(s, src)

		return Link(s, 'bin/' .. name .. ".bin", {obj, deps})
	end

	return {
		bin_exe('lua', {lib.liblua}),
		-- bin_exe('luac', {liblua}),
	}
end