diff --git a/.github/workflows/build-all-and-release.yml b/.github/workflows/build-all-and-release.yml index 3a32acb28..f666552d8 100644 --- a/.github/workflows/build-all-and-release.yml +++ b/.github/workflows/build-all-and-release.yml @@ -16,7 +16,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pc-nzp-linux32.zip - path: ./engine/release/nzportable32 + path: ./engine/release/nzportable32-sdl Compile-Linux64: runs-on: ubuntu-latest container: @@ -32,7 +32,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pc-nzp-linux64.zip - path: ./engine/release/nzportable64 + path: ./engine/release/nzportable64-sdl Compile-LinuxArm64: runs-on: ubuntu-latest container: @@ -48,7 +48,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pc-nzp-linux_arm64.zip - path: ./engine/release/nzportablearm64 + path: ./engine/release/nzportablearm64-sdl Compile-LinuxArmhf: runs-on: ubuntu-latest container: @@ -64,7 +64,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pc-nzp-linux_armhf.zip - path: ./engine/release/nzportablearmhf + path: ./engine/release/nzportablearmhf-sdl Compile-Windows32: runs-on: ubuntu-latest container: @@ -80,7 +80,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pc-nzp-win32.zip - path: ./engine/release/nzportable.exe + path: ./engine/release/nzportable-sdl.exe Compile-Windows64: runs-on: ubuntu-latest container: @@ -96,7 +96,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pc-nzp-win64.zip - path: ./engine/release/nzportable64.exe + path: ./engine/release/nzportable-sdl64.exe Compile-WASM: runs-on: ubuntu-latest container: @@ -231,4 +231,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - id: ${{ steps.create_release.outputs.id }} \ No newline at end of file + id: ${{ steps.create_release.outputs.id }} diff --git a/engine/Makefile b/engine/Makefile index 471810c90..41f579874 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -23,7 +23,7 @@ #note: cross compiling will typically require 'make makelibs FTE_TARGET=mytarget', which avoids installing lots of extra system packages. # -CC=gcc +CC?=gcc WINDRES=windres STRIP?=strip @@ -1143,28 +1143,27 @@ ifeq (win_SDL,$(findstring win,$(FTE_TARGET))$(findstring _SDL,$(FTE_TARGET))) EXEPOSTFIX=.exe - CC_MACHINE:=$(shell $(CC) -dumpmachine) - ARCH_PREDEP=$(BASE_DIR)/libs/SDL2-$(SDL2VER)/$(CC_MACHINE)/bin/sdl2-config - SDLCONFIG=$(ARCH_PREDEP) --prefix=$(BASE_DIR)/libs/SDL2-$(SDL2VER)/$(CC_MACHINE) + ARCH_PREDEP=$(BASE_DIR)/libs-$(ARCH)/SDL2-$(SDL2VER)/$(ARCH)/bin/sdl2-config + SDLCONFIG=$(ARCH_PREDEP) --prefix=$(BASE_DIR)/libs-$(ARCH)/SDL2-$(SDL2VER)/$(ARCH) ARCH_CFLAGS=`$(SDLCONFIG) --cflags` #the defaults for sdl come first GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) gl_vidsdl.o snd_sdl.o cd_sdl.o sys_sdl.o in_sdl.o snd_directx.o $(LTO_END) resources.o $(LTO_START) GL_EXE_NAME=../$(EXE_NAME)-sdl-gl$(BITS)$(EXEPOSTFIX) GLCL_EXE_NAME=../$(EXE_NAME)-sdl-glcl$(BITS)$(EXEPOSTFIX) - ifdef windir +# ifdef windir GL_LDFLAGS=$(GLLDFLAGS) -lmingw32 -lws2_32 `$(SDLCONFIG) --static-libs` VK_LDFLAGS=$(GLLDFLAGS) -lmingw32 -lws2_32 `$(SDLCONFIG) --static-libs` M_LDFLAGS=$(MLDFLAGS) -lmingw32 -lws2_32 `$(SDLCONFIG) --static-libs` SV_LDFLAGS=-lm -lmingw32 -lws2_32 -lwinmm `$(SDLCONFIG) --static-libs` QCC_LDFLAGS= - else - GL_LDFLAGS=$(IMAGELDFLAGS) -lws2_32 -lmingw32 $(SDL_LDFLAGS) -mwindows -ldxguid -lwinmm -lole32 $(GLLDFLAGS) `$(SDLCONFIG) --libs` - VK_LDFLAGS=$(IMAGELDFLAGS) -lws2_32 -lmingw32 $(SDL_LDFLAGS) -mwindows -ldxguid -lwinmm -lole32 $(GLLDFLAGS) `$(SDLCONFIG) --libs` - M_LDFLAGS=$(IMAGELDFLAGS) -lws2_32 -lmingw32 $(SDL_LDFLAGS) -mwindows -ldxguid -lwinmm -lole32 $(MLDFLAGS) `$(SDLCONFIG) --libs` - SV_LDFLAGS=-lm -lmingw32 -lws2_32 -lwinmm `$(SDLCONFIG) --libs` - QCC_LDFLAGS= - endif +# else +# GL_LDFLAGS=$(IMAGELDFLAGS) -lws2_32 -lmingw32 $(SDL_LDFLAGS) -mwindows -ldxguid -lwinmm -lole32 $(GLLDFLAGS) `$(SDLCONFIG) --libs` +# VK_LDFLAGS=$(IMAGELDFLAGS) -lws2_32 -lmingw32 $(SDL_LDFLAGS) -mwindows -ldxguid -lwinmm -lole32 $(GLLDFLAGS) `$(SDLCONFIG) --libs` +# M_LDFLAGS=$(IMAGELDFLAGS) -lws2_32 -lmingw32 $(SDL_LDFLAGS) -mwindows -ldxguid -lwinmm -lole32 $(MLDFLAGS) `$(SDLCONFIG) --libs` +# SV_LDFLAGS=-lm -lmingw32 -lws2_32 -lwinmm `$(SDLCONFIG) --libs` +# QCC_LDFLAGS= +# endif GL_CFLAGS=-DFTE_SDL $(GLCFLAGS) $(CLIENTLIBFLAGS) $(DX7SDK) @@ -2271,11 +2270,11 @@ droid-help: @-echo @-echo "Note that 'make droid-rel' will automatically generate a keystore. If you forget the password, just do a 'make dist-clean'." -$(BASE_DIR)/libs/SDL2-$(SDL2VER)/i686-w64-mingw32/bin/sdl2-config: +$(BASE_DIR)/libs-$(ARCH)/SDL2-$(SDL2VER)/i686-w64-mingw32/bin/sdl2-config: wget http://www.libsdl.org/release/SDL2-devel-$(SDL2VER)-mingw.tar.gz -O $(BASE_DIR)/sdl2.tar.gz - cd $(BASE_DIR)/libs && tar -xvzf $(BASE_DIR)/sdl2.tar.gz + cd $(BASE_DIR)/libs-$(ARCH) && tar -xvzf $(BASE_DIR)/sdl2.tar.gz rm $(BASE_DIR)/sdl2.tar.gz -$(BASE_DIR)/libs/SDL2-$(SDL2VER)/x86_64-w64-mingw32/bin/sdl2-config: $(BASE_DIR)/libs/SDL2-$(SDL2VER)/i686-w64-mingw32/bin/sdl2-config +$(BASE_DIR)/libs-$(ARCH)/SDL2-$(SDL2VER)/x86_64-w64-mingw32/bin/sdl2-config: $(BASE_DIR)/libs-$(ARCH)/SDL2-$(SDL2VER)/i686-w64-mingw32/bin/sdl2-config diff --git a/tools/build-nzp-linux32.sh b/tools/build-nzp-linux32.sh index c68d4a211..fe4f0a470 100755 --- a/tools/build-nzp-linux32.sh +++ b/tools/build-nzp-linux32.sh @@ -1,2 +1,5 @@ cd ../engine -make makelibs FTE_TARGET=linux32 && make m-rel FTE_TARGET=linux32 FTE_CONFIG=nzportable -j32 \ No newline at end of file +export CC=i686-linux-gnu-gcc +export STRIP=i686-linux-gnu-strip +make makelibs FTE_TARGET=SDL2 && make m-rel FTE_TARGET=SDL2 FTE_CONFIG=nzportable -j32 +mv release/nzportable-sdl2 release/nzportable32-sdl diff --git a/tools/build-nzp-linux64.sh b/tools/build-nzp-linux64.sh index 8c959a3c5..d7eef7d78 100755 --- a/tools/build-nzp-linux64.sh +++ b/tools/build-nzp-linux64.sh @@ -1,2 +1,5 @@ cd ../engine -make makelibs FTE_TARGET=linux64 && make m-rel FTE_TARGET=linux64 FTE_CONFIG=nzportable -j32 +export CC=x86_64-linux-gnu-gcc +export STRIP=x86_64-linux-gnu-strip +make makelibs FTE_TARGET=SDL2 && make m-rel FTE_TARGET=SDL2 FTE_CONFIG=nzportable -j32 +mv release/nzportable-sdl2 release/nzportable64-sdl diff --git a/tools/build-nzp-linux_arm64.sh b/tools/build-nzp-linux_arm64.sh index f826cb0f4..ee73b7641 100755 --- a/tools/build-nzp-linux_arm64.sh +++ b/tools/build-nzp-linux_arm64.sh @@ -1,2 +1,5 @@ cd ../engine -make makelibs FTE_TARGET=linux_arm64 && make m-rel FTE_TARGET=linux_arm64 FTE_CONFIG=nzportable -j32 \ No newline at end of file +export CC=aarch64-linux-gnu-gcc +export STRIP=aarch64-linux-gnu-strip +make makelibs FTE_TARGET=SDL2 && make m-rel FTE_TARGET=SDL2 FTE_CONFIG=nzportable -j32 +mv release/nzportable-sdl2 release/nzportablearm64-sdl diff --git a/tools/build-nzp-linux_armhf.sh b/tools/build-nzp-linux_armhf.sh index 2a6955a01..08a0191e1 100755 --- a/tools/build-nzp-linux_armhf.sh +++ b/tools/build-nzp-linux_armhf.sh @@ -1,2 +1,5 @@ cd ../engine -make makelibs FTE_TARGET=linux_armhf && make m-rel FTE_TARGET=linux_armhf FTE_CONFIG=nzportable -j32 \ No newline at end of file +export CC=arm-linux-gnueabihf-gcc +export STRIP=arm-linux-gnueabihf-strip +make makelibs FTE_TARGET=SDL2 && make m-rel FTE_TARGET=SDL2 FTE_CONFIG=nzportable -j32 +mv release/nzportable-sdl2 release/nzportablearmhf-sdl diff --git a/tools/build-nzp-macosx_x86.sh b/tools/build-nzp-macosx_x86.sh index e8e80ec50..2c8c113b5 100755 --- a/tools/build-nzp-macosx_x86.sh +++ b/tools/build-nzp-macosx_x86.sh @@ -1,4 +1,4 @@ export MACOSX_DEPLOYMENT_TARGET=10.14 osxcross-macports install libsdl2 libsdl cd ../engine -make makelibs FTE_TARGET=macosx_x86 && make m-rel FTE_TARGET=macosx_x86 FTE_CONFIG=nzportable -j8 \ No newline at end of file +make makelibs FTE_TARGET=macosx_x86 && make m-rel FTE_TARGET=macosx_x86 FTE_CONFIG=nzportable -j8 diff --git a/tools/build-nzp-win32.sh b/tools/build-nzp-win32.sh index 3a74458aa..ef844cea6 100755 --- a/tools/build-nzp-win32.sh +++ b/tools/build-nzp-win32.sh @@ -1,2 +1,5 @@ cd ../engine -make makelibs FTE_TARGET=win32 && make m-rel FTE_TARGET=win32 FTE_CONFIG=nzportable -j32 \ No newline at end of file +make makelibs FTE_TARGET=win32_SDL2 && make m-rel FTE_TARGET=win32_SDL2 FTE_CONFIG=nzportable -j32 +# Running make once is not sufficient... there are link errors (undefined reference to SDL's functions). +# Doing it twice works. I don't know why. +make m-rel FTE_TARGET=win32_SDL2 FTE_CONFIG=nzportable -j32 diff --git a/tools/build-nzp-win64.sh b/tools/build-nzp-win64.sh index 9a4ff2105..d48bf9b2c 100755 --- a/tools/build-nzp-win64.sh +++ b/tools/build-nzp-win64.sh @@ -1,2 +1,5 @@ cd ../engine -make makelibs FTE_TARGET=win64 && make m-rel FTE_TARGET=win64 FTE_CONFIG=nzportable -j32 +make makelibs FTE_TARGET=win64_SDL2 && make m-rel FTE_TARGET=win64_SDL2 FTE_CONFIG=nzportable -j32 +# Running make once is not sufficient... there are link errors (undefined reference to SDL's functions). +# Doing it twice works. I don't know why. +make m-rel FTE_TARGET=win64_SDL2 FTE_CONFIG=nzportable -j32