From 0e8bb9f989248a18a528363d0b5a49ea271b25a1 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Mon, 9 Mar 2026 15:38:59 -0500 Subject: [PATCH] Place build outputs in obj/ and bin/ directories Co-Authored-By: Claude Opus 4.6 --- forms/.gitignore | 2 ++ forms/README.md | 4 ++-- forms/makefile | 14 ++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 forms/.gitignore diff --git a/forms/.gitignore b/forms/.gitignore new file mode 100644 index 0000000..c6e49ef --- /dev/null +++ b/forms/.gitignore @@ -0,0 +1,2 @@ +obj/ +bin/ diff --git a/forms/README.md b/forms/README.md index 5204ab1..5485807 100644 --- a/forms/README.md +++ b/forms/README.md @@ -36,8 +36,8 @@ Windows 3.1 controls and sends user events back to the server. ## Building ``` -make # builds dfm2form and formsrv.o -make clean # removes build artifacts +make # builds bin/dfm2form and obj/formsrv.o +make clean # removes obj/ and bin/ ``` Requires GCC on Linux. The Delphi unit (`formcli.pas`) is compiled as diff --git a/forms/makefile b/forms/makefile index 69b929e..af978b1 100644 --- a/forms/makefile +++ b/forms/makefile @@ -2,15 +2,21 @@ CC = gcc CFLAGS = -Wall -Wextra -std=c99 -O2 LDFLAGS = -all: dfm2form formsrv.o +OBJDIR = obj +BINDIR = bin -dfm2form: dfm2form.c +all: $(BINDIR)/dfm2form $(OBJDIR)/formsrv.o + +$(BINDIR)/dfm2form: dfm2form.c | $(BINDIR) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -formsrv.o: formsrv.c formsrv.h +$(OBJDIR)/formsrv.o: formsrv.c formsrv.h | $(OBJDIR) $(CC) $(CFLAGS) -c -o $@ formsrv.c +$(OBJDIR) $(BINDIR): + mkdir -p $@ + clean: - rm -f dfm2form formsrv.o + rm -rf $(OBJDIR) $(BINDIR) .PHONY: all clean