From b322e507985b86ab98ac5ad7588c7fc95ef810bd Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sat, 8 Feb 2020 12:05:41 +0200 Subject: [PATCH] make: support out-of-git builds E.g. releases would be these with git archive and such. --- GNUmakefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 0b94767..c173660 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -4,7 +4,7 @@ bindir ?= /bin libdir ?= /lib mandir ?= /share/man/man1 -GIT_SHA1 = $(shell git rev-parse HEAD) +GIT_SHA1 = $(shell git rev-parse HEAD 2>/dev/null || printf 'nogit') MAKEFLAGS += --no-builtin-rules WARNINGS = -Wall -Wextra -Wpedantic -Wformat=2 -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wstack-usage=12500 \ @@ -26,6 +26,11 @@ curses: bemenu-renderer-curses.so x11: bemenu-renderer-x11.so wayland: bemenu-renderer-wayland.so +# support non git builds +.git/index: + mkdir -p .git + touch .git/index + %.a: $(LINK.c) -c $(filter %.c,$^) $(LDLIBS) -o $@