From 1b9e3118374a13dc12652d87b1dd3d1ccfecbbf3 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 3 Sep 2026 23:49:29 +0200 Subject: 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. --- makefile | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'makefile') 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 -- cgit v1.2.3