-- base.yam - base rules for a Yamfile -- this file is Public Domain -- local dependency_table = {} --[[ dependency_table["filename"].depend dependency_table["filename"].action dependency_table["filename"].flags depend lists entries that we depend on. action is the action to call when this is newer than target flags are passed to the action. --]] function depend(target, source) for i in ipairs(target) do dependency_table[target[i]] = { depend = {}, action = {}, flags = {} } dependency_table[target[i]].depend = source end end function target(t) local _dep; if dependency_table[t] then _dep = dependency_table[t].depend for i in ipairs(_dep) do if _dep[i] then print("target '" .. t .. "' needs '" .. _dep[i] .. "'") target(_dep[i]) end end end end dofile("Yamfile")