2016-08-20 12:05:24 +00:00
|
|
|
include("plat/build.lua")
|
|
|
|
|
|
|
|
local conly = {
|
|
|
|
rpi = true
|
|
|
|
}
|
|
|
|
|
2018-04-28 17:18:27 +00:00
|
|
|
local softfp = {
|
|
|
|
cpm = true,
|
|
|
|
}
|
|
|
|
|
2016-08-20 12:05:24 +00:00
|
|
|
local sourcefiles = filenamesof(
|
2016-12-29 17:20:51 +00:00
|
|
|
"./hilo.b",
|
2016-11-27 19:38:33 +00:00
|
|
|
"./hilo.bas",
|
2016-08-20 12:05:24 +00:00
|
|
|
"./hilo.c",
|
|
|
|
"./hilo.mod",
|
|
|
|
"./hilo.p",
|
|
|
|
"./mandelbrot.c",
|
|
|
|
"./paranoia.c",
|
|
|
|
"./startrek.c"
|
|
|
|
)
|
|
|
|
|
2018-04-28 17:18:27 +00:00
|
|
|
local usesfp = {
|
|
|
|
["mandelbrot.c"] = true,
|
|
|
|
["startrek.c"] = true,
|
|
|
|
}
|
|
|
|
|
2016-08-20 12:05:24 +00:00
|
|
|
local installmap = {}
|
|
|
|
for _, file in ipairs(sourcefiles) do
|
|
|
|
local b = basename(file)
|
|
|
|
local be = replace(b, "%.", "_")
|
|
|
|
local _, _, e = b:find("%.(%w*)$")
|
|
|
|
|
|
|
|
for _, plat in ipairs(vars.plats) do
|
2018-04-28 17:18:27 +00:00
|
|
|
local flags = {}
|
|
|
|
|
|
|
|
if softfp[plat] and usesfp[b] then
|
|
|
|
flags[#flags+1] = "-fp"
|
|
|
|
end
|
|
|
|
|
2016-08-20 12:05:24 +00:00
|
|
|
if (e == "c") or not conly[plat] then
|
|
|
|
local exe = ackprogram {
|
|
|
|
name = be.."_"..plat,
|
|
|
|
srcs = { file },
|
|
|
|
vars = {
|
|
|
|
plat = plat,
|
|
|
|
lang = e,
|
2018-04-28 17:18:27 +00:00
|
|
|
["+ackldflags"] = flags,
|
2016-08-20 12:05:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
installmap["$(PLATIND)/examples/"..be.."."..plat] = exe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
installmap["$(PLATIND)/examples/"..b] = file
|
|
|
|
end
|
|
|
|
|
|
|
|
installable {
|
|
|
|
name = "pkg",
|
|
|
|
map = installmap
|
|
|
|
}
|
|
|
|
|