From 7f75b8edce7e64896b8c2c62124e4ac509af5274 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 4 Jul 2025 22:40:23 +0200 Subject: [PATCH] fix: allow building without a git repo --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ff9ef8b..b3ad922 100644 --- a/Makefile +++ b/Makefile @@ -20,11 +20,13 @@ DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS)) _OBJ = main.o log.o util.o ui.o ui_state.o config.o desktop.o auth.o ofield.o efield.o users.o sessions.o chvt.o launch_state.o OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) +.git/HEAD: + $(IDIR)/version.h: Makefile .git/HEAD @tmp=$$(mktemp); \ printf '' > $$tmp; \ echo '#define LIDM_VERSION "'$(VERSION)'"' >> $$tmp; \ - echo '#define LIDM_GIT_REV "'$$(git describe --long --tags --always)'"' >> $$tmp; \ + echo '#define LIDM_GIT_REV "'$$(git describe --long --tags --always || echo '?')'"' >> $$tmp; \ echo '#define LIDM_BUILD_TS '$$(date +%s) >> $$tmp; \ if ! cmp -s $$tmp $@; then \ mv $$tmp $@; \