aboutsummaryrefslogblamecommitdiff
path: root/src/bin/bam.lua
blob: 4026bce8de9fab5eb1e20d8dd334ace5c227e728 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                              
                                                   
                                                                                      


                                                


                
                                  
                                    



                                                         
                                                             


       
                                    
                                     
 
local function bin_settings(name)
	local s = TableDeepCopy(user_settings)
	s.link.flags:Add("-T src/sysbin/linker.ld",
					 "-Xlinker -Map=build/bin/" .. name .. ".map")
	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

bin = {
	-- bin_exe('lua', {liblua}),
	-- bin_exe('luac', {liblua}),
}