Modula-2 runtime library now builds.

This commit is contained in:
David Given 2016-08-13 12:43:44 +02:00
parent dbf8332bf0
commit 00c67fcc0e
3 changed files with 87 additions and 27 deletions

58
lang/m2/libm2/build.lua Normal file
View file

@ -0,0 +1,58 @@
include("plat/build.lua")
local installmap = {}
local function addheader(dir, list)
for _, f in ipairs(list) do
local b = basename(f)
installmap[concatpath("$(PLATIND)/include/modula2/", dir, b)] = f
end
end
addheader("", filenamesof("./*.def"))
installable {
name = "headers",
map = installmap
}
for _, plat in ipairs(vars.plats) do
acklibrary {
name = "lib_"..plat,
srcs = {
"./*.c",
"./*.mod",
"./EM.e",
"./LtoUset.e",
"./absf.e",
"./par_misc.e",
},
hdrs = {}, -- must be empty
deps = {
"lang/cem/libcc.ansi/headers+headers",
"plat/"..plat.."+headers",
"h+emheaders",
},
vars = { plat = plat }
}
ackfile {
name = "mrt_"..plat,
srcs = { "./head_m2.e" },
vars = { plat = plat },
deps = {
"h+emheaders"
}
}
installable {
name = "pkg_"..plat,
map = {
["$(PLATIND)/"..plat.."/modula2.o"] = "+mrt_"..plat,
["$(PLATIND)/"..plat.."/libmodula2.a"] = "+lib_"..plat,
"+headers",
}
}
end

View file

@ -3,51 +3,51 @@ define build-runtime-libmodula2-impl
$(call reset) $(call reset)
$(eval objdir := $(PLATFORM)) $(eval objdir := $(PLATFORM))
$(call ackfile, lang/m2/libm2/Termcap.mod) $(call ackfile, lang/m2/libm2/Arguments.c)
$(call ackfile, lang/m2/libm2/ArraySort.mod)
$(call ackfile, lang/m2/libm2/CSP.mod) $(call ackfile, lang/m2/libm2/CSP.mod)
$(call ackfile, lang/m2/libm2/PascalIO.mod) $(call ackfile, lang/m2/libm2/Conversion.mod)
$(call ackfile, lang/m2/libm2/RealInOut.mod) $(call ackfile, lang/m2/libm2/EM.e)
$(call ackfile, lang/m2/libm2/InOut.mod) $(call ackfile, lang/m2/libm2/InOut.mod)
$(call ackfile, lang/m2/libm2/Streams.mod) $(call ackfile, lang/m2/libm2/LtoUset.e)
$(call ackfile, lang/m2/libm2/MathLib0.mod) $(call ackfile, lang/m2/libm2/MathLib0.mod)
$(call ackfile, lang/m2/libm2/Mathlib.mod) $(call ackfile, lang/m2/libm2/Mathlib.mod)
$(call ackfile, lang/m2/libm2/PascalIO.mod)
$(call ackfile, lang/m2/libm2/Processes.mod) $(call ackfile, lang/m2/libm2/Processes.mod)
$(call ackfile, lang/m2/libm2/RealConver.mod) $(call ackfile, lang/m2/libm2/RealConver.mod)
$(call ackfile, lang/m2/libm2/Storage.mod) $(call ackfile, lang/m2/libm2/RealInOut.mod)
$(call ackfile, lang/m2/libm2/Conversion.mod) $(call ackfile, lang/m2/libm2/SYSTEM.c)
$(call ackfile, lang/m2/libm2/Semaphores.mod) $(call ackfile, lang/m2/libm2/Semaphores.mod)
$(call ackfile, lang/m2/libm2/random.mod) $(call ackfile, lang/m2/libm2/Storage.mod)
$(call ackfile, lang/m2/libm2/StrAss.c)
$(call ackfile, lang/m2/libm2/Streams.mod)
$(call ackfile, lang/m2/libm2/Strings.mod) $(call ackfile, lang/m2/libm2/Strings.mod)
$(call ackfile, lang/m2/libm2/ArraySort.mod) $(call ackfile, lang/m2/libm2/Termcap.mod)
$(call ackfile, lang/m2/libm2/catch.c)
$(call ackfile, lang/m2/libm2/Traps.mod) $(call ackfile, lang/m2/libm2/Traps.mod)
$(call ackfile, lang/m2/libm2/XXTermcap.c) $(call ackfile, lang/m2/libm2/XXTermcap.c)
$(call ackfile, lang/m2/libm2/dvi.c)
$(call ackfile, lang/m2/libm2/Arguments.c)
$(call ackfile, lang/m2/libm2/LtoUset.e)
$(call ackfile, lang/m2/libm2/StrAss.c)
$(call ackfile, lang/m2/libm2/cap.c)
$(call ackfile, lang/m2/libm2/absd.c) $(call ackfile, lang/m2/libm2/absd.c)
$(call ackfile, lang/m2/libm2/absf.e) $(call ackfile, lang/m2/libm2/absf.e)
$(call ackfile, lang/m2/libm2/absi.c) $(call ackfile, lang/m2/libm2/absi.c)
$(call ackfile, lang/m2/libm2/absl.c) $(call ackfile, lang/m2/libm2/absl.c)
$(call ackfile, lang/m2/libm2/halt.c)
$(call ackfile, lang/m2/libm2/SYSTEM.c)
$(call ackfile, lang/m2/libm2/par_misc.e)
$(call ackfile, lang/m2/libm2/init.c)
$(call ackfile, lang/m2/libm2/sigtrp.c)
$(call ackfile, lang/m2/libm2/store.c)
$(call ackfile, lang/m2/libm2/confarray.c)
$(call ackfile, lang/m2/libm2/load.c)
$(call ackfile, lang/m2/libm2/blockmove.c) $(call ackfile, lang/m2/libm2/blockmove.c)
$(call ackfile, lang/m2/libm2/stackprio.c) $(call ackfile, lang/m2/libm2/cap.c)
$(call ackfile, lang/m2/libm2/ucheck.c) $(call ackfile, lang/m2/libm2/catch.c)
$(call ackfile, lang/m2/libm2/confarray.c)
$(call ackfile, lang/m2/libm2/dvi.c)
$(call ackfile, lang/m2/libm2/halt.c)
$(call ackfile, lang/m2/libm2/init.c)
$(call ackfile, lang/m2/libm2/load.c)
$(call ackfile, lang/m2/libm2/par_misc.e)
$(call ackfile, lang/m2/libm2/random.mod)
$(call ackfile, lang/m2/libm2/rcka.c) $(call ackfile, lang/m2/libm2/rcka.c)
$(call ackfile, lang/m2/libm2/rcku.c)
$(call ackfile, lang/m2/libm2/rcki.c) $(call ackfile, lang/m2/libm2/rcki.c)
$(call ackfile, lang/m2/libm2/rckul.c)
$(call ackfile, lang/m2/libm2/rckil.c) $(call ackfile, lang/m2/libm2/rckil.c)
$(call ackfile, lang/m2/libm2/EM.e) $(call ackfile, lang/m2/libm2/rcku.c)
$(call ackfile, lang/m2/libm2/rckul.c)
$(call ackfile, lang/m2/libm2/sigtrp.c)
$(call ackfile, lang/m2/libm2/stackprio.c)
$(call ackfile, lang/m2/libm2/store.c)
$(call ackfile, lang/m2/libm2/ucheck.c)
$(eval $q: $(EM_M2)) $(eval $q: $(EM_M2))

View file

@ -15,6 +15,7 @@ definerule("ackfile",
deps = { deps = {
"lang/cem/cemcom.ansi+pkg", "lang/cem/cemcom.ansi+pkg",
"lang/cem/cpp.ansi+pkg", "lang/cem/cpp.ansi+pkg",
"lang/m2/comp+pkg",
"plat/"..plat.."+tools", "plat/"..plat.."+tools",
"util/ack+pkg", "util/ack+pkg",
"util/misc+pkg", "util/misc+pkg",
@ -91,6 +92,7 @@ definerule("build_plat_libs",
name = e.name, name = e.name,
map = { map = {
"lang/basic/lib+pkg_"..e.plat, "lang/basic/lib+pkg_"..e.plat,
"lang/m2/libm2+pkg_"..e.plat,
"lang/cem/libcc.ansi+pkg_"..e.plat, "lang/cem/libcc.ansi+pkg_"..e.plat,
["$(PLATIND)/"..e.plat.."/libem.a"] = "mach/"..e.arch.."/libem+lib_"..e.plat, ["$(PLATIND)/"..e.plat.."/libem.a"] = "mach/"..e.arch.."/libem+lib_"..e.plat,
["$(PLATIND)/"..e.plat.."/libend.a"] = "mach/"..e.arch.."/libend+lib_"..e.plat, ["$(PLATIND)/"..e.plat.."/libend.a"] = "mach/"..e.arch.."/libend+lib_"..e.plat,