ref: 46be77621a1792431d662cb47528285aa57a1964
parent: 152968ba52958da39a705f5f6b110b3ec186b74f
author: kvik <kvik@a-b.xyz>
date: Sat Feb 6 18:19:15 EST 2021
build: add Plan 9 mkfile This mkfile builds the Lua core and most of the libraries, packaging the results in a library intended for static linking with host programs. I haven't ported the standard lua.c standalone interpreter because it doesn't make much sense on Plan 9 due to the lack of dynamic linking facilities. A standalone Lua interpreter taking full advantage of Plan 9 interfaces and packed with useful libraries is provided as a separate project. It also doubles as a usage example for the library port. Additionally, the Lua 'os' library build is disabled, since Plan 9 doesn't provide the required libc interfaces. A fully rewritten compatible os library might be included in this port in the future, but for now it lives in the above mentioned Plan 9 interpreter.
--- /dev/null
+++ b/mkfile
@@ -1,0 +1,55 @@
+</$objtype/mkfile
+
+CFLAGS=-FTV -p -I../shim -DLUA_USE_PLAN9
+
+CORETARG=liblua.a$O
+COREOBJS=\
+ lapi.$O\
+ lcode.$O\
+ lctype.$O\
+ ldebug.$O\
+ ldo.$O\
+ ldump.$O\
+ lfunc.$O\
+ lgc.$O\
+ llex.$O\
+ lmem.$O\
+ lobject.$O\
+ lopcodes.$O\
+ lparser.$O\
+ lstate.$O\
+ lstring.$O\
+ ltable.$O\
+ ltm.$O\
+ lundump.$O\
+ lvm.$O\
+ lzio.$O\
+ ltests.$O\
+ lauxlib.$O
+
+LIBOBJS=\
+ lbaselib.$O\
+ ldblib.$O\
+ liolib.$O\
+ lmathlib.$O\
+# loslib.$O\
+ ltablib.$O\
+ lstrlib.$O\
+ lutf8lib.$O\
+ loadlib.$O\
+ lcorolib.$O\
+ linit.$O
+
+ALLOBJS=$COREOBJS $LIBOBJS
+ALLTARG=$CORETARG $LUATARG
+
+all:V: $CORETARG $LUATARG
+
+clean:V:
+ rm -f $LUATARG *.[$OS] *.a[$OS]
+
+$CORETARG: $COREOBJS $LIBOBJS
+ ar cr $target $prereq
+
+%.$O: %.c
+ $CC $CFLAGS $stem.c