Add versioning and dist packaging target
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-<platform>-v<version>.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 <noreply@anthropic.com>
This commit is contained in:
29
makefile
29
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)
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user