From 6d9949f88bebd50a1d305acb4dc375e3d403b9cd Mon Sep 17 00:00:00 2001 From: MoHadiShibli <142665133+MoHadiShibli@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:29:47 +0300 Subject: [PATCH] Build: rebuild everything when VERSION changes The version is passed in as a compiler flag, and make doesn't notice a changed flag. After the bump to 1.1.0, only files whose source had changed were recompiled, so main.c and log.c still logged 1.0.0 and the app could show it. Objects now depend on VERSION. Builds from a clean checkout, as CI does, were never affected. --- Makefile | 4 +++- launcher/Makefile | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 61160bb..9cfee1a 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,9 @@ all: $(ELF) $(OBJDIR) build: mkdir -p $@ -$(OBJDIR)/%.o: src/%.c | $(OBJDIR) +# VERSION is compiled into the objects, and make doesn't notice a changed flag, +# so a new version has to rebuild them. +$(OBJDIR)/%.o: src/%.c VERSION | $(OBJDIR) $(CC) $(CFLAGS) -c $< -o $@ build/client.c: client/index.html tools/embed_client.py | build diff --git a/launcher/Makefile b/launcher/Makefile index d782581..ceedc8f 100644 --- a/launcher/Makefile +++ b/launcher/Makefile @@ -18,9 +18,10 @@ FONTS := ../vendor/roboto/Roboto-Light.ttf ../vendor/roboto/Roboto-Regular.ttf all: package $(OUT): mkdir -p $@ -$(OUT)/%.o: %.c | $(OUT) +# The version is compiled in; a new one must rebuild everything that shows it. +$(OUT)/%.o: %.c ../VERSION | $(OUT) $(CC) $(CFLAGS) -std=gnu11 -c $< -o $@ -$(OUT)/main.o: main.cpp | $(OUT) +$(OUT)/main.o: main.cpp ../VERSION | $(OUT) $(CXX) $(CFLAGS) -std=c++17 -fno-exceptions -fno-rtti -c $< -o $@ $(OUT)/qrcodegen.o: ../vendor/qrcodegen/qrcodegen.c | $(OUT) $(CC) $(CFLAGS) -std=gnu11 -c $< -o $@