WinDriver/win31drv/Makefile
Scott Duensing 431f573422 Remove development diagnostics and clean up codebase
Strip out watchpoint system (thunkSetWatch, WATCH-PRE/POST), INT 10h
entry counters, segment verification dumps, and inline extern
declarations. Add neSetDebug to neload.h, correct -fno-gcse comment,
and add project CLAUDE.md for git-tracked notes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 18:27:00 -06:00

50 lines
1.7 KiB
Makefile

# ============================================================================
# Makefile for win31drv - Windows 3.x display driver library for DJGPP/DOS
# ============================================================================
DJGPP_PREFIX ?= $(HOME)/djgpp/djgpp
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
AR = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-ar
CFLAGS = -Wall -Wextra -O2 -std=gnu99 -I.
# With -O2 GCSE enabled, GCC's code layout for windrv.c places stack
# locals and register spills at addresses that get corrupted during
# 16-bit driver calls via thunkCall16, causing wrong values in drawing
# parameters. Disabling GCSE changes the layout enough to avoid the
# issue. Only windrv.c is affected (it has the drawing functions that
# call thunkCall16 with interleaved parameter setup).
WINDRV_CFLAGS = $(CFLAGS) -fno-gcse
# 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
SRCS = log.c neload.c thunk.c winstub.c windrv.c
OBJS = $(addprefix $(OBJDIR)/,$(SRCS:.c=.o))
LIB = libwindrv.a
.PHONY: all clean
all: $(LIB)
$(LIB): $(OBJS)
$(AR) rcs $@ $^
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR):
mkdir -p $(OBJDIR)
# Dependencies
$(OBJDIR)/log.o: log.c log.h
$(OBJDIR)/neload.o: neload.c neload.h neformat.h wintypes.h log.h
$(OBJDIR)/thunk.o: thunk.c thunk.h wintypes.h log.h
$(OBJDIR)/winstub.o: winstub.c winstub.h thunk.h wintypes.h log.h
$(OBJDIR)/windrv.o: windrv.c windrv.h wintypes.h winddi.h neformat.h neload.h thunk.h winstub.h log.h
$(CC) $(WINDRV_CFLAGS) -c -o $@ $<
clean:
-rm -rf $(OBJDIR) $(LIB)