aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukasz@arcofasiagroup.com>2026-08-21 09:38:22 +0200
committerLukasz Kasprzak <lukasz@arcofasiagroup.com>2026-08-21 09:38:22 +0200
commitd58ac7945a97b4029772022550775ab834c81b97 (patch)
tree37c170b31593991fd6f0a15387be36aefae908f9 /Makefile
parentc453d5c3ba41af61975a83ea553b41e410d88ae2 (diff)
downloadcolitur-x-d58ac7945a97b4029772022550775ab834c81b97.tar.gz
colitur-x-d58ac7945a97b4029772022550775ab834c81b97.zip
build: proper Makefile with install, and usage in the README
PREFIX ?= $(HOME)/.local and a '## '-comment help target, matching the sibling projects. The old file had no all target, no install, and a clean that removed only one of the two binaries.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 33 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