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",