diff --git a/build.lua b/build.lua index 0e167a079..1e2405907 100644 --- a/build.lua +++ b/build.lua @@ -4,6 +4,7 @@ vars.cflags = { vars.ackcflags = { "-O6" } +vars.ackldflags = {} vars.plats = { "cpm", "linux386", diff --git a/examples/build.lua b/examples/build.lua index fced8e299..d30f3745c 100644 --- a/examples/build.lua +++ b/examples/build.lua @@ -4,6 +4,10 @@ local conly = { rpi = true } +local softfp = { + cpm = true, +} + local sourcefiles = filenamesof( "./hilo.b", "./hilo.bas", @@ -15,6 +19,11 @@ local sourcefiles = filenamesof( "./startrek.c" ) +local usesfp = { + ["mandelbrot.c"] = true, + ["startrek.c"] = true, +} + local installmap = {} for _, file in ipairs(sourcefiles) do local b = basename(file) @@ -22,6 +31,12 @@ for _, file in ipairs(sourcefiles) do local _, _, e = b:find("%.(%w*)$") for _, plat in ipairs(vars.plats) do + local flags = {} + + if softfp[plat] and usesfp[b] then + flags[#flags+1] = "-fp" + end + if (e == "c") or not conly[plat] then local exe = ackprogram { name = be.."_"..plat, @@ -29,6 +44,7 @@ for _, file in ipairs(sourcefiles) do vars = { plat = plat, lang = e, + ["+ackldflags"] = flags, } } diff --git a/plat/build.lua b/plat/build.lua index 439a80c5d..676778dd8 100644 --- a/plat/build.lua +++ b/plat/build.lua @@ -91,7 +91,7 @@ definerule("ackprogram", }, _clibrary = acklibrary, commands = { - "ACKDIR=$(INSDIR) $(INSDIR)/bin/ack -m%{plat} -.%{lang} -o %{outs} %{ins}" + "ACKDIR=$(INSDIR) $(INSDIR)/bin/ack -m%{plat} -.%{lang} -o %{outs} %{ins} %{ackldflags}" } } end