Files
comet/Makefile
Ken Johnson bade0eb593 Comet 1.00 - Initial commit: complete standalone FidoNet TCP mailer
Standalone FidoNet mailer daemon implementing the Comet protocol
(TCP variant of the Nova protocol family) with BinkP/1.1 fallback.
Written in Free Pascal for DOS/Win/OS2/Linux/FreeBSD.

15 source files, ~10K lines:
- Protocol: length-prefixed frames, SHA-256/384/512, CRC-32,
  bidirectional transfer with sliding window, adaptive block sizing
- Session: own TCP handshake with BinkP auto-detection on port 26638
- Outbound: BSO (Binkley), FrontDoor, D'Bridge format support
- Daemon: multi-session with thread pool, outbound scanner
- Paths: DOS<->Linux bridge with case-insensitive lookup, drive mapping
- Config: INI-style with heavily documented sample (COMET.SAM)

All 17 Nova interop bug fixes baked in from the start.
18/18 tests passing (CRC-32, SHA-256/384/512, frame encode/decode).
2026-03-29 20:02:37 -07:00

77 lines
1.8 KiB
Makefile

# Comet - Direct TCP File Transfer for FidoNet
# Makefile for Free Pascal Compiler
FPC = fpc
FPCFLAGS = -Mobjfpc -Sh -Se
FPCOPT =
# Output directory for compiled units
UNITDIR = units
BINDIR = .
# Source files (order matters for dependencies)
UNITS = cometdef cometpath cometcrc cometsha cometlog cometcfg \
comettcp cometfrm cometbso cometfile cometses cometxfer \
cometbinkp cometdaemon
TESTS = test_crc test_sha test_frame
PROGRAM = comet
# Default target
all: $(PROGRAM)
# Build the main program (compiles all units automatically)
$(PROGRAM): comet.pas $(addsuffix .pas,$(UNITS))
$(FPC) $(FPCFLAGS) $(FPCOPT) comet.pas
# Build and run all tests
test: test_crc test_sha test_frame
@echo "=== Running tests ==="
@./test_crc
@./test_sha
@./test_frame
@echo "=== All tests passed ==="
test_crc: test_crc.pas cometcrc.pas
$(FPC) $(FPCFLAGS) $(FPCOPT) test_crc.pas
test_sha: test_sha.pas cometsha.pas
$(FPC) $(FPCFLAGS) $(FPCOPT) test_sha.pas
test_frame: test_frame.pas cometfrm.pas comettcp.pas cometcrc.pas cometdef.pas cometlog.pas
$(FPC) $(FPCFLAGS) $(FPCOPT) test_frame.pas
# Compile individual units (for checking syntax)
units: $(addsuffix .ppu,$(UNITS))
%.ppu: %.pas
$(FPC) $(FPCFLAGS) $(FPCOPT) $<
# Debug build
debug: FPCOPT += -g -gl -dDEBUG
debug: clean all
# Clean compiled output
clean:
rm -f *.o *.ppu *.rsj $(PROGRAM) $(TESTS) link.res ppas.sh
# Full clean including backups
distclean: clean
rm -f *~ *.bak
# Install (copy binary to /usr/local/bin)
install: $(PROGRAM)
install -m 755 $(PROGRAM) /usr/local/bin/$(PROGRAM)
@echo "Installed to /usr/local/bin/$(PROGRAM)"
# Show file statistics
stats:
@echo "=== Source files ==="
@wc -l $(addsuffix .pas,$(UNITS)) comet.pas COMET.SAM
@echo
@echo "=== Binary ==="
@ls -la $(PROGRAM) 2>/dev/null || echo "(not built)"
.PHONY: all test units debug clean distclean install stats