notashelf /
9b42e70054b83db1ffa193b4329a929b8f8bf508
chroma
publicLightweight wallpaper daemon for Wayland
clone
ssh://git@git.notashelf.dev:33/notashelf/chroma.gitCommit 9b42e70054b8
tarballunverified3 files changed+62-10
@@ -1,5 +1,5 @@ PROJECT_NAME = chroma-VERSION = 1.0.0+VERSION = 1.0.1 # Directories SRCDIR = src@@ -69,7 +69,7 @@ $(INCDIR): @mkdir -p $(INCDIR) # Build main executable-$(TARGET): $(PROTOCOL_HEADERS) $(OBJECTS) | $(BINDIR)+$(TARGET): version-header $(PROTOCOL_HEADERS) $(OBJECTS) | $(BINDIR) @echo " LINK $@" @$(CC) $(OBJECTS) -o $@ $(LDFLAGS) @@ -110,6 +110,16 @@ uninstall: rm -f $(DESTDIR)$(SYSTEMD_INSTALL)/$(PROJECT_NAME).service @echo "Uninstall complete." +# Create version header+version-header:+ @echo "Generating version header..."+ @echo "#ifndef CHROMA_VERSION_H" > $(INCDIR)/chroma_version.h+ @echo "#define CHROMA_VERSION_H" >> $(INCDIR)/chroma_version.h+ @echo "" >> $(INCDIR)/chroma_version.h+ @echo "#define CHROMA_VERSION \"$(VERSION)\"" >> $(INCDIR)/chroma_version.h+ @echo "" >> $(INCDIR)/chroma_version.h+ @echo "#endif // CHROMA_VERSION_H" >> $(INCDIR)/chroma_version.h+ # Create systemd service file systemd-service: $(SYSTEMD_DIR)/$(PROJECT_NAME).service @@ -140,33 +150,68 @@ test: $(TARGET) @echo "Running tests..." @echo "Tests not implemented yet." +# Version management targets+bump-patch:+ @echo "Bumping patch version..."+ @$(eval NEW_VERSION := $(shell echo $(VERSION) | awk -F. '{print $$1"."$$2"."$$3+1}'))+ @sed -i 's/^VERSION = .*/VERSION = $(NEW_VERSION)/' Makefile+ @echo "Version bumped to $(NEW_VERSION)"++bump-minor:+ @echo "Bumping minor version..."+ @$(eval NEW_VERSION := $(shell echo $(VERSION) | awk -F. '{print $$1"."$$2+1".0"}'))+ @sed -i 's/^VERSION = .*/VERSION = $(NEW_VERSION)/' Makefile+ @echo "Version bumped to $(NEW_VERSION)"++bump-major:+ @echo "Bumping major version..."+ @$(eval NEW_VERSION := $(shell echo $(VERSION) | awk -F. '{print $$1+1".0.0"}'))+ @sed -i 's/^VERSION = .*/VERSION = $(NEW_VERSION)/' Makefile+ @echo "Version bumped to $(NEW_VERSION)"++set-version:+ @if [ -z "$(NEW_VER)" ]; then \+ echo "Usage: make set-version NEW_VER=X.Y.Z"; \+ exit 1; \+ fi+ @echo "Setting version to $(NEW_VER)..."+ @sed -i 's/^VERSION = .*/VERSION = $(NEW_VER)/' Makefile+ @echo "Version set to $(NEW_VER)"+ # Help target help: @echo "Available targets:"- @echo " all - Build the main executable (default)"+ @echo " all - Build main executable (default)" @echo " debug - Build with debug symbols and sanitizers" @echo " static - Build statically linked executable" @echo " check-deps - Check if all dependencies are available"- @echo " install - Install the executable and systemd service"+ @echo " install - Install executable and systemd service" @echo " uninstall - Remove installed files" @echo " clean - Remove build artifacts" @echo " distclean - Remove all generated files" @echo " format - Format source code (requires clang-format)" @echo " analyze - Run static analysis (requires cppcheck)" @echo " test - Run tests"+ @echo " version-header - Generate version header from Makefile"+ @echo " bump-patch - Increment patch version (X.Y.Z+1)"+ @echo " bump-minor - Increment minor version (X.Y+1.0)"+ @echo " bump-major - Increment major version (X+1.0.0)"+ @echo " set-version - Set specific version (use NEW_VER=X.Y.Z)" @echo " help - Show this help message" @echo "" @echo "Examples:"- @echo " make # Build with default settings"- @echo " make debug # Build debug version"- @echo " make PREFIX=/usr install # Install to /usr instead of /usr/local"- @echo " make CC=clang # Use clang instead of gcc"+ @echo " make # Build with default settings"+ @echo " make debug # Build debug version"+ @echo " make PREFIX=/usr install # Install to /usr instead of /usr/local"+ @echo " make CC=clang # Use clang instead of gcc"+ @echo " make bump-patch # Bump to 1.0.2"+ @echo " make set-version NEW_VER=2.0.0 # Set to 2.0.0" # Include dependency files -include $(DEPENDS) # Phony targets-.PHONY: all debug static check-deps install uninstall systemd-service sample-config clean distclean format analyze test help+.PHONY: all debug static check-deps install uninstall systemd-service version-header sample-config clean distclean format analyze test help bump-patch bump-minor bump-major set-version # Print variables print-%:@@ -12,7 +12,8 @@ #include <wayland-client.h> #include <wayland-egl.h> -#define CHROMA_VERSION "1.0.0"+#include "chroma_version.h"+ #define MAX_OUTPUTS 16 #define MAX_PATH_LEN 4096 #define CONFIG_FILE_NAME "chroma.conf"@@ -0,0 +1,6 @@+#ifndef CHROMA_VERSION_H+#define CHROMA_VERSION_H++#define CHROMA_VERSION "1.0.1"++#endif // CHROMA_VERSION_H