Rules are ordered and first-match-wins: model glob, path glob, required context, hook/retry overrides, pass <endpoint>[,<endpoint>] [as <model>] or block. Endpoints carry shell pre-hooks (exit != 0 = not yet, retried with backoff after an optional wake command), an offline window after a failed connect, and two timeouts (idle + total) so a thinking model logs still_working instead of looking hung. tests/run.sh: 14 checks against C stubs (failing, gated, slow, dead endpoints).
32 lines
808 B
Makefile
32 lines
808 B
Makefile
# junction — C99 + POSIX, no third-party libraries
|
|
CC ?= cc
|
|
CFLAGS ?= -std=c99 -O2 -Wall -Wextra -Wpedantic -Wshadow -Wconversion
|
|
CPPFLAGS += -D_POSIX_C_SOURCE=200809L
|
|
LDFLAGS ?=
|
|
PREFIX ?= /usr/local
|
|
|
|
SRC = src/config.c src/junction.c
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
all: junction
|
|
|
|
junction: $(OBJ)
|
|
$(CC) $(CFLAGS) $(OBJ) -o $@ $(LDFLAGS)
|
|
|
|
src/%.o: src/%.c src/config.h
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
|
|
|
test: junction
|
|
tests/run.sh
|
|
|
|
install: junction
|
|
install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/junction/hooks
|
|
install -m 0755 junction $(DESTDIR)$(PREFIX)/bin/junction
|
|
install -m 0755 hooks/*.sh $(DESTDIR)$(PREFIX)/share/junction/hooks/
|
|
install -m 0644 config.example $(DESTDIR)$(PREFIX)/share/junction/junction.conf
|
|
|
|
clean:
|
|
rm -f $(OBJ) junction
|
|
|
|
.PHONY: all test install clean
|