- Fixed hot reload: after TLS session restore, the bot now does a fresh IRC connection and re-sends PASS/NICK/USER to re-register with the server, fixing the issue where channels were never re-joined after !reload or !restart. - Removed ZYNK_RESTORE_FD env var approach; reload_try_restore now restores settings and returns 1 to trigger a fresh connect. - Added !hello command for casual greeting. - Added atomic build rule in Makefile (compile to .tmp, then mv). - Added comprehensive function-level documentation across the entire codebase (~80 new doc comments).
34 lines
636 B
Makefile
34 lines
636 B
Makefile
PREFIX ?= /usr/local
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
CC ?= gcc
|
|
CFLAGS ?= -Wall -Wextra -pedantic
|
|
LDLIBS ?= -lssl -lcrypto -ldl
|
|
|
|
# Homebrew OpenSSL on macOS
|
|
BREW_SSL := $(shell brew --prefix openssl 2>/dev/null)
|
|
ifneq ($(BREW_SSL),)
|
|
CFLAGS += -I$(BREW_SSL)/include
|
|
LDFLAGS += -L$(BREW_SSL)/lib
|
|
endif
|
|
|
|
.PHONY: all clean install uninstall
|
|
|
|
all: zynk
|
|
|
|
zynk: zynk.c
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@.tmp $< $(LDLIBS)
|
|
mv -f $@.tmp $@
|
|
|
|
calc: zynk.c
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
|
|
|
|
clean:
|
|
rm -vf zynk
|
|
|
|
install: calc
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
cp calc $(DESTDIR)$(BINDIR)/zynk
|
|
|
|
uninstall:
|
|
rm -vf $(DESTDIR)$(BINDIR)/zynk
|