diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 47 |
1 files changed, 44 insertions, 3 deletions
@@ -14,7 +14,7 @@ BLUE := \033[0;34m RED := \033[0;31m NC := \033[0m -.PHONY: all clean windows linux android portable help test install-deps +.PHONY: all clean windows linux android portable appimage help test install-deps # Default target all: portable @@ -24,9 +24,10 @@ help: @echo "Khimera Portable Build System v$(VERSION)" @echo "" @echo "Usage:" - @echo " make portable - Build all portable executables" + @echo " make portable - Build all portable executables (local dev)" + @echo " make linux - Build Linux executable only (local dev)" @echo " make windows - Build Windows executable only" - @echo " make linux - Build Linux executable only" + @echo " make appimage - Build portable AppImage via Docker (release)" @echo " make android - Build Android APK only" @echo " make clean - Clean build artifacts" @echo " make test - Run tests" @@ -81,6 +82,44 @@ linux: install-deps echo "$(RED)✗$(NC) Linux build failed"; \ fi +# Build AppImage (portable Linux release via Docker) +appimage: + @echo "$(BLUE)╔════════════════════════════════════════╗$(NC)" + @echo "$(BLUE)║ KHIMERA APPIMAGE BUILD v$(VERSION) ║$(NC)" + @echo "$(BLUE)╚════════════════════════════════════════╝$(NC)" + @echo "" + @echo "$(BLUE)[AppImage]$(NC) Building Docker image..." + docker build -t khimera-builder -f docker/Dockerfile.appimage . + @echo "$(BLUE)[AppImage]$(NC) Compiling and packaging..." + docker run --rm --privileged \ + -v $(shell pwd):/build \ + -w /build \ + khimera-builder \ + bash -c " \ + go mod tidy && \ + CGO_ENABLED=1 go build \ + -ldflags='$(LDFLAGS)' \ + -o /tmp/khimera-bin \ + ./khimera-main.go && \ + mkdir -p AppDir/usr/bin AppDir/usr/share/applications AppDir/usr/share/icons/hicolor/256x256/apps && \ + cp /tmp/khimera-bin AppDir/usr/bin/khimera && \ + cp appimage/khimera.desktop AppDir/usr/share/applications/ && \ + cp appimage/khimera.desktop AppDir/ && \ + cp appimage/khimera.png AppDir/usr/share/icons/hicolor/256x256/apps/ 2>/dev/null || true && \ + cp appimage/khimera.png AppDir/ 2>/dev/null || true && \ + linuxdeploy --appdir AppDir \ + --library /usr/lib/x86_64-linux-gnu/libGL.so.1 \ + --library /usr/lib/x86_64-linux-gnu/libX11.so.6 \ + --output appimage \ + --desktop-file appimage/khimera.desktop \ + " + @mkdir -p $(OUTPUT_DIR)/Linux + @mv Khimera*.AppImage $(OUTPUT_DIR)/Linux/Khimera-v$(VERSION)-x86_64.AppImage 2>/dev/null || \ + mv khimera*.AppImage $(OUTPUT_DIR)/Linux/Khimera-v$(VERSION)-x86_64.AppImage + @rm -rf AppDir + @echo "$(GREEN)✓ AppImage build complete!$(NC)" + @echo "Output: $(OUTPUT_DIR)/Linux/Khimera-v$(VERSION)-x86_64.AppImage" + # Build Android APK (placeholder - requires Android SDK) android: @echo "$(YELLOW)[Android]$(NC) Android build not yet implemented" @@ -112,6 +151,8 @@ clean: rm -rf $(OUTPUT_DIR) rm -rf khimera-portable-v*.zip rm -rf khimera-portable-v*.tar.gz + rm -rf AppDir + rm -f *.AppImage @echo "$(GREEN)✓$(NC) Clean complete" # Package distribution |
