diff --git a/lang/m2/libm2/build.lua b/lang/m2/libm2/build.lua new file mode 100644 index 000000000..f49a10a4c --- /dev/null +++ b/lang/m2/libm2/build.lua @@ -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 + + diff --git a/lang/m2/libm2/build.mk b/lang/m2/libm2/build.mk index 1ebc89cc3..e7c27eac4 100644 --- a/lang/m2/libm2/build.mk +++ b/lang/m2/libm2/build.mk @@ -3,51 +3,51 @@ define build-runtime-libmodula2-impl $(call reset) $(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/PascalIO.mod) -$(call ackfile, lang/m2/libm2/RealInOut.mod) +$(call ackfile, lang/m2/libm2/Conversion.mod) +$(call ackfile, lang/m2/libm2/EM.e) $(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/Mathlib.mod) +$(call ackfile, lang/m2/libm2/PascalIO.mod) $(call ackfile, lang/m2/libm2/Processes.mod) $(call ackfile, lang/m2/libm2/RealConver.mod) -$(call ackfile, lang/m2/libm2/Storage.mod) -$(call ackfile, lang/m2/libm2/Conversion.mod) +$(call ackfile, lang/m2/libm2/RealInOut.mod) +$(call ackfile, lang/m2/libm2/SYSTEM.c) $(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/ArraySort.mod) -$(call ackfile, lang/m2/libm2/catch.c) +$(call ackfile, lang/m2/libm2/Termcap.mod) $(call ackfile, lang/m2/libm2/Traps.mod) $(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/absf.e) $(call ackfile, lang/m2/libm2/absi.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/stackprio.c) -$(call ackfile, lang/m2/libm2/ucheck.c) +$(call ackfile, lang/m2/libm2/cap.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/rcku.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/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)) diff --git a/plat/build.lua b/plat/build.lua index c6019d34a..64bccf89d 100644 --- a/plat/build.lua +++ b/plat/build.lua @@ -15,6 +15,7 @@ definerule("ackfile", deps = { "lang/cem/cemcom.ansi+pkg", "lang/cem/cpp.ansi+pkg", + "lang/m2/comp+pkg", "plat/"..plat.."+tools", "util/ack+pkg", "util/misc+pkg", @@ -91,6 +92,7 @@ definerule("build_plat_libs", name = e.name, map = { "lang/basic/lib+pkg_"..e.plat, + "lang/m2/libm2+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.."/libend.a"] = "mach/"..e.arch.."/libend+lib_"..e.plat,