Add comprehensive README covering architecture, API usage, build instructions, tested drivers, binary patching details, and DGROUP layout. Expand file header comments in all library sources and headers to document module responsibilities, data flow, and key constraints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
65 lines
1.7 KiB
Makefile
65 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
|
|
|
|
$(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)
|