From 17d0961eb01a0c45aad15d2c638755cd261e003d Mon Sep 17 00:00:00 2001 From: Anachronaut Date: Wed, 8 Jul 2026 17:40:00 -0400 Subject: [PATCH] Add versioning and dist packaging target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VERSION in makefile is now the single source of truth — it flows into the about screen via -DAPP_VERSION at compile time and into the archive filename via the dist target. `make dist` produces SoundThing--v.tar.gz (Linux) or .zip (Windows) containing the binary and the full patch library. Also fixes a trailing-spaces-in-PROJECT makefile gotcha that was silently embedding spaces in the binary path. Co-Authored-By: Claude Sonnet 4.6 --- makefile | 29 ++++++++++++++++++++++++++--- source/ui.c | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 32cfeaf..6494b59 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,9 @@ # Recursive Directory Digesting Makefile V1.0 # === Project Settings === -PROJECT := soundThing # Change this to your project name -CFLAGS := -Wall -Wextra -std=c11 -O2 +# Change PROJECT and VERSION here — VERSION flows into the about screen and archive names. +PROJECT := soundThing +VERSION := 0.9.5 +CFLAGS := -Wall -Wextra -std=c11 -O2 -DAPP_VERSION=\"$(VERSION)\" # Preprocessor flags (deps only here) CPPFLAGS := -MMD -MP @@ -34,6 +36,16 @@ else WIN_RES := endif +# === Distribution === +DIST_NAME := SoundThing-$(PLATFORM)-v$(VERSION) +ifeq ($(PLATFORM),windows) + ARCHIVE_CMD = zip -r "$(DIST_NAME).zip" "$(DIST_NAME)" + ARCHIVE_EXT = zip +else + ARCHIVE_CMD = tar czf "$(DIST_NAME).tar.gz" "$(DIST_NAME)" + ARCHIVE_EXT = tar.gz +endif + # === Directory Structure === SRC_DIR := source OBJ_DIR := build @@ -58,7 +70,7 @@ FONT_DATA := $(SRC_DIR)/font_data.c ICON_DATA := $(SRC_DIR)/icon_data.c # === Rules === -.PHONY: all clean run dirs +.PHONY: all clean run dirs dist all: dirs $(SPRITES_DATA) $(FONT_DATA) $(ICON_DATA) $(BIN) @@ -86,6 +98,17 @@ clean: @rm -rf $(OBJ_DIR) $(BIN) @echo "Clean complete." +# Package a release archive: make dist / make dist PLATFORM=windows +dist: all + rm -rf "$(DIST_NAME)" + mkdir -p "$(DIST_NAME)" + cp "$(BIN)" "$(DIST_NAME)/" + cp -r patches "$(DIST_NAME)/" + rm -f "$(DIST_NAME)/patches/favorites.txt" + $(ARCHIVE_CMD) + rm -rf "$(DIST_NAME)" + @echo "Packaged -> $(DIST_NAME).$(ARCHIVE_EXT)" + # Include auto-generated dependency files (if present) -include $(DEP) diff --git a/source/ui.c b/source/ui.c index d10ed6a..d9d6a04 100644 --- a/source/ui.c +++ b/source/ui.c @@ -1691,7 +1691,7 @@ void uiAboutMenu(UIState *ui, float x, float y, float width) /* Edit these strings to update the about screen. */ static const char *lines[] = { - "SoundThing v0.9.5", + "SoundThing v" APP_VERSION, "", "Polyphonic subtractive synthesizer", "Built with Raylib",