diff --git a/.gitignore b/.gitignore index c96683e..3d20f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -output/ +.build/ +.output/ .DS_Store \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f6b5b5c --- /dev/null +++ b/Makefile @@ -0,0 +1,70 @@ +# Muse Cross-Platform Build +APP_NAME=muse +VERSION?=dev +BUILD_DIR=.build +MAIN_PATH=./cmd/muse + +# Go build flags +LDFLAGS=-ldflags "-s -w -X main.version=$(VERSION)" + +# Platform and architecture combinations +PLATFORMS=\ + darwin/amd64 \ + darwin/arm64 \ + linux/amd64 \ + linux/arm64 \ + windows/amd64 \ + windows/arm64 + +.PHONY: build release clean help $(PLATFORMS) + +# Default target - build all binaries +build: $(PLATFORMS) + +# Build for specific platform/architecture +$(PLATFORMS): + $(eval GOOS=$(word 1,$(subst /, ,$@))) + $(eval GOARCH=$(word 2,$(subst /, ,$@))) + $(eval EXT=$(if $(filter windows,$(GOOS)),.exe,)) + @echo "Building $(APP_NAME) for $(GOOS)/$(GOARCH)..." + @mkdir -p $(BUILD_DIR)/$(GOOS)-$(GOARCH) + GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(LDFLAGS) -o $(BUILD_DIR)/$(GOOS)-$(GOARCH)/$(APP_NAME)$(EXT) $(MAIN_PATH) + +# Create release archives (builds first if needed) +release: build + @echo "Creating release archives..." + @for platform in $(PLATFORMS); do \ + GOOS=$$(echo $$platform | cut -d'/' -f1); \ + GOARCH=$$(echo $$platform | cut -d'/' -f2); \ + EXT=""; \ + if [ "$$GOOS" = "windows" ]; then EXT=".exe"; fi; \ + ARCHIVE_NAME="$(APP_NAME)-$(VERSION)-$$GOOS-$$GOARCH"; \ + if [ "$$GOOS" = "windows" ]; then \ + cd $(BUILD_DIR)/$$GOOS-$$GOARCH && zip -q ../$$ARCHIVE_NAME.zip $(APP_NAME)$$EXT && cd ../..; \ + else \ + tar -czf $(BUILD_DIR)/$$ARCHIVE_NAME.tar.gz -C $(BUILD_DIR)/$$GOOS-$$GOARCH $(APP_NAME)$$EXT; \ + fi; \ + echo "Created $$ARCHIVE_NAME archive"; \ + done + +# Clean build directory +clean: + @rm -rf $(BUILD_DIR) + +# Help target +help: + @echo "Muse Audio Generator Build System" + @echo "" + @echo "Available targets:" + @echo " build - Build binaries for all platforms (default)" + @echo " release - Build binaries and create release archives" + @echo " clean - Remove build directory" + @echo " help - Show this help message" + @echo "" + @echo "Supported platforms:" + @for platform in $(PLATFORMS); do echo " $$platform"; done + @echo "" + @echo "Examples:" + @echo " make # Build all binaries" + @echo " make release VERSION=1.0.0 # Create release archives" + @echo " make clean # Clean build directory" diff --git a/README.md b/README.md index 755f171..e8089fb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Muse - A Go-based Music Generator +# Muse - Digital Music Generator Muse is my attempt at a digital music generator written in pure Go. Its is VERY experimental and is not intended for production use. Enjoy! diff --git a/bin/muse b/bin/muse deleted file mode 100755 index 3f50f6b..0000000 Binary files a/bin/muse and /dev/null differ diff --git a/muse-1.0.0-windows-amd64.zip b/muse-1.0.0-windows-amd64.zip new file mode 100644 index 0000000..3b69878 Binary files /dev/null and b/muse-1.0.0-windows-amd64.zip differ diff --git a/muse-1.0.0-windows-arm64.zip b/muse-1.0.0-windows-arm64.zip new file mode 100644 index 0000000..c3db5ad Binary files /dev/null and b/muse-1.0.0-windows-arm64.zip differ