Skip to content

Commit 6d23a15

Browse files
committed
Refactored flat wmake makefile
1 parent 29a54a2 commit 6d23a15

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Watcom Makefile for building Lua 5.4.6
22
# This is the DOS 4G flat model version
33
# There are no configurable parts to this file
4-
# Run with `wmake -f watcom_f.mak`
4+
# Run with `wmake -f wat4g.mak`
55

66
objs = lapi.obj lctype.obj lfunc.obj lmathlib.obj loslib.obj &
77
ltable.obj lundump.obj lauxlib.obj ldblib.obj lgc.obj lmem.obj &
@@ -13,22 +13,27 @@ objs = lapi.obj lctype.obj lfunc.obj lmathlib.obj loslib.obj &
1313
lua_obj = lua.obj
1414
luac_obj = luac.obj
1515

16-
all: lua4g.exe luac4g.exe dist .SYMBOLIC
16+
CFLAGS = -q -bt=dos4g -mf -5 -d0 -osr -zc
17+
LDFLAGS = SYS dos4g OPT st=8192
18+
1719
!ifdef __UNIX__
18-
cp lua4g.exe luac4g.exe dist/bin
20+
DIST = dist/bin
21+
COPY = cp
1922
!else
20-
copy lua4g.exe dist\bin
21-
copy luac4g.exe dist\bin
23+
DIST = dist\bin
24+
COPY = COPY
2225
!endif
2326

24-
lua4g.exe: $(objs) $(lua_obj)
25-
*wlink NAME $@ SYS dos4g OPT st=8192 FILE {$(objs) $(lua_obj)}
27+
lua4g.exe: $(objs) $(lua_obj) dist
28+
*wlink NAME $@ $(LDFLAGS) FILE {$(objs) $(lua_obj)}
29+
*$(COPY) $@ $(DIST)
2630

27-
luac4g.exe: $(objs) $(luac_obj)
28-
*wlink NAME $@ SYS dos4g OPT st=8192 FILE {$(objs) $(luac_obj)}
31+
luac4g.exe: $(objs) $(luac_obj) dist
32+
*wlink NAME $@ $(LDFLAGS) FILE {$(objs) $(luac_obj)}
33+
*$(COPY) $@ $(DIST)
2934

3035
.c.obj:
31-
*wcc386 -q -bt=dos4g -mf -5 -d0 -osr -zc -fo=$@ $[&.c
36+
*wcc386 $(CFLAGS) -fo=$@ $[&.c
3237

3338
clean: .SYMBOLIC
3439
!ifdef __UNIX__
@@ -47,8 +52,4 @@ cleandist: .SYMBOLIC clean
4752

4853
dist:
4954
mkdir dist
50-
!ifdef __UNIX__
51-
mkdir dist/bin
52-
!else
53-
mkdir dist\bin
54-
!endif
55+
mkdir $(DIST)

0 commit comments

Comments
 (0)