Load Windows 3.x .FON (NE resource containers) and raw .FNT font files for use with ExtTextOut. Multiple fonts can be active simultaneously. All available .FON files contain v2 fonts but VBESVGA.DRV requires v3 in 386 protected mode, so the loader converts on load. - Add NE resource table structures (NeResourceTypeT, NeResourceEntryT) - Add WdrvFontT opaque type with load/unload API - Implement buildFontFromFnt() v2→v3 converter - Implement wdrvLoadFontFon() NE resource parser - Move font from per-driver to global singleton (wdrvLoadFontBuiltin) - Add WdrvFontT parameter to wdrvExtTextOut (NULL = built-in) - Add Demo 6: Courier, Sans Serif, System fonts side by side - Copy fon/*.FON to bin/ during build Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66 lines
1.7 KiB
Makefile
66 lines
1.7 KiB
Makefile
# ============================================================================
|
|
# Makefile for windrv demo - Windows 3.x display driver loader for DJGPP/DOS
|
|
#
|
|
# Targets:
|
|
# all - Build libwindrv.a and demo.exe (default)
|
|
# lib - Build only libwindrv.a
|
|
# demo - Build only demo.exe
|
|
# clean - Remove all build artifacts
|
|
#
|
|
# Output:
|
|
# bin/demo.exe - Demo program
|
|
# bin/CWSDPMI.EXE - DPMI host (extracted from tools/cwsdpmi.zip)
|
|
# bin/*.DRV - Driver files (copied from drivers/)
|
|
# win31drv/libwindrv.a - Static library
|
|
# ============================================================================
|
|
|
|
DJGPP_PREFIX ?= $(HOME)/djgpp/djgpp
|
|
|
|
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
|
|
CFLAGS = -Wall -Wextra -O2 -std=gnu99 -Iwin31drv
|
|
LDFLAGS =
|
|
|
|
# DJGPP binutils need libfl.so.2 which may not be installed system-wide
|
|
export LD_LIBRARY_PATH := $(realpath tools/lib):$(LD_LIBRARY_PATH)
|
|
|
|
OBJDIR = obj
|
|
BINDIR = bin
|
|
|
|
LIBDIR = win31drv
|
|
LIB = $(LIBDIR)/libwindrv.a
|
|
|
|
DEMO_SRC = demo.c
|
|
DEMO_OBJ = $(OBJDIR)/demo.o
|
|
DEMO_EXE = $(BINDIR)/demo.exe
|
|
|
|
.PHONY: all clean lib demo
|
|
|
|
all: lib demo
|
|
|
|
lib:
|
|
$(MAKE) -C $(LIBDIR)
|
|
|
|
demo: $(DEMO_EXE)
|
|
|
|
$(DEMO_EXE): $(DEMO_OBJ) lib | $(BINDIR)
|
|
$(CC) $(CFLAGS) -o $@ $(DEMO_OBJ) -L$(LIBDIR) -lwindrv $(LDFLAGS)
|
|
unzip -oj tools/cwsdpmi.zip bin/CWSDPMI.EXE -d $(BINDIR) 2>/dev/null; true
|
|
cp tools/TEST.BAT $(BINDIR)/
|
|
-cp -n drivers/*.DRV $(BINDIR)/ 2>/dev/null; true
|
|
-cp -n fon/*.FON $(BINDIR)/ 2>/dev/null; true
|
|
|
|
$(OBJDIR)/%.o: %.c | $(OBJDIR)
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
$(OBJDIR):
|
|
mkdir -p $(OBJDIR)
|
|
|
|
$(BINDIR):
|
|
mkdir -p $(BINDIR)
|
|
|
|
# Dependencies
|
|
$(OBJDIR)/demo.o: demo.c win31drv/windrv.h win31drv/wintypes.h
|
|
|
|
clean:
|
|
$(MAKE) -C $(LIBDIR) clean
|
|
-rm -rf $(OBJDIR) $(BINDIR)
|