build.lua 739 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. include("plat/build.lua")
  2. local conly = {
  3. rpi = true
  4. }
  5. local sourcefiles = filenamesof(
  6. "./hilo.b",
  7. "./hilo.c",
  8. "./hilo.mod",
  9. "./hilo.p",
  10. "./mandelbrot.c",
  11. "./paranoia.c",
  12. "./startrek.c"
  13. )
  14. local installmap = {}
  15. for _, file in ipairs(sourcefiles) do
  16. local b = basename(file)
  17. local be = replace(b, "%.", "_")
  18. local _, _, e = b:find("%.(%w*)$")
  19. for _, plat in ipairs(vars.plats) do
  20. if (e == "c") or not conly[plat] then
  21. local exe = ackprogram {
  22. name = be.."_"..plat,
  23. srcs = { file },
  24. vars = {
  25. plat = plat,
  26. lang = e,
  27. }
  28. }
  29. installmap["$(PLATIND)/examples/"..be.."."..plat] = exe
  30. end
  31. end
  32. installmap["$(PLATIND)/examples/"..b] = file
  33. end
  34. installable {
  35. name = "pkg",
  36. map = installmap
  37. }