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 $@