aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2026-09-03 23:49:29 +0200
committerJavier <dev.git@javispedro.com>2026-09-04 00:06:23 +0200
commit1b9e3118374a13dc12652d87b1dd3d1ccfecbbf3 (patch)
tree0c5f7b5aef76806a449d799dba333d41eaa60aa2 /makefile
parent906193586d30a382d2b982419d92f80c07a65286 (diff)
downloadvbados-1b9e3118374a13dc12652d87b1dd3d1ccfecbbf3.tar.gz
vbados-1b9e3118374a13dc12652d87b1dd3d1ccfecbbf3.zip
embed language & unicode tables into main executables
use KITTENC to embed all NLS files into executable KITTENC does not allow loading external files anymore... embed the cp???uni.tbl (codepage -> unicode conversion tables) into the main executable too. however, we will still try to find them in PATH if user cp is missing from the internal ones. this means the distribution zip/flp now contain much fewer files. con: some utilities now need to built in the host (kittenc & unitbl2c) this may make the build less portable; so far unix and dos/386 still work.
Diffstat (limited to 'makefile')
-rw-r--r--makefile36
1 files changed, 28 insertions, 8 deletions
diff --git a/makefile b/makefile
index 0ae4f28..1383c12 100644
--- a/makefile
+++ b/makefile
@@ -37,16 +37,25 @@ w16dll_cflags = -bt=windows -bd -mc -zu -s -6 -osi -w3 -wcd=202
compile_dos = *wcc -fo=$^@ $(dos_cflags) $[@
compile_dostsr = *wcc -fo=$^@ $(dostsr_cflags) $[@
compile_w16dll = *wcc -fo=$^@ $(w16dll_cflags) $[@
+compile_link_host = *wcl386 -i=$(%originclude) -os -fe=$^@ $[@
+
+!ifdef __UNIX__
+run_host = ./
+!else
+run_host =
+!endif
.BEFORE:
# We need DOS and Windows headers, not host platform's
+ set originclude=$(%include)
set include=$(%watcom)/h/win;$(%watcom)/h
all: $(bins) .SYMBOLIC
# DOS mouse driver
-vbmouse.exe: vbmouse.lnk $(mousedos_objs)
+vbmouse.exe: vbmouse.lnk $(mousedos_objs) kittenc.exe
*wlink @$[@ name $@ file { $(mousedos_objs) }
+ $(run_host)kittenc.exe $@ attach nls/vbmouse.*
mousetsr.obj: mousetsr.c .AUTODEPEND
$(compile_dostsr)
@@ -62,13 +71,14 @@ mousew16.obj: mousew16.c .AUTODEPEND
$(compile_w16dll)
# DOS shared folders
-vbsf.exe: vbsf.lnk $(sfdos_objs)
+vbsf.exe: vbsf.lnk $(sfdos_objs) kittenc.exe
*wlink @$[@ name $@ file { $(sfdos_objs) }
+ $(run_host)kittenc.exe $@ attach nls/vbsf.*
sftsr.obj: sftsr.c .AUTODEPEND
$(compile_dostsr)
-sfmain.obj: sfmain.c .AUTODEPEND
+sfmain.obj: sfmain.c unitbl.h .AUTODEPEND
$(compile_dos)
# Auxiliary object files
@@ -78,6 +88,10 @@ vbox.obj: vbox.c .AUTODEPEND
kitten.obj: kitten.c .AUTODEPEND
$(compile_dos)
+# embed all unitbl/*.tbl files into a single unitbl.h
+unitbl.h: unitbl2c.exe $(unitbls)
+ $(run_host)unitbl2c.exe $@ unitbl/*.tbl
+
# Test programs
moustest_objs = moustest.obj
@@ -87,16 +101,22 @@ moustest.exe: moustest.obj
moustest.obj: moustest.c .AUTODEPEND
$(compile_dos) -mc -zu
+# Programs to build for the host
+host_bins = unitbl2c.exe kittenc.exe
+unitbl2c.exe: unitbl2c.c
+ $(compile_link_host)
+
+kittenc.exe: kittenc.c
+ $(compile_link_host)
+
# Other targets
clean: .SYMBOLIC
- rm -f vbmouse.exe vbmouse.drv vbsf.exe moustest.exe
- rm -f *.obj *.map
rm -f vbados.zip vbados.flp vbasrc.zip
+ rm -f $(bins) $(host_bins)
+ rm -f *.obj *.map
vbados.flp:
mformat -C -f 1440 -v VBADOS -i $^@ ::
- mcopy -i $^@ unitbl/*.tbl ::
- mcopy -i $^@ nls/vbsf.* nls/vbmouse.* ::
# Build a floppy image containing the driver
flp: vbados.flp $(bins) $(infs) .SYMBOLIC
@@ -104,7 +124,7 @@ flp: vbados.flp $(bins) $(infs) .SYMBOLIC
# Build a zip with the driver binaries
zip: vbmouse.exe vbmouse.drv oemsetup.inf vbsf.exe .SYMBOLIC
- zip --DOS-names -fz- -j vbados.zip unitbl/*.tbl nls/vbsf.* nls/vbmouse.*
+ zip --DOS-names -fz- -j vbados.zip nls/vbsf.* nls/vbmouse.*
zip --DOS-names -fz- vbados.zip $(bins) $(infs)
srczip: .SYMBOLIC