Artifact 1a9317e73e893f832528773dbb076c10d01fdfd47e1072dea2ab073e4d092216:
- File
Makefile
— part of check-in
[97a66a25ee]
at
2026-11-09 23:33:15
on branch tickets
— Add tickets: new, ready, show, claim, done, drop
Tickets live in the private repository until shared ones exist. A claim is atomic, session start offers ready work, and audit findings can become tickets. (user: dmestas, size: 1278) [annotate] [blame] [check-ins using] [more...]
CC ?= cc
CFLAGS ?= -O2
VENDOR = vendor/libfossil
SQLITE = -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1
LDLIBS = -lz -lpthread -lm
ifeq ($(shell uname -s),Darwin)
LDLIBS += -liconv
else
LDLIBS += -ldl
endif
ctx: build/ctx.o build/libfossil.o build/sqlite3.o
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
build:
mkdir -p build
# The schema is compiled into the binary, one C string literal per line.
build/schema.h: schema/index.sql | build
awk 'BEGIN { print "static const char ctx_schema[] =" } \
{ gsub(/\\/, "\\\\"); gsub(/"/, "\\\""); print "\"" $$0 "\\n\"" } \
END { print ";" }' $< > $@
build/ticket_schema.h: schema/ticket-table.sql | build
awk 'BEGIN { print "static const char ctx_ticket_schema[] =" } \
{ gsub(/\\/, "\\\\"); gsub(/"/, "\\\""); print "\"" $$0 "\\n\"" } \
END { print ";" }' $< > $@
build/ctx.o: src/ctx.c build/schema.h build/ticket_schema.h | build
$(CC) $(CFLAGS) -Wall -Wextra -I$(VENDOR) -Ibuild -c -o $@ $<
build/sqlite3.o: $(VENDOR)/sqlite3.c | build
$(CC) $(CFLAGS) $(SQLITE) -w -c -o $@ $<
build/libfossil.o: $(VENDOR)/libfossil.c | build
$(CC) $(CFLAGS) -DHAVE_LIBFOSSIL_CONFIG_H -w -I$(VENDOR) -c -o $@ $<
test: ctx
sh test/run.sh
clean:
rm -rf build ctx
.PHONY: test clean