diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-29 10:30:33 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-29 10:30:33 +0200 |
| commit | 00b51e3292062f52a4699440cb36b3aa337dbd17 (patch) | |
| tree | c887cd96eaaef06691c846dbbbfe9be81a1ca6a3 /Makefile | |
| parent | 8d7d3ac6f2b365342aa25ecb31f8e76d18090a22 (diff) | |
| download | clectio-00b51e3292062f52a4699440cb36b3aa337dbd17.tar.gz clectio-00b51e3292062f52a4699440cb36b3aa337dbd17.zip | |
build: add `make dist` source-tarball target + .gitattributes export-ignore
- `make dist` runs git archive to write clectio-$(VERSION).tar.gz: a snapshot of
the committed tree only -- no .git history, and no build artifacts (they are
untracked, so git archive can't include them). VERSION defaults to 1.0,
overridable (make dist VERSION=x). `clean` removes the tarball; it is
gitignored.
- .gitattributes marks .gitignore and .gitattributes export-ignore, so they stay
out of the shipped source tarball.
Claude-Session: https://claude.ai/code/session_01S1CD1u3tgSS4xNu6WHfp5a
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,6 +1,7 @@ # clectio -- tiny, fast, suckless daily readings # Configure by editing config.h (copied from config.def.h on first build). +VERSION = 1.0 CC ?= cc CFLAGS = -std=c99 -Os -Wall -Wextra # -no-pie: this is a local CLI reading static embedded data with no attack @@ -17,7 +18,7 @@ FORM := $(shell grep -Eq '^[[:space:]]*\#[[:space:]]*define[[:space:]]+FORM_EF # format as gen/, Vulgate-numbered). Empty = use the shipped Vulgate text. CORPUS ?= -.PHONY: all clean size install uninstall +.PHONY: all clean size dist install uninstall all: clectio @@ -52,6 +53,13 @@ clectio: clectio.c puff.c puff.h config.h calendar.h text.lz.h gen/liturgy_$(FOR size: clectio @ls -l clectio | awk '{printf "clectio (%s): %d bytes = %.0f KB\n","$(FORM)",$$5,$$5/1024}' +# Source release: a snapshot of the committed tree only -- no .git history and no +# build artifacts (they are untracked, so git archive can never include them). +# Honours .gitattributes export-ignore. Commit first; it archives HEAD. +dist: + git archive --format=tar.gz --prefix=clectio-$(VERSION)/ -o clectio-$(VERSION).tar.gz HEAD + @echo "wrote clectio-$(VERSION).tar.gz ($$(du -h clectio-$(VERSION).tar.gz | cut -f1))" + install: clectio install -Dm755 clectio $(DESTDIR)$(PREFIX)/bin/clectio install -Dm644 clectio.1 $(DESTDIR)$(MANPREFIX)/man1/clectio.1 @@ -61,4 +69,4 @@ uninstall: rm -f $(DESTDIR)$(MANPREFIX)/man1/clectio.1 clean: - rm -f clectio mktext bin2h text.lz.h gen/verses_of.keys gen/verses_ef.keys + rm -f clectio mktext bin2h text.lz.h gen/verses_of.keys gen/verses_ef.keys clectio-*.tar.gz |
