aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile41
-rw-r--r--README.md15
2 files changed, 48 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index bf4fb21..68bf656 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,34 @@
-CFLAGS = -std=c99 -Os -Wall -Wextra $(shell pkg-config --cflags xft x11)
-LDLIBS = $(shell pkg-config --libs xft x11)
-colitur-x: colitur-x.c config.h
- $(CC) $(CFLAGS) -o $@ colitur-x.c $(LDLIBS)
-clean:; rm -f colitur-x
+# colitur-x / colitur-mu -- X11 front-ends for colitur.
+# Configuration is compile-time: edit config.h and rebuild.
-CFLAGS_MU = -std=c99 -Os -Wall -Wextra $(shell pkg-config --cflags xft x11)
-colitur-mu: colitur-mu.c mu_x11.c mu_x11.h vendor/microui.c vendor/microui.h config.h
- $(CC) $(CFLAGS_MU) -o $@ colitur-mu.c mu_x11.c vendor/microui.c $(LDLIBS)
+PREFIX ?= $(HOME)/.local
+BINDIR = $(PREFIX)/bin
+
+CFLAGS ?= -std=c99 -Os -Wall -Wextra
+X11FLAGS = $(shell pkg-config --cflags xft x11)
+LDLIBS = $(shell pkg-config --libs xft x11)
+
+.PHONY: all help clean install uninstall
+
+all: colitur-x colitur-mu ## build both front-ends
+
+help: ## list targets
+ @grep -hE '^[a-z-]+:.*##' $(MAKEFILE_LIST) \
+ | sed -e 's/:.*##/\t/' -e 's/^/ /' | expand -t 16
+
+colitur-x: colitur-x.c config.h ## the read-only month grid (raw Xlib)
+ $(CC) $(CFLAGS) $(X11FLAGS) -o $@ colitur-x.c $(LDLIBS)
+
+colitur-mu: colitur-mu.c mu_x11.c mu_x11.h vendor/microui.c vendor/microui.h config.h ## the editable list (microui)
+ $(CC) $(CFLAGS) $(X11FLAGS) -o $@ colitur-mu.c mu_x11.c vendor/microui.c $(LDLIBS)
+
+install: all ## install both into $(BINDIR)
+ @mkdir -p $(BINDIR)
+ install -m 755 colitur-x colitur-mu $(BINDIR)
+ @echo "installed colitur-x and colitur-mu into $(BINDIR)"
+
+uninstall: ## remove them again
+ rm -f $(BINDIR)/colitur-x $(BINDIR)/colitur-mu
+
+clean: ## remove both binaries
+ rm -f colitur-x colitur-mu
diff --git a/README.md b/README.md
index a5662fc..920c056 100644
--- a/README.md
+++ b/README.md
@@ -4,10 +4,25 @@ A raw Xlib front-end for [colitur](../colitur): reads `colitur emit --format
csv` on stdin, draws the year as a month grid coloured by each day's
liturgical colour, and shows the selected day's readings underneath.
+ make && make install # into ~/.local/bin
colitur emit --format csv --from 2027 --to 2027 | colitur-x
Keys: arrows or `hjkl` move, `n`/`p` change month, `q` quits.
+It reads CSV on **stdin** and nothing else, so the shell decides what it
+shows. One month:
+
+ colitur emit --format csv --from 2027 --to 2027 \
+ | { head -1; grep "^2027-04"; } | colitur-x
+
+Another language, or a local calendar:
+
+ colitur emit --format csv --from 2027 --to 2027 --lang en | colitur-x
+ colitur emit --format csv --from 2027 --to 2027 \
+ --overlay ~/parish.sexp | colitur-x
+
+With no input it says so and exits 2.
+
## Why it exists
colitur is a Unix tool: it computes and prints. This is a separate program