Skip to content

Commit ea8312f

Browse files
committed
Inital commit
0 parents  commit ea8312f

File tree

3 files changed

+139
-0
lines changed

3 files changed

+139
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Lua for Open Watcom
2+
3+
This repository contains wmake style makefiles an patches to build [Lua](https://lua.org) [5.4.6](https://lua.org/ftp/) on Open Watcom 1.9 or later. The primary goal for these is to allow Lua scripts to be run on DOS systems in real mode.
4+
5+
## Runtime Requirements
6+
To run Lua built by Open Watcom you will need the following:
7+
8+
| Requirement | Sources/Comment |
9+
|--|--|
10+
| [8088 CPU](https://en.wikipedia.org/wiki/Intel_8088)*<br/> <pre>*or compatibiles<br/>like the 8086, V20,<br/>286, 386 etc<br/><br/>Machine emulators<br/>provided as an option<br/>for other ISAs</pre> | [86Box](https://86box.net/) ([GitHub](https://github.com/86Box/86Box))<br/>[DOSBox-X](https://dosbox-x.com/) ([GitHub](https://github.com/joncampbell123/dosbox-x))<br/>[PCem](https://www.pcem-emulator.co.uk/) ([GitHub](https://github.com/sarah-walker-pcem/pcem/))
11+
| PC-DOS 2.1 or higher | [FreeDOS](https://www.freedos.org/download/)<br/>[DOSBox-X](https://dosbox-x.com/) ([GitHub](https://github.com/joncampbell123/dosbox-x))<br/>[SvarDOS](http://svardos.org/)
12+
| At least 320 kilobytes<br/>of total system memory | <pre>Any memory above<br/>640 kilobytes is<br/>inaccessible to all<br/>real mode DOS programs |
13+
| At least 600 kilobytes<br/>of hard disk space or x2<br/>360 kilobyte diskettes | <pre>Can be ran directly<br/>from a diskette on<br/>machines without a<br/>hard drive
14+
15+
> If in doubt, install [DOSBox-X](https://dosbox-x.com/)
16+
17+
## Build Requirements
18+
To build Lua with Open Watcom you will need the following:
19+
20+
| Requirement | Sources |
21+
|--|--|
22+
| Lua 5.4.6 source code | [lua.org](https://lua.org/ftp/) ([GitHub](https://github.com/lua/lua/tree/v5.4.6)) |
23+
| Open Watcom 1.9 (or later) | [openwatcom.org](https://www.openwatcom.org/) ([GitHub](https://github.com/open-watcom))<br/>[FreeDOS Bonus CD](https://www.freedos.org/download/) (`FDIMPLES`)<br/>[SvarDOS](http://svardos.org/?p=repo) (`PKGNET` repository) |
24+
| DOS operating system<br/>(MS-DOS 5.0 compatible) | [FreeDOS](https://www.freedos.org/download/)<br/>[DOSBox-X](https://dosbox-x.com/) ([GitHub](https://github.com/joncampbell123/dosbox-x))<br/>[SvarDOS](http://svardos.org/)
25+
| [80386 compatible processor](https://en.wikipedia.org/wiki/I386)* <br/> <pre>*Any AMD or Intel CPU <br/>made in the last 3 decades<br/>is compatible.<br/><br/>Machine emulators provided <br/>as an option for other ISAs </pre> | [86Box](https://86box.net/) ([GitHub](https://github.com/86Box/86Box))<br/>[DOSBox-X](https://dosbox-x.com/) ([GitHub](https://github.com/joncampbell123/dosbox-x))<br/>[PCem](https://www.pcem-emulator.co.uk/) ([GitHub](https://github.com/sarah-walker-pcem/pcem/))<br/>[Qemu](https://www.qemu.org/) ([GitLab](https://gitlab.com/qemu-project/qemu))
26+
27+
> If in doubt, install [DOSBox-X](https://dosbox-x.com/)

watcom_f.mak

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Watcom Makefile for building Lua 5.4.6
2+
# This is the DOS 4G flat model version
3+
# There are no configurable parts to this file
4+
# Run with `wmake -f watcom_f.mak`
5+
6+
objs = lapi.obj lctype.obj lfunc.obj lmathlib.obj loslib.obj &
7+
ltable.obj lundump.obj lauxlib.obj ldblib.obj lgc.obj lmem.obj &
8+
lparser.obj ltablib.obj lutf8lib.obj lbaselib.obj ldebug.obj &
9+
linit.obj loadlib.obj lstate.obj ltm.obj lvm.obj lcode.obj &
10+
ldo.obj liolib.obj lobject.obj lstring.obj lzio.obj &
11+
lcorolib.obj ldump.obj llex.obj lopcodes.obj lstrlib.obj
12+
13+
lua_obj = lua.obj
14+
luac_obj = luac.obj
15+
16+
all: lua4g.exe luac4g.exe dist\bin .SYMBOLIC
17+
!ifdef __UNIX__
18+
cp lua16.exe luac16.exe dist/bin
19+
!else
20+
copy lua16.exe dist\bin
21+
copy luac16.exe dist\bin
22+
!endif
23+
24+
lua4g.exe: $(objs) $(lua_obj)
25+
*wlink NAME $@ SYS dos4g OPT st=8192 FILE {$(objs) $(lua_obj)}
26+
27+
luac4g.exe: $(objs) $(luac_obj)
28+
*wlink NAME $@ SYS dos4g OPT st=8192 FILE {$(objs) $(luac_obj)}
29+
30+
.c.obj:
31+
*wcc386 -q -bt=dos4g -mf -5 -d0 -osr -zc $[&.c
32+
33+
clean: .SYMBOLIC
34+
!ifdef __UNIX__
35+
rm *.obj *.exe
36+
!else
37+
del *.obj
38+
del *.exe
39+
!endif
40+
41+
cleandist: .SYMBOLIC clean
42+
!ifdef __UNIX__
43+
rm -r dist
44+
!else
45+
deltree /Y dist
46+
!endif
47+
48+
dist:
49+
mkdir dist
50+
51+
dist\bin: dist
52+
!ifdef __UNIX__
53+
mkdir dist/bin
54+
!else
55+
mkdir dist\bin
56+
!endif

watcom_l.mak

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Watcom Makefile for building Lua 5.4.6
2+
# This is the DOS 16-bit large model version
3+
# There are no configurable parts to this file
4+
# Run with `wmake -f watcom_l.mak`
5+
6+
objs = lapi.obj lctype.obj lfunc.obj lmathlib.obj loslib.obj &
7+
ltable.obj lundump.obj lauxlib.obj ldblib.obj lgc.obj lmem.obj &
8+
lparser.obj ltablib.obj lutf8lib.obj lbaselib.obj ldebug.obj &
9+
linit.obj loadlib.obj lstate.obj ltm.obj lvm.obj lcode.obj &
10+
ldo.obj liolib.obj lobject.obj lstring.obj lzio.obj &
11+
lcorolib.obj ldump.obj llex.obj lopcodes.obj lstrlib.obj
12+
13+
lua_obj = lua.obj
14+
luac_obj = luac.obj
15+
16+
all: lua16.exe luac16.exe dist\bin .SYMBOLIC
17+
!ifdef __UNIX__
18+
cp lua16.exe luac16.exe dist/bin
19+
!else
20+
copy lua16.exe dist\bin
21+
copy luac16.exe dist\bin
22+
!endif
23+
24+
lua16.exe: $(objs) $(lua_obj)
25+
*wlink NAME $@ SYS dos OPT st=8192 FILE {$(objs) $(lua_obj)}
26+
27+
luac16.exe: $(objs) $(luac_obj)
28+
*wlink NAME $@ SYS dos OPT st=8192 FILE {$(objs) $(luac_obj)}
29+
30+
.c.obj:
31+
*wcc -q -bt=dos -ml -0 -d0 -osr -zc $[&.c
32+
33+
clean: .SYMBOLIC
34+
!ifdef __UNIX__
35+
rm *.obj *.exe
36+
!else
37+
del *.obj
38+
del *.exe
39+
!endif
40+
41+
cleandist: .SYMBOLIC clean
42+
!ifdef __UNIX__
43+
rm -r dist
44+
!else
45+
deltree /Y dist
46+
!endif
47+
48+
dist:
49+
mkdir dist
50+
51+
dist\bin: dist
52+
!ifdef __UNIX__
53+
mkdir dist/bin
54+
!else
55+
mkdir dist\bin
56+
!endif

0 commit comments

Comments
 (0)