diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..d43c929 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,13 @@ +{ + "permissions": { + "allow": [ + "Bash(dir \"C:\\mingw\\gitea\\orni_attack\\release\\dll\")", + "Bash(make:*)", + "Bash(echo:*)", + "Bash(objdump:*)", + "Bash(unzip:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/CMakeLists.txt b/CMakeLists.txt index c1c5b98..e9fd4c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ # CMakeLists.txt cmake_minimum_required(VERSION 3.10) -project(orni VERSION 0.7.1) +project(diskito VERSION 0.7.1) # Info del proyecto -set(PROJECT_LONG_NAME "Orni Attack") +set(PROJECT_LONG_NAME "diskito") set(PROJECT_COPYRIGHT_ORIGINAL "© 1999 Visente i Sergi") set(PROJECT_COPYRIGHT_PORT "© 2025 JailDesigner") set(PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT_ORIGINAL}, ${PROJECT_COPYRIGHT_PORT}") @@ -84,6 +84,12 @@ endif() if(WIN32) target_compile_definitions(${PROJECT_NAME} PRIVATE WINDOWS_BUILD) target_link_libraries(${PROJECT_NAME} PRIVATE mingw32) + # Static linking for libgcc and libstdc++ (avoid DLL dependencies for distribution) + target_link_options(${PROJECT_NAME} PRIVATE + -static-libgcc + -static-libstdc++ + -static + ) # Añadir icono en Windows (se configurará desde el Makefile con windres) elseif(APPLE) target_compile_definitions(${PROJECT_NAME} PRIVATE MACOS_BUILD) diff --git a/Makefile b/Makefile index 3f6956d..132ac51 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ DIR_BIN := $(DIR_ROOT) # TARGET NAMES # ============================================================================== ifeq ($(OS),Windows_NT) - TARGET_NAME := $(shell powershell -Command "$$line = Get-Content CMakeLists.txt | Where-Object {$$_ -match '^project'}; if ($$line -match 'project\s*\x28(\w+)') { $$matches[1] }") - LONG_NAME := $(shell powershell -Command "$$line = Get-Content CMakeLists.txt | Where-Object {$$_ -match 'PROJECT_LONG_NAME'}; if ($$line -match '\"(.+)\"') { $$matches[1] }") + TARGET_NAME := $(shell powershell -Command "(Select-String -Path 'CMakeLists.txt' -Pattern 'project\s*\x28(\w+)').Matches.Groups[1].Value") + LONG_NAME := $(shell powershell -Command "(Select-String -Path 'CMakeLists.txt' -Pattern 'PROJECT_LONG_NAME\s+\x22(.+?)\x22').Matches.Groups[1].Value") else TARGET_NAME := $(shell awk '/^project/ {gsub(/[)(]/, " "); print $$2}' CMakeLists.txt) LONG_NAME := $(shell grep 'PROJECT_LONG_NAME' CMakeLists.txt | sed 's/.*"\(.*\)".*/\1/') @@ -21,7 +21,11 @@ RELEASE_FOLDER := $(TARGET_NAME)_release RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME) # Release file names -RAW_VERSION := $(shell echo $(VERSION) | sed 's/^v//') +ifeq ($(OS),Windows_NT) + RAW_VERSION := $(shell powershell -Command "\"$(VERSION)\" -replace '^v', ''") +else + RAW_VERSION := $(shell echo $(VERSION) | sed 's/^v//') +endif WINDOWS_RELEASE := $(TARGET_NAME)-$(VERSION)-windows-x64.zip MACOS_ARM_RELEASE := $(TARGET_NAME)-$(VERSION)-macos-arm64.dmg MACOS_INTEL_RELEASE := $(TARGET_NAME)-$(VERSION)-macos-x64.dmg @@ -33,7 +37,7 @@ APP_NAME := $(LONG_NAME) # VERSION # ============================================================================== ifeq ($(OS),Windows_NT) - VERSION := v$(shell powershell -Command "$$line = Get-Content CMakeLists.txt | Where-Object {$$_ -match '^project'}; if ($$line -match 'VERSION\s+([0-9.]+)') { $$matches[1] }") + VERSION := v$(shell powershell -Command "(Select-String -Path 'CMakeLists.txt' -Pattern 'project.*VERSION\s+([0-9.]+)').Matches.Groups[1].Value") else VERSION := v$(shell grep "^project" CMakeLists.txt | tr -cd 0-9.) endif @@ -47,14 +51,16 @@ endif # ============================================================================== # PLATFORM-SPECIFIC UTILITIES # ============================================================================== +# Use Unix commands always (MinGW Make uses bash even on Windows) +RMFILE := rm -f +RMDIR := rm -rf +MKDIR := mkdir -p + ifeq ($(OS),Windows_NT) - RMFILE := del /Q - RMDIR := rmdir /S /Q - MKDIR := mkdir + # Windows-specific: Force cmd.exe shell for PowerShell commands + SHELL := cmd.exe else - RMFILE := rm -f - RMDIR := rm -rf - MKDIR := mkdir -p + # Unix-specific UNAME_S := $(shell uname -s) endif @@ -71,7 +77,7 @@ PACK_TOOL := tools/pack_resources/pack_resources .PHONY: pack_tool resources.pack pack_tool: - @$(MAKE) -C tools/pack_resources + @make -C tools/pack_resources resources.pack: pack_tool @echo "Creating resources.pack..." @@ -214,37 +220,25 @@ linux_release: pack_tool resources.pack # Windows Release (requires MinGW on Windows or cross-compiler on Linux) .PHONY: windows_release -windows_release: - @echo "Creating Windows release - Version: $(VERSION)" - @echo "Note: This target should be run on Windows with MinGW or use windows_cross on Linux" - - # Clean previous - @$(RMDIR) "$(RELEASE_FOLDER)" - @$(RMFILE) "$(WINDOWS_RELEASE)" - - # Create folder - @$(MKDIR) "$(RELEASE_FOLDER)" - - # Copy resources - @cp -r resources "$(RELEASE_FOLDER)/" - @cp release/dll/*.dll "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: DLLs not found" - @cp LICENSE "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: LICENSE not found" - @cp README.md "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: README.md not found" - - # Compile resource file - @windres release/$(TARGET_NAME).rc -O coff -o release/$(TARGET_NAME).res 2>/dev/null || echo "Warning: windres failed" - - # Compile with CMake - @cmake -B build -DCMAKE_BUILD_TYPE=Release +windows_release: pack_tool resources.pack + @echo off + @echo Creating Windows release - Version: $(VERSION) + @powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force} + @powershell if (Test-Path "$(WINDOWS_RELEASE)") {Remove-Item "$(WINDOWS_RELEASE)"} + @powershell if (-not (Test-Path "$(RELEASE_FOLDER)")) {New-Item "$(RELEASE_FOLDER)" -ItemType Directory} + @powershell Copy-Item -Path "resources.pack" -Destination "$(RELEASE_FOLDER)" + @powershell Copy-Item "release\dll\SDL3.dll" -Destination "$(RELEASE_FOLDER)" + @powershell Copy-Item "release\dll\libwinpthread-1.dll" -Destination "$(RELEASE_FOLDER)" + @powershell if (Test-Path "LICENSE") {Copy-Item "LICENSE" -Destination "$(RELEASE_FOLDER)"} + @powershell if (Test-Path "README.md") {Copy-Item "README.md" -Destination "$(RELEASE_FOLDER)"} + @windres release/$(TARGET_NAME).rc -O coff -o release/$(TARGET_NAME).res 2>nul || echo Warning: windres failed + @cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release @cmake --build build - @cp $(TARGET_FILE).exe "$(RELEASE_FILE).exe" || cp $(TARGET_FILE) "$(RELEASE_FILE).exe" - - # Package - @cd "$(RELEASE_FOLDER)" && zip -r ../$(WINDOWS_RELEASE) * - @echo "✓ Windows release created: $(WINDOWS_RELEASE)" - - # Cleanup - @$(RMDIR) "$(RELEASE_FOLDER)" + @powershell if (Test-Path "$(TARGET_FILE).exe") {Copy-Item "$(TARGET_FILE).exe" -Destination "$(RELEASE_FILE).exe"} else {Copy-Item "$(TARGET_FILE)" -Destination "$(RELEASE_FILE).exe"} + @strip "$(RELEASE_FILE).exe" 2>nul || echo Warning: strip not available + @powershell Compress-Archive -Path "$(RELEASE_FOLDER)\*" -DestinationPath "$(WINDOWS_RELEASE)" -Force + @echo Release created: $(WINDOWS_RELEASE) + @powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force} # Raspberry Pi Release (cross-compilation from Linux/macOS) .PHONY: rpi_release @@ -263,7 +257,7 @@ rpi_release: @$(MKDIR) "$(RELEASE_FOLDER)" # Copy resources - @cp -r resources "$(RELEASE_FOLDER)/" + @cp resources.pack "$(RELEASE_FOLDER)/" @cp LICENSE "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: LICENSE not found" @cp README.md "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: README.md not found" @@ -299,8 +293,8 @@ windows_cross: @$(MKDIR) "$(RELEASE_FOLDER)" # Copy resources - @cp -r resources "$(RELEASE_FOLDER)/" - @cp release/dll/*.dll "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: DLLs not found in release/dll/" + @cp resources.pack "$(RELEASE_FOLDER)/" + @cp release/dll/SDL3.dll release/dll/libwinpthread-1.dll "$(RELEASE_FOLDER)/" @cp LICENSE "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: LICENSE not found" @cp README.md "$(RELEASE_FOLDER)/" 2>/dev/null || echo "Warning: README.md not found" @@ -336,7 +330,7 @@ else @$(RMDIR) build $(RELEASE_FOLDER) @$(RMFILE) *.dmg *.zip *.tar.gz 2>/dev/null || true @$(RMFILE) resources.pack 2>/dev/null || true - @$(MAKE) -C tools/pack_resources clean 2>/dev/null || true + @make -C tools/pack_resources clean 2>/dev/null || true endif @echo "Clean complete" diff --git a/release/orni.res b/release/orni.res new file mode 100644 index 0000000..bb96112 Binary files /dev/null and b/release/orni.res differ