From b1c131b6788a0339c91ba97693d7542eae91ad74 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 19 Sep 2024 16:52:22 +0200 Subject: [PATCH 1/6] BUILD: Check vcpkg build deps in bootstrap.sh. Less things to document. --- bootstrap.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 74ec5d38c..70ac82a4e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,12 +1,26 @@ -#!/bin/sh +#!/bin/sh -e show_error() { - echo "Error: $1" + printf "\e[31mError\e[0m: $1\n" exit 1 } -if ! command -v git >/dev/null 2>&1; then - show_error "Git is needed to checkout vcpkg, but it's not installed or not available in PATH." +required_commands="cmake ninja git automake autoconf pkg-config curl zip unzip tar" + +missing_deps="" +for cmd in $required_commands; do + if ! command -v "$cmd" >/dev/null 2>&1; then + missing_deps="$missing_deps $cmd" + fi +done + +# naming differs on macOS/Linux +if ! command -v "libtoolize" >/dev/null 2>&1 && ! command -v "glibtoolize" >/dev/null 2>&1; then + missing_deps="$missing_deps libtool"; +fi + +if [ -n "$missing_deps" ]; then + show_error "Install packages that provide support for:$missing_deps" fi if [ -e ".git" ]; then From ce5bb698b33bbc0126d32b1bfd0ee7f1cc085874 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 19 Sep 2024 18:35:10 +0200 Subject: [PATCH 2/6] BUILD: Remove old unused nsis installer. This is managed by nQuake since a long time by now. --- misc/install/ezquake.nsi | 267 --------------------------------------- 1 file changed, 267 deletions(-) delete mode 100644 misc/install/ezquake.nsi diff --git a/misc/install/ezquake.nsi b/misc/install/ezquake.nsi deleted file mode 100644 index f8c35fda6..000000000 --- a/misc/install/ezquake.nsi +++ /dev/null @@ -1,267 +0,0 @@ -;This is NSIS Script file. -;See http://nsis.sf.net/ -; -;You are required to place it into same dir with these files: -; ezquake.nsi (this file) -; ezquake-gl.exe (GLRelease) -; ezquake.exe (Release) -; gnu.txt (GNU GENERAL PUBLIC LICENSE, Version 2, June 1991) -; qw/ (dir) -; fragfile.dat (CVS/ezquake/misc/fragfile/fragfile.dat) -; skins/ (dir) -; (CVS/media/game/skins/ go here) -; ezquake/ (dir) -; base.pk3 (pak) -; / (from cvs/media/game except for cvs/media/game/textures/wad and cvs/media/game/skins/) -; hud.pk3 (pak) -; /textures/wad (from cvs/media/textures/wad) -; help.pk3 -; /help/variables/ (from documentation system) -; /help/commands/ (from documentation system) -; progs.pk3 (pak) -; qwprogs.dat (http://zquake.frag.ru/files/qwprogs.dat) -; spprogs.dat (http://zquake.frag.ru/files/spprogs.dat) -; locs.pk3 (pak) (CVS/media/game/locs) -; cfg/ (dir, see CVS/ezquake/misc/cfg/) -; help/ (dir, see CVS/documentation) -; manual/ (cvs/documentation/manual) -; xsd/ (cvs/documentation/xsd) -; xsl/ (cvs/documentation/xsl) -; index.xml (cvs/documentation/index.xml) -; manual/ (dir, link to online version at http://ezquake.sourceforge.net/docs/) -; sb/ (dir, see CVS/ezquake/misc/sb) -; inst_gfx/ (dir) -; top.bmp (cuky) -; left.bmp (cuky) -; ezinst.ico (cuky) -; -;Using NSIS, files listed above and this install script you are able to create Windows installer for ezQuake. -; -;-------------------------------- - -; We go for Modern UI -!include "MUI.nsh" -!include "FileFunc.nsh" -!insertmacro DirState -!define MUI_ICON "inst_gfx\ezinst.ico" -!define MUI_UNICON "inst_gfx\ezinst.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_BITMAP "inst_gfx\top.bmp" -!define MUI_HEADERIMAGE_UNBITMAP "inst_gfx\top.bmp" -!define MUI_WELCOMEFINISHPAGE_BITMAP "inst_gfx\left.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "inst_gfx\left.bmp" -!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH -!define MUI_FINISHPAGE_NOAUTOCLOSE -SetCompressor /SOLID /FINAL lzma - -; The name of the installer -Name "ezQuake" - -; The file to write -OutFile "ezquake_win32_xxxx.exe" - -; The default installation directory -InstallDir "C:\Quake\" - -; Registry key to check for directory (so if you install again, it will -; overwrite the old one automatically) -InstallDirRegKey HKLM "Software\ezQuake" "Install_dir" - - -;-------------------------------- -; Pages -!define MUI_WELCOMEPAGE_TITLE "Welcome to ezQuake installation" -!insertmacro MUI_PAGE_WELCOME - -;!insertmacro MUI_PAGE_LICENSE readme.txt - -!insertmacro MUI_PAGE_LICENSE gnu.txt - -!insertmacro MUI_PAGE_COMPONENTS - -!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Choose your Quake directory. It should contain id1 subdirectory." -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckId1Presence -!insertmacro MUI_PAGE_DIRECTORY - -!insertmacro MUI_PAGE_INSTFILES - -!define MUI_FINISHPAGE_SHOWREADME http://ezquake.sourceforge.net/docs/?setup -!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show Readme" -!define MUI_FINISHPAGE_LINK_LOCATION http://ezquake.sourceforge.net/docs/?changelog -!define MUI_FINISHPAGE_LINK "Changelog" -!insertmacro MUI_PAGE_FINISH - -; uninstaller -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES - - -;-------------------------------- -; Language -!insertmacro MUI_LANGUAGE "English" - - -;-------------------------------- -; The stuff to install -Section "!ezQuake client" Main - - SectionIn RO - - ; Set output path to the installation directory. - SetOutPath "$INSTDIR" - - ; Put file there - File "ezquake-gl.exe" - - CreateDirectory $INSTDIR\ezquake - SetOutPath $INSTDIR\ezquake - File "ezquake\base.pk3" - File "ezquake\help.pk3" - File "ezquake\locs.pk3" - File "ezquake\levelshots.pk3" - File "ezquake\pak.lst" - - CreateDirectory $INSTDIR\ezquake\cfg - SetOutPath $INSTDIR\ezquake\cfg - File "ezquake\cfg\*.cfg" - - CreateDirectory $INSTDIR\ezquake\help - CreateDirectory $INSTDIR\ezquake\help\manual - CreateDirectory $INSTDIR\ezquake\help\xsd - CreateDirectory $INSTDIR\ezquake\help\xsl - SetOutPath $INSTDIR\ezquake\help - File /r "ezquake\help\index.xml" - SetOutPath $INSTDIR\ezquake\help\manual - File /r "ezquake\help\manual\*.*" - SetOutPath $INSTDIR\ezquake\help\xsd - File "ezquake\help\xsd\*.*" - SetOutPath $INSTDIR\ezquake\help\xsl - File "ezquake\help\xsl\*.*" - - CreateDirectory $INSTDIR\ezquake\sb - SetOutPath $INSTDIR\ezquake\sb - File "ezquake\sb\au-sv.txt" - File "ezquake\sb\ctf.txt" - File "ezquake\sb\eu-sv.txt" - File "ezquake\sb\global.txt" - File "ezquake\sb\na-sv.txt" - File "ezquake\sb\qizmo.txt" - File "ezquake\sb\sa-sv.txt" - File "ezquake\sb\tf.txt" - File "ezquake\sb\eu-4on4.txt" - ; here we make sure user always has some server browser sources file even if he unchecks next section and doesn't have any sources.txt yet - SetOverwrite off - File "ezquake\sb\sources.txt" - SetOverwrite on - - CreateDirectory $INSTDIR\qw - SetOutPath $INSTDIR\qw - File "qw\fragfile.dat" - CreateDirectory $INSTDIR\qw\skins - SetOutPath $INSTDIR\qw\skins - File "qw\skins\*.*" - - CreateDirectory $INSTDIR\ezquake\manual - SetOutPath $INSTDIR\ezquake\manual - File /r "ezquake\manual\*.*" - - ; Write the installation path into the registry - WriteRegStr HKLM SOFTWARE\ezQuake "Install_Dir" "$INSTDIR" - - ; Write the uninstall keys for Windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ezQuake" "ezQuake" "QuakeWorld client" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ezQuake" "UninstallString" '"$INSTDIR\ezuninstall.exe"' - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ezQuake" "NoModify" 1 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ezQuake" "NoRepair" 1 - WriteUninstaller "ezuninstall.exe" - -SectionEnd - -Section "Server Browser Index" SBIndex - SetOutPath $INSTDIR\ezquake\sb - File "ezquake\sb\sources.txt" -SectionEnd - -Section "QuakeWorld Progs" Progs - SetOutPath $INSTDIR\ezquake - File "ezquake\progs.pk3" -SectionEnd - -Section /o "Modern HUD Icons" HUDIcons - SetOutPath $INSTDIR\ezquake - File "ezquake\hud.pk3" -SectionEnd - -Section /o "Software rendering" Software - SetOutPath $INSTDIR - File "ezquake.exe" -SectionEnd - -; Optional section (can be disabled by the user) -Section "Start Menu Shortcuts" StartMenu - SetOutPath $INSTDIR - CreateDirectory "$SMPROGRAMS\ezQuake" - CreateShortCut "$SMPROGRAMS\ezQuake\Uninstall.lnk" "$INSTDIR\ezuninstall.exe" "" - CreateShortCut "$SMPROGRAMS\ezQuake\ezQuake.lnk" "$INSTDIR\ezquake-gl.exe" "" "$INSTDIR\ezquake-gl.exe" - CreateShortCut "$SMPROGRAMS\ezQuake\Manual.lnk" "http://ezquake.sourceforge.net/docs/" "" -SectionEnd - -;-------------------------------- - -; Uninstaller - -Section "Uninstall" - - ; Remove registry keys - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ezQuake" - DeleteRegKey HKLM "SOFTWARE\ezQuake" - - ; Remove files and uninstaller - Delete "$INSTDIR\ezquake.exe" - Delete "$INSTDIR\ezquake-gl.exe" - Delete "$INSTDIR\ezquake-security.dll" - Delete "$INSTDIR\ezuninstall.exe" - RMDir /r "$INSTDIR\ezquake\help" - RMDir /r "$INSTDIR\ezquake\manual" - RMDir /r "$INSTDIR\ezquake\sb" - Delete "$INSTDIR\ezquake\base.pk3" - Delete "$INSTDIR\ezquake\hud.pk3" - Delete "$INSTDIR\ezquake\locs.pk3" - Delete "$INSTDIR\ezquake\progs.pk3" - Delete "$INSTDIR\ezquake\help.pk3" - Delete "$INSTDIR\ezquake\levelshots.pk3" - Delete "$INSTDIR\ezquake\pak.lst" - - ; Remove shortcuts, if any - Delete "$SMPROGRAMS\ezQuake\*.*" - - ; Remove directories used - RMDir "$SMPROGRAMS\ezQuake" - - ; Don't remove install dir because it's Quake root dir! - ; Don't remove ezquake\configs because users may have use of their configs in future! - -SectionEnd - -Function CheckId1Presence - ${DirState} "$INSTDIR\id1" $R0 - StrCmp $R0 -1 0 +2 - MessageBox MB_OK|MB_ICONEXCLAMATION "The id1 subdirectory was not found. Probably you won't be able to run this client. You have to install this client into the same directory where id1 subdirectory from Quake 1 installation is." -FunctionEnd - -LangString DESC_Section1 ${LANG_ENGLISH} "Main client data" -LangString DESC_Section2 ${LANG_ENGLISH} "If you wish to keep your own Server Browser sources list, uncheck this. Note: offline server lists we provide will always get updated with this installer." -LangString DESC_Section3 ${LANG_ENGLISH} "Modern stylish head up display icons." -LangString DESC_Section4 ${LANG_ENGLISH} "Will install executable with software rendering support. Install this if your computer's graphics card is really old or is missing OpenGL acceleration." -LangString DESC_Section5 ${LANG_ENGLISH} "Check in case you want to bind extra mouse buttons when using Logitech mouse with MouseWare drivers." -LangString DESC_Section6 ${LANG_ENGLISH} "Start menu shortcuts" -LangString DSC_SCT_PGS ${LANG_ENGLISH} "You need this to host a Multiplayer game or start a Singleplayer game." - -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${Main} $(DESC_Section1) - !insertmacro MUI_DESCRIPTION_TEXT ${SBIndex} $(DESC_Section2) - !insertmacro MUI_DESCRIPTION_TEXT ${HUDIcons} $(DESC_Section3) - !insertmacro MUI_DESCRIPTION_TEXT ${Software} $(DESC_Section4) - !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} $(DESC_Section6) - !insertmacro MUI_DESCRIPTION_TEXT ${Progs} $(DSC_SCT_PGS) -!insertmacro MUI_FUNCTION_DESCRIPTION_END From ceead03ff0d464990f90bb02ce92d2c9bd21aed8 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 19 Sep 2024 18:34:05 +0200 Subject: [PATCH 3/6] BUILD: Remove old unused docker builder. --- misc/docker-nightly-build/Dockerfile | 19 ----- misc/docker-nightly-build/Dockerfile.focal | 26 ------ .../Dockerfile.focal-cross | 29 ------- misc/docker-nightly-build/README.md | 56 ------------- misc/docker-nightly-build/build_image.sh | 1 - misc/docker-nightly-build/forcebuild.sh | 5 -- misc/docker-nightly-build/linux.sh | 5 -- misc/docker-nightly-build/mk_nightly.sh | 82 ------------------- misc/docker-nightly-build/nightly.sh | 5 -- 9 files changed, 228 deletions(-) delete mode 100644 misc/docker-nightly-build/Dockerfile delete mode 100644 misc/docker-nightly-build/Dockerfile.focal delete mode 100644 misc/docker-nightly-build/Dockerfile.focal-cross delete mode 100644 misc/docker-nightly-build/README.md delete mode 100755 misc/docker-nightly-build/build_image.sh delete mode 100755 misc/docker-nightly-build/forcebuild.sh delete mode 100755 misc/docker-nightly-build/linux.sh delete mode 100755 misc/docker-nightly-build/mk_nightly.sh delete mode 100755 misc/docker-nightly-build/nightly.sh diff --git a/misc/docker-nightly-build/Dockerfile b/misc/docker-nightly-build/Dockerfile deleted file mode 100644 index ddbcbf87e..000000000 --- a/misc/docker-nightly-build/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM debian:buster - -LABEL authors="Anders Lindmark ,Andreas Beisler " - -RUN apt-get update && \ - apt-get install -y git build-essential mingw-w64 libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libsndfile-dev p7zip-full && \ - apt-get clean - -# Add buildscript -ADD mk_nightly.sh / - -# Target volume for the nightly archive -VOLUME /source -VOLUME /nightly - -# Default target platform -ENV TARGET_PLATFORM WINDOWS - -CMD /mk_nightly.sh diff --git a/misc/docker-nightly-build/Dockerfile.focal b/misc/docker-nightly-build/Dockerfile.focal deleted file mode 100644 index de10e80ab..000000000 --- a/misc/docker-nightly-build/Dockerfile.focal +++ /dev/null @@ -1,26 +0,0 @@ -FROM ubuntu:20.04 as builder - -ENV TZ=ETC/Utc -# hadolint ignore=DL3008 -RUN DEBIAN_FRONTEND=noninteractive apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - curl \ - git \ - libcurl4-openssl-dev \ - libexpat1-dev \ - libfreetype6-dev \ - libjansson-dev \ - libjpeg-dev \ - libpng-dev \ - libsdl2-2.0-0 \ - libsdl2-dev \ - libsndfile-dev \ - libspeex-dev \ - libspeexdsp-dev \ - wget \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /ezquake-source/ -USER 1000 diff --git a/misc/docker-nightly-build/Dockerfile.focal-cross b/misc/docker-nightly-build/Dockerfile.focal-cross deleted file mode 100644 index 1abc314cd..000000000 --- a/misc/docker-nightly-build/Dockerfile.focal-cross +++ /dev/null @@ -1,29 +0,0 @@ -FROM ubuntu:20.04 as builder - -ENV TZ=ETC/Utc -# hadolint ignore=DL3008 -RUN DEBIAN_FRONTEND=noninteractive apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - curl \ - dos2unix \ - git \ - libcurl4-openssl-dev \ - libexpat1-dev \ - libfreetype6-dev \ - libjansson-dev \ - libjpeg-dev \ - libpng-dev \ - libsdl2-2.0-0 \ - libsdl2-dev \ - libsndfile-dev \ - libspeex-dev \ - libspeexdsp-dev \ - mingw-w64 \ - pkg-config \ - wget \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /ezquake-source/ -USER 1000 diff --git a/misc/docker-nightly-build/README.md b/misc/docker-nightly-build/README.md deleted file mode 100644 index 614b7c291..000000000 --- a/misc/docker-nightly-build/README.md +++ /dev/null @@ -1,56 +0,0 @@ -This method of building ezQuake requires *Docker*. You can read more about it and download it from [here](https://www.docker.com/ "Docker homepage") - -Initialization -============== -First, you need to create the docker image. You can do this by running -```shell -docker build -t localghost/ezquake_nightly . -``` -or using the [`build_image.sh`](build_image.sh)-script. -This will create a docker image based on Debian Buster that contains the libraries and tools required to compile linux and windows versions of ezQuake. - -Now that we have the image ready we can use it to start containers to build ezQuake. - - -Windows -======= -Nightly -------- -If you run the build from something like crontab, i.e you only want new builds when there are new commits available, then you just need to run the container and it will check for new commits and exit if none are available. -```shell -docker run \ - -v /outputdir:/nightly \ - -v /sourcedir:/source \ - localghost/ezquake_nightly -``` -Here we specify what directory the resulting 7zip-archive will be placed into (in this case "/outputdir") and what directory the ezquake-source repository will be cloned into (in this case "/sourcedir") - -This can be done using the [`nightly.sh`](nightly.sh)-script. Set the environment variables *OUTPUTDIR* to where you want the files to go, and *SOURCEDIR* to where you want the ezquake source to be kept before calling the script. - -One-off builds --------------- -If you want to force a build no matter if there are new commits available or not, then you can set the FORCEBUILD environment-variable like this: -```shell -docker run \ - -v /outputdir:/nightly \ - -v /sourcedir:/source \ - -e "FORCEBUILD=TRUE" \ - localghost/ezquake_nightly -``` - -This can be done using the [`forcebuild.sh`](forcebuild.sh)-script. Set *OUTPUTDIR* and *SOURCEDIR* as above. - -Linux -===== -You can use the same image to build a linux-version of ezQuake. To do this run: -```shell -docker run \ - -v /outputdir:/nightly \ - -v /sourcedir:/source \ - -e "TARGET_PLATFORM=LINUX" \ - localghost/ezquake_nightly -``` - -This can be done using the [`linux.sh`](linux.sh)-script. *FORCEBUILD* works here too and you need to set *OUTPUTDIR* and *SOURCEDIR* as well. - -Please note that the build environment this uses is *Debian Buster*, if you are compiling on another distribution of linux for use on that distribution you are probably better off installing the dependencies yourself and compiling ezQuake without using this method. diff --git a/misc/docker-nightly-build/build_image.sh b/misc/docker-nightly-build/build_image.sh deleted file mode 100755 index aa6fb7098..000000000 --- a/misc/docker-nightly-build/build_image.sh +++ /dev/null @@ -1 +0,0 @@ -docker build -t localghost/ezquake_nightly . diff --git a/misc/docker-nightly-build/forcebuild.sh b/misc/docker-nightly-build/forcebuild.sh deleted file mode 100755 index 957016d08..000000000 --- a/misc/docker-nightly-build/forcebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -docker run --rm \ - -v $SOURCEDIR:/source \ - -v $OUTPUTDIR:/nightly \ - -e "FORCEBUILD=TRUE" \ - localghost/ezquake_nightly diff --git a/misc/docker-nightly-build/linux.sh b/misc/docker-nightly-build/linux.sh deleted file mode 100755 index 4a577794a..000000000 --- a/misc/docker-nightly-build/linux.sh +++ /dev/null @@ -1,5 +0,0 @@ -docker run --rm \ - -v $SOURCEDIR:/source \ - -v $OUTPUTDIR:/nightly \ - -e "TARGET_PLATFORM=LINUX" \ - localghost/ezquake_nightly diff --git a/misc/docker-nightly-build/mk_nightly.sh b/misc/docker-nightly-build/mk_nightly.sh deleted file mode 100755 index 88b0bdede..000000000 --- a/misc/docker-nightly-build/mk_nightly.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -if [ ! -d /source/ezquake-source ]; then - # We need to initialize the build environment - cd /source && git clone https://github.com/ezQuake/ezquake-source.git -fi - -cd /source/ezquake-source - -OLD_REV=$(git rev-parse HEAD) -git pull -NEW_REV=$(git rev-parse HEAD) - -if [ "$OLD_REV" = "$NEW_REV" ]; then - echo "No new build needed" - if [ -z "$FORCEBUILD" ]; then - exit 0 - fi -fi - -DATE=$(date +"%F") -SHORTREV=$(git rev-parse --short HEAD) - -EZQUAKE_FNAME=ezquake-$SHORTREV -ARCHIVE_FNAME="$DATE-$SHORTREV-ezquake.7z" - - -build() { - echo "Building ezquake $NEW_REV" | tee -a build.log - if [ "$TARGET_PLATFORM" = "WINDOWS" ]; then - EZ_CONFIG_FILE=.config_windows make |& tee -a build.log - else - make |& tee -a build.log - fi - - if [ -e ezquake.exe ]; then - EZQUAKE_FNAME+=".exe" - mv ezquake.exe $EZQUAKE_FNAME - elif [ -e ezquake-linux-x86_64 ]; then - EZQUAKE_FNAME+="-linux-x86_64" - mv ezquake-linux-x86_64 $EZQUAKE_FNAME - else - echo "No output file" - make clean - exit 1 - fi -} - -make_readme() { - cat > README_nightly.txt <<- EOM - ezQuake nightly build - - Please notice that this build is still in alpha so expect various problems. - Report any bugs at https://github.com/ezQuake/ezquake-source/issues or in #ezquake on quakenet. - - Changes from last nightly build: - EOM - git log $NEW_REV...$OLD_REV >> README_nightly.txt -} - -make_archive() { - if [ -e $EZQUAKE_FNAME ]; then - FILES+="$EZQUAKE_FNAME " - fi - if [ -e build.log ]; then - FILES+="build.log " - fi - if [ -e README_nightly.txt ]; then - FILES+="README_nightly.txt " - fi - 7z a /nightly/$ARCHIVE_FNAME $FILES -} - -cleanup() { - make clean - rm build.log README_nightly.txt $EZQUAKE_FNAME -} - -build -make_readme -make_archive -cleanup diff --git a/misc/docker-nightly-build/nightly.sh b/misc/docker-nightly-build/nightly.sh deleted file mode 100755 index 7fb985f8d..000000000 --- a/misc/docker-nightly-build/nightly.sh +++ /dev/null @@ -1,5 +0,0 @@ -docker run --rm \ - -v $SOURCEDIR:/source \ - -v $OUTPUTDIR:/nightly \ - localghost/ezquake_nightly - From 2dc7289f056f11dc1dba0dd470dc3d81c6cda2d2 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 19 Sep 2024 16:50:51 +0200 Subject: [PATCH 4/6] BUILD: Remove old build system. --- Makefile | 647 ------------------------------------------------- build-linux.sh | 2 +- json2c.sh | 33 --- version.sh | 24 -- 4 files changed, 1 insertion(+), 705 deletions(-) delete mode 100644 Makefile delete mode 100755 json2c.sh delete mode 100755 version.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index d88a93de0..000000000 --- a/Makefile +++ /dev/null @@ -1,647 +0,0 @@ -### ezQuake Makefile based on Q2PRO ### - -ifdef EZ_CONFIG_FILE - -include $(EZ_CONFIG_FILE) -else - -include .config -endif - -ifdef CONFIG_WINDOWS - CPU ?= x86 - SYS ?= Win32 -else - ifndef CPU - CPU := $(shell uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/) - endif - ifndef SYS - SYS := $(shell uname -s) - endif -endif - -ifndef REV - REV := $(shell ./version.sh --revision) -endif -ifndef VER - VER := $(shell ./version.sh --version) -endif - -LSYS := $(shell echo $(SYS) | tr A-Z a-z) -CC ?= gcc -WINDRES ?= windres -STRIP ?= strip -RM ?= rm -f -RMDIR ?= rm -rf -MKDIR ?= mkdir -p -JSON2C ?= ./json2c.sh - -CFLAGS ?= -std=gnu89 -O2 -Wall -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-strict-aliasing -Werror=strict-prototypes -Werror=old-style-definition -g -MMD $(INCLUDES) -RCFLAGS ?= -LDFLAGS ?= -LIBS ?= - -CFLAGS_c := -RCFLAGS_c := -LDFLAGS_c := - -SRC_DIR = src - -ifneq (,$(wildcard $(SRC_DIR)/qwprot/src/*.h)) - INCLUDES = -I$(SRC_DIR)/qwprot/src -else - $(error qwprot submodule missing, try initializing submodules with "git submodule update --init --recursive --remote") -endif - -ifdef CONFIG_WINDOWS - LDFLAGS_c += -mwindows - - # Mark images as DEP and ASLR compatible on x86 Windows - ifeq ($(CPU),x86) - LDFLAGS_c += -Wl,--nxcompat,--dynamicbase - endif -else - # Hide ELF symbols by default - CFLAGS_c += -fvisibility=hidden - - # Resolve all symbols at link time - ifeq ($(SYS),Linux) - #CFLAGS += -DX11_GAMMA_WORKAROUND - LDFLAGS_c += -Wl,--no-undefined - endif - - ifeq ($(SYS),Darwin) - # 10.11 El Capitan does not search for header files here by default - CFLAGS_c += -I/usr/local/include - - # For re-link/deploy dynamic libraries - LDFLAGS_c += -headerpad_max_install_names - - # Cross-compiling support - ifneq ($(DARWIN_TARGET),) - CFLAGS_c += -target $(DARWIN_TARGET) - LDFLAGS_c += -target $(DARWIN_TARGET) - else - CFLAGS_c += -mmacosx-version-min=11.0 - LDFLAGS_c += -mmacosx-version-min=11.0 - endif - - # From 10.10 at least, expat is a system library - EXPAT_CFLAGS = - EXPAT_LIBS = -lexpat - - CURL_CFLAGS = - CURL_LIBS = -lcurl - endif -endif - -BUILD_DEFS := -DCPUSTRING='"$(CPU)"' -BUILD_DEFS += -DBUILDSTRING='"$(SYS)"' - -VER_DEFS := -DREVISION=$(REV) -VER_DEFS += -DVERSION='"$(VER)"' - -SDL2_CFLAGS ?= $(shell sdl2-config --cflags) -SDL2_LIBS ?= $(shell sdl2-config --libs) - -ifdef TRAVIS_BUILD - BUILD_DEFS += -DTRAVIS_BUILD -endif - -CFLAGS_c += $(BUILD_DEFS) $(VER_DEFS) $(PATH_DEFS) $(SDL2_CFLAGS) -DNDEBUG -DJSS_CAM -DUSE_PR2 -DWITH_NQPROGS -DUSE_SDL2 -DWITH_ZIP -LIBS_c += $(SDL2_LIBS) - -# built-in requirements -ZLIB_CFLAGS ?= -DWITH_ZLIB -ZLIB_LIBS ?= -lz -CFLAGS_c += $(ZLIB_CFLAGS) -LIBS_c += $(ZLIB_LIBS) - -PCRE2_CFLAGS ?= $(shell pkg-config libpcre2-8 --cflags) -PCRE2_LIBS ?= $(shell pkg-config libpcre2-8 --libs) -CFLAGS_c += $(PCRE2_CFLAGS) -DPCRE2_CODE_UNIT_WIDTH=8 -LIBS_c += $(PCRE2_LIBS) - -EXPAT_CFLAGS ?= $(shell pkg-config expat --cflags) -EXPAT_LIBS ?= $(shell pkg-config expat --libs) -CFLAGS_c += $(EXPAT_CFLAGS) -LIBS_c += $(EXPAT_LIBS) - -PNG_CFLAGS ?= $(shell pkg-config libpng --cflags) -DWITH_PNG -PNG_LIBS ?= $(shell pkg-config libpng --libs) -CFLAGS_c += $(PNG_CFLAGS) -LIBS_c += $(PNG_LIBS) - -JPEG_CFLAGS ?= $(shell pkg-config libjpeg --cflags) -DWITH_JPEG -JPEG_LIBS ?= $(shell pkg-config libjpeg --libs) -CFLAGS_c += $(JPEG_CFLAGS) -LIBS_c += $(JPEG_LIBS) - -CURL_CFLAGS ?= $(shell pkg-config libcurl --cflags) -CURL_LIBS ?= $(shell pkg-config libcurl --libs) -CFLAGS_c += $(CURL_CFLAGS) -LIBS_c += $(CURL_LIBS) - -JANSSON_CFLAGS ?= $(shell pkg-config jansson --cflags) -JANSSON_LIBS ?= $(shell pkg-config jansson --libs) -CFLAGS += $(JANSSON_CFLAGS) -LIBS_c += $(JANSSON_LIBS) - -MINIZIP_CFLAGS ?= $(shell pkg-config --cflags minizip) -MINIZIP_LIBS ?= $(shell pkg-config --libs minizip) -CFLAGS_c += $(MINIZIP_CFLAGS) -LIBS_c += $(MINIZIP_LIBS) - -SPEEX_LIBS ?= $(shell pkg-config speex --libs) $(shell pkg-config speexdsp --libs) -ifdef SPEEX_LIBS - CFLAGS_c += $(shell pkg-config speex --cflags) $(shell pkg-config speexdsp --cflags) -DWITH_SPEEX -endif -LIBS_c += $(SPEEX_LIBS) - -ifndef CONFIG_WINDOWS - ifeq ($(shell pkg-config --exists freetype2 && echo 1),1) - FREETYPE_CFLAGS ?= $(shell pkg-config freetype2 --cflags) - FREETYPE_LIBS ?= $(shell pkg-config freetype2 --libs) - endif - - ifdef FREETYPE_LIBS - CFLAGS_c += -DEZ_FREETYPE_SUPPORT_STATIC - endif -endif - -ifdef FREETYPE_LIBS - CFLAGS_c += -DEZ_FREETYPE_SUPPORT - LIBS_c += $(FREETYPE_LIBS) - CFLAGS += $(FREETYPE_CFLAGS) -endif - -ifdef OLD_WAV_LOADING - CFLAGS_c += -DOLD_WAV_LOADING -else - SNDFILE_CFLAGS ?= $(shell pkg-config sndfile --cflags) - SNDFILE_LIBS ?= $(shell pkg-config sndfile --libs) - CFLAGS += $(SNDFILE_CFLAGS) - LIBS_c += $(SNDFILE_LIBS) -endif - -# windres needs special quoting... -RCFLAGS_c += -DREVISION=$(REV) -DVERSION='\"$(VER)\"' - -### Object Files ### - -COMMON_OBJS := \ - $(SRC_DIR)/cmodel.o \ - $(SRC_DIR)/cmd.o \ - $(SRC_DIR)/com_msg.o \ - $(SRC_DIR)/common.o \ - $(SRC_DIR)/crc.o \ - $(SRC_DIR)/cvar.o \ - $(SRC_DIR)/fs.o \ - $(SRC_DIR)/vfs_os.o \ - $(SRC_DIR)/vfs_pak.o \ - $(SRC_DIR)/vfs_zip.o \ - $(SRC_DIR)/vfs_tcp.o \ - $(SRC_DIR)/vfs_gzip.o \ - $(SRC_DIR)/vfs_doomwad.o \ - $(SRC_DIR)/vfs_mmap.o \ - $(SRC_DIR)/vfs_tar.o \ - $(SRC_DIR)/hash.o \ - $(SRC_DIR)/host.o \ - $(SRC_DIR)/mathlib.o \ - $(SRC_DIR)/md4.o \ - $(SRC_DIR)/sha3.o \ - $(SRC_DIR)/net.o \ - $(SRC_DIR)/net_chan.o \ - $(SRC_DIR)/q_shared.o \ - $(SRC_DIR)/version.o \ - $(SRC_DIR)/zone.o \ - $(SRC_DIR)/pmove.o \ - $(SRC_DIR)/pmovetst.o - -SERVER_OBJS := \ - $(SRC_DIR)/pr_cmds.o \ - $(SRC_DIR)/pr_edict.o \ - $(SRC_DIR)/pr_exec.o \ - $(SRC_DIR)/pr2_cmds.o \ - $(SRC_DIR)/pr2_edict.o \ - $(SRC_DIR)/pr2_exec.o \ - $(SRC_DIR)/sv_ccmds.o \ - $(SRC_DIR)/sv_ents.o \ - $(SRC_DIR)/sv_init.o \ - $(SRC_DIR)/sv_main.o \ - $(SRC_DIR)/sv_master.o \ - $(SRC_DIR)/sv_move.o \ - $(SRC_DIR)/sv_nchan.o \ - $(SRC_DIR)/sv_phys.o \ - $(SRC_DIR)/sv_save.o \ - $(SRC_DIR)/sv_send.o \ - $(SRC_DIR)/sv_user.o \ - $(SRC_DIR)/sv_world.o \ - $(SRC_DIR)/sv_demo.o \ - $(SRC_DIR)/sv_demo_misc.o \ - $(SRC_DIR)/sv_demo_qtv.o \ - $(SRC_DIR)/sv_login.o \ - $(SRC_DIR)/sv_mod_frags.o \ - $(SRC_DIR)/vm.o \ - $(SRC_DIR)/vm_interpreted.o \ - $(SRC_DIR)/vm_x86.o - -HELP_OBJS := \ - $(patsubst help_%.json,help_%.o,$(wildcard help_*.json)) - -MODERN_GLSL_OBJS := \ - $(patsubst $(SRC_DIR)/glsl/%.glsl,$(SRC_DIR)/glsl_%.glsl.o,$(wildcard $(SRC_DIR)/glsl/*.glsl)) - -CLASSIC_GLSL_OBJS := \ - $(patsubst $(SRC_DIR)/glsl/glc/%.glsl,$(SRC_DIR)/glsl_%.glsl.o,$(wildcard $(SRC_DIR)/glsl/glc/*.glsl)) - -MODERN_OPENGL_OBJS := \ - $(MODERN_GLSL_OBJS) \ - $(SRC_DIR)/glm_aliasmodel.o \ - $(SRC_DIR)/glm_brushmodel.o \ - $(SRC_DIR)/glm_draw.o \ - $(SRC_DIR)/glm_framebuffer.o \ - $(SRC_DIR)/glm_lightmaps.o \ - $(SRC_DIR)/glm_md3.o \ - $(SRC_DIR)/glm_misc.o \ - $(SRC_DIR)/glm_particles.o \ - $(SRC_DIR)/glm_performance.o \ - $(SRC_DIR)/glm_main.o \ - $(SRC_DIR)/glm_rmain.o \ - $(SRC_DIR)/glm_rsurf.o \ - $(SRC_DIR)/glm_sdl.o \ - $(SRC_DIR)/glm_sprite.o \ - $(SRC_DIR)/glm_sprite3d.o \ - $(SRC_DIR)/glm_state.o \ - $(SRC_DIR)/glm_texture_arrays.o \ - $(SRC_DIR)/glm_vao.o - -CLASSIC_OPENGL_OBJS := \ - $(CLASSIC_GLSL_OBJS) \ - $(SRC_DIR)/glc_aliasmodel.o \ - $(SRC_DIR)/glc_aliasmodel_mesh.o \ - $(SRC_DIR)/glc_bloom.o \ - $(SRC_DIR)/glc_brushmodel.o \ - $(SRC_DIR)/glc_draw.o \ - $(SRC_DIR)/glc_framebuffer.o \ - $(SRC_DIR)/glc_lightmaps.o \ - $(SRC_DIR)/glc_main.o \ - $(SRC_DIR)/glc_matrix.o \ - $(SRC_DIR)/glc_md3.o \ - $(SRC_DIR)/glc_misc.o \ - $(SRC_DIR)/glc_particles.o \ - $(SRC_DIR)/glc_performance.o \ - $(SRC_DIR)/glc_sdl.o \ - $(SRC_DIR)/glc_sky.o \ - $(SRC_DIR)/glc_sprite3d.o \ - $(SRC_DIR)/glc_state.o \ - $(SRC_DIR)/glc_surf.o \ - $(SRC_DIR)/glc_turb_surface.o \ - $(SRC_DIR)/glc_vao.o \ - $(SRC_DIR)/glc_warp.o - -COMMON_OPENGL_OBJS := \ - $(SRC_DIR)/gl_aliasmodel.o \ - $(SRC_DIR)/gl_aliasmodel_md3.o \ - $(SRC_DIR)/gl_buffers.o \ - $(SRC_DIR)/gl_debug.o \ - $(SRC_DIR)/gl_drawcall_wrappers.o \ - $(SRC_DIR)/gl_framebuffer.o \ - $(SRC_DIR)/gl_misc.o \ - $(SRC_DIR)/gl_program.o \ - $(SRC_DIR)/gl_sdl.o \ - $(SRC_DIR)/gl_sprite3d.o \ - $(SRC_DIR)/gl_state.o \ - $(SRC_DIR)/gl_texture.o \ - $(SRC_DIR)/gl_texture_functions.o \ - $(SRC_DIR)/vid_common_gl.o - -COMMON_RENDERER_OBJS := \ - $(SRC_DIR)/r_aliasmodel.o \ - $(SRC_DIR)/r_aliasmodel_md3.o \ - $(SRC_DIR)/r_aliasmodel_mesh.o \ - $(SRC_DIR)/r_aliasmodel_skins.o \ - $(SRC_DIR)/r_atlas.o \ - $(SRC_DIR)/r_bloom.o \ - $(SRC_DIR)/r_brushmodel.o \ - $(SRC_DIR)/r_brushmodel_bspx.o \ - $(SRC_DIR)/r_brushmodel_load.o \ - $(SRC_DIR)/r_brushmodel_sky.o \ - $(SRC_DIR)/r_brushmodel_surfaces.o \ - $(SRC_DIR)/r_brushmodel_textures.o \ - $(SRC_DIR)/r_brushmodel_warpsurfaces.o \ - $(SRC_DIR)/r_buffers.o \ - $(SRC_DIR)/r_chaticons.o \ - $(SRC_DIR)/r_draw.o \ - $(SRC_DIR)/r_draw_charset.o \ - $(SRC_DIR)/r_draw_circle.o \ - $(SRC_DIR)/r_draw_image.o \ - $(SRC_DIR)/r_draw_line.o \ - $(SRC_DIR)/r_draw_polygon.o \ - $(SRC_DIR)/r_hud.o \ - $(SRC_DIR)/r_lightmaps.o \ - $(SRC_DIR)/r_main.o \ - $(SRC_DIR)/r_matrix.o \ - $(SRC_DIR)/r_misc.o \ - $(SRC_DIR)/r_model.o \ - $(SRC_DIR)/r_netgraph.o \ - $(SRC_DIR)/r_palette.o \ - $(SRC_DIR)/r_part.o \ - $(SRC_DIR)/r_part_trails.o \ - $(SRC_DIR)/r_particles_qmb.o \ - $(SRC_DIR)/r_particles_qmb_trails.o \ - $(SRC_DIR)/r_particles_qmb_spawn.o \ - $(SRC_DIR)/r_performance.o \ - $(SRC_DIR)/r_refrag.o \ - $(SRC_DIR)/r_rlight.o \ - $(SRC_DIR)/r_rmain.o \ - $(SRC_DIR)/r_rmisc.o \ - $(SRC_DIR)/r_sprite3d.o \ - $(SRC_DIR)/r_sprites.o \ - $(SRC_DIR)/r_states.o \ - $(SRC_DIR)/r_texture.o \ - $(SRC_DIR)/r_texture_cvars.o \ - $(SRC_DIR)/r_texture_load.o \ - $(SRC_DIR)/r_texture_util.o \ - $(SRC_DIR)/vx_camera.o \ - $(SRC_DIR)/vx_coronas.o \ - $(SRC_DIR)/vx_stuff.o \ - $(SRC_DIR)/vx_vertexlights.o - -HUD_OBJS := \ - $(SRC_DIR)/hud.o \ - $(SRC_DIR)/hud_262.o \ - $(SRC_DIR)/hud_common.o \ - $(SRC_DIR)/hud_editor.o \ - $(SRC_DIR)/hud_radar.o \ - $(SRC_DIR)/hud_speed.o \ - $(SRC_DIR)/hud_teaminfo.o \ - $(SRC_DIR)/hud_weapon_stats.o \ - $(SRC_DIR)/hud_autoid.o \ - $(SRC_DIR)/hud_clock.o \ - $(SRC_DIR)/hud_ammo.o \ - $(SRC_DIR)/hud_items.o \ - $(SRC_DIR)/hud_net.o \ - $(SRC_DIR)/hud_guns.o \ - $(SRC_DIR)/hud_groups.o \ - $(SRC_DIR)/hud_armor.o \ - $(SRC_DIR)/hud_health.o \ - $(SRC_DIR)/hud_gamesummary.o \ - $(SRC_DIR)/hud_face.o \ - $(SRC_DIR)/hud_frags.o \ - $(SRC_DIR)/hud_tracking.o \ - $(SRC_DIR)/hud_scores.o \ - $(SRC_DIR)/hud_performance.o \ - $(SRC_DIR)/hud_centerprint.o \ - $(SRC_DIR)/hud_qtv.o - -OBJS_c := \ - $(COMMON_OBJS) \ - $(HELP_OBJS) \ - $(HUD_OBJS) \ - $(COMMON_RENDERER_OBJS) \ - $(SRC_DIR)/Ctrl.o \ - $(SRC_DIR)/Ctrl_EditBox.o \ - $(SRC_DIR)/Ctrl_PageViewer.o \ - $(SRC_DIR)/Ctrl_ScrollBar.o \ - $(SRC_DIR)/Ctrl_Tab.o \ - $(SRC_DIR)/EX_FileList.o \ - $(SRC_DIR)/EX_browser.o \ - $(SRC_DIR)/EX_browser_net.o \ - $(SRC_DIR)/EX_browser_pathfind.o \ - $(SRC_DIR)/EX_browser_ping.o \ - $(SRC_DIR)/EX_browser_qtvlist.o \ - $(SRC_DIR)/EX_browser_sources.o \ - $(SRC_DIR)/EX_qtvlist.o \ - $(SRC_DIR)/ez_controls.o \ - $(SRC_DIR)/ez_scrollbar.o \ - $(SRC_DIR)/ez_scrollpane.o \ - $(SRC_DIR)/ez_label.o \ - $(SRC_DIR)/ez_slider.o \ - $(SRC_DIR)/ez_button.o \ - $(SRC_DIR)/ez_window.o \ - $(SRC_DIR)/cl_cam.o \ - $(SRC_DIR)/cl_cmd.o \ - $(SRC_DIR)/cl_demo.o \ - $(SRC_DIR)/cl_nqdemo.o \ - $(SRC_DIR)/cl_ents.o \ - $(SRC_DIR)/cl_input.o \ - $(SRC_DIR)/cl_main.o \ - $(SRC_DIR)/cl_parse.o \ - $(SRC_DIR)/cl_pred.o \ - $(SRC_DIR)/cl_screen.o \ - $(SRC_DIR)/cl_slist.o \ - $(SRC_DIR)/cl_tent.o \ - $(SRC_DIR)/cl_view.o \ - $(SRC_DIR)/common_draw.o \ - $(SRC_DIR)/console.o \ - $(SRC_DIR)/config_manager.o \ - $(SRC_DIR)/demo_controls.o \ - $(SRC_DIR)/document_rendering.o \ - $(SRC_DIR)/fchecks.o \ - $(SRC_DIR)/fmod.o \ - $(SRC_DIR)/fragstats.o \ - $(SRC_DIR)/help.o \ - $(SRC_DIR)/help_files.o \ - $(SRC_DIR)/ignore.o \ - $(SRC_DIR)/image.o \ - $(SRC_DIR)/irc_filter.o \ - $(SRC_DIR)/irc.o \ - $(SRC_DIR)/keys.o \ - $(SRC_DIR)/logging.o \ - $(SRC_DIR)/match_tools.o \ - $(SRC_DIR)/match_tools_challenge.o \ - $(SRC_DIR)/menu.o \ - $(SRC_DIR)/menu_demo.o \ - $(SRC_DIR)/menu_ingame.o \ - $(SRC_DIR)/menu_multiplayer.o \ - $(SRC_DIR)/menu_options.o \ - $(SRC_DIR)/menu_proxy.o \ - $(SRC_DIR)/movie.o \ - $(SRC_DIR)/mvd_autotrack.o \ - $(SRC_DIR)/mvd_utils.o \ - $(SRC_DIR)/mvd_xmlstats.o \ - $(SRC_DIR)/parser.o \ - $(SRC_DIR)/qtv.o \ - $(SRC_DIR)/rulesets.o \ - $(SRC_DIR)/sbar.o \ - $(SRC_DIR)/settings_page.o \ - $(SRC_DIR)/sha1.o \ - $(SRC_DIR)/skin.o \ - $(SRC_DIR)/snd_main.o \ - $(SRC_DIR)/snd_mem.o \ - $(SRC_DIR)/snd_mix.o \ - $(SRC_DIR)/stats_grid.o \ - $(SRC_DIR)/teamplay.o \ - $(SRC_DIR)/teamplay_locfiles.o \ - $(SRC_DIR)/tp_msgs.o \ - $(SRC_DIR)/tp_triggers.o \ - $(SRC_DIR)/textencoding.o \ - $(SRC_DIR)/utils.o \ - $(SRC_DIR)/vx_tracker.o \ - $(SRC_DIR)/wad.o \ - $(SRC_DIR)/xsd.o \ - $(SRC_DIR)/xsd_document.o \ - $(SRC_DIR)/collision.o \ - $(SRC_DIR)/vid_vsync.o \ - $(SRC_DIR)/cd_null.o \ - $(SRC_DIR)/vid_sdl2.o \ - $(SRC_DIR)/sys_sdl2.o \ - $(SRC_DIR)/in_sdl2.o \ - $(SRC_DIR)/cl_multiview.o \ - $(SRC_DIR)/snd_voip.o \ - $(SRC_DIR)/cl_screenshot.o \ - $(SRC_DIR)/fonts.o \ - $(SRC_DIR)/cl_skygroups.o - -### Configuration Options ### - -ifdef MODERN_OPENGL_ONLY - OBJS_c += $(COMMON_OPENGL_OBJS) - OBJS_c += $(MODERN_OPENGL_OBJS) - CFLAGS += -DRENDERER_OPTION_MODERN_OPENGL - EZ_POSTFIX := "-glsl" -else - ifdef CLASSIC_OPENGL_ONLY - OBJS_c += $(COMMON_OPENGL_OBJS) - OBJS_c += $(CLASSIC_OPENGL_OBJS) - CFLAGS += -DRENDERER_OPTION_CLASSIC_OPENGL - EZ_POSTFIX := "-std" - else - OBJS_c += $(COMMON_OPENGL_OBJS) - OBJS_c += $(MODERN_OPENGL_OBJS) - OBJS_c += $(CLASSIC_OPENGL_OBJS) - CFLAGS += -DRENDERER_OPTION_CLASSIC_OPENGL - CFLAGS += -DRENDERER_OPTION_MODERN_OPENGL - EZ_POSTFIX := "" - endif -endif - -ifndef CLIENT_ONLY - OBJS_c += $(SERVER_OBJS) -else - CFLAGS += -DCLIENTONLY -endif - -ifdef CURL_LIBS - OBJS_c += \ - $(SRC_DIR)/central.o -endif - -ifdef CONFIG_WINDOWS - OBJS_c += \ - $(SRC_DIR)/movie_avi.o \ - $(SRC_DIR)/localtime_win.o \ - $(SRC_DIR)/sys_win.o \ - $(SRC_DIR)/winquake.o - LIBS_c += -lopengl32 -lws2_32 -lwinmm -lpthread -else - OBJS_c += \ - $(SRC_DIR)/localtime_posix.o \ - $(SRC_DIR)/sys_posix.o \ - $(SRC_DIR)/linux_signals.o - -LIBS_c += -lm - - ifeq ($(SYS),Darwin) - LIBS_c += -framework Foundation -framework OpenGL -framework AppKit -framework CoreServices -framework GameController - OBJS_c += $(SRC_DIR)/in_osx.o $(SRC_DIR)/sys_osx.o - else - LIBS_c += -lGL -lpthread - endif - - ifeq ($(SYS),Linux) - LIBS_c += -lXxf86vm - endif - - ifneq ($(SYS),FreeBSD) - ifneq ($(SYS),OpenBSD) - ifneq ($(SYS),NetBSD) - LIBS_c += -ldl - endif - endif - endif -endif - -#ifdef CONFIG_OGG -# OGG_CFLAGS ?= $(shell pkg-config vorbisfile --cflags) -DWITH_OGG_VORBIS -# OGG_LIBS ?= $(shell pkg-config vorbisfile --libs) -# CFLAGS_c += $(OGG_CFLAGS) -# LIBS_c += $(OGG_LIBS) -#endif - -### Targets ### - -ifdef CONFIG_WINDOWS - TARG_c := ezquake$(EZ_POSTFIX).exe -else - TARG_c := ezquake-$(LSYS)-$(CPU)$(EZ_POSTFIX) -endif - -all: $(TARG_c) - -default: all - -.PHONY: all default clean strip - -# Define V=1 to show command line. -ifdef V - Q := - E := @true -else - Q := @ - E := @echo -endif - -# Temporary build directories -BUILD_c := .ezquake - -# Rewrite paths to build directories -OBJS_c := $(patsubst %,$(BUILD_c)/%,$(OBJS_c)) - -DEPS_c := $(OBJS_c:.o=.d) - --include $(DEPS_c) - -clean: - $(E) [CLEAN] - $(Q)$(RM) $(TARG_c) - $(Q)$(RMDIR) $(BUILD_c) - -strip: $(TARG_c) - $(E) [STRIP] - $(Q)$(STRIP) $(TARG_c) - - -$(BUILD_c)/$(SRC_DIR)/glsl_%.glsl.o: $(SRC_DIR)/glsl/%.glsl - $(E) [GLSL] $@ - $(Q)$(JSON2C) $< > $(BUILD_c)/$*.c - $(Q)$(CC) -c $(CFLAGS) $(CFLAGS_c) $(INCLUDES) -o $@ $(BUILD_c)/$*.c - -$(BUILD_c)/$(SRC_DIR)/glsl_%.glsl.o: $(SRC_DIR)/glsl/glc/%.glsl - $(E) [GLSL] $@ - $(Q)$(JSON2C) $< > $(BUILD_c)/$*.c - $(Q)$(CC) -c $(CFLAGS) $(CFLAGS_c) $(INCLUDES) -o $@ $(BUILD_c)/$*.c - -$(BUILD_c)/%.o: %.json - $(E) [JS] $@ - $(Q)$(JSON2C) $< > $(BUILD_c)/$*.c - $(Q)$(CC) -c $(CFLAGS) $(CFLAGS_c) $(INCLUDES) -o $@ $(BUILD_c)/$*.c - -$(BUILD_c)/$(SRC_DIR)/%.o: $(SRC_DIR)/%.c - $(E) [CC] $@ - $(Q)$(MKDIR) $(@D) - $(Q)$(CC) -c $(CFLAGS) $(CFLAGS_c) $(INCLUDES) -o $@ $< - -$(BUILD_c)/$(SRC_DIR)/%.o: $(SRC_DIR)/%.m - $(E) [CC] $@ - $(Q)$(MKDIR) $(@D) - $(Q)$(CC) -c $(CFLAGS) $(CFLAGS_c) $(INCLUDES) -o $@ $< - -$(BUILD_c)/%.o: %.rc - $(E) [RC] $@ - $(Q)$(MKDIR) $(@D) - $(Q)$(WINDRES) $(RCFLAGS) $(RCFLAGS_c) -o $@ $< - -$(TARG_c): $(OBJS_c) - $(E) [LD] $@ - $(Q)$(MKDIR) $(@D) - $(Q)$(CC) $(LDFLAGS) $(LDFLAGS_c) -o $@ $(OBJS_c) $(LIBS) $(LIBS_c) diff --git a/build-linux.sh b/build-linux.sh index 9a20c78db..ac0ecc708 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -74,7 +74,7 @@ if [ -f $BUILD_LOG ];then rm -f $BUILD_LOG ||: fi -[ -e Makefile ] || error "Cannot find 'Makefile', please run this script from the source code directory." +[ -e CMakeLists.txt ] || error "Cannot find 'Makefile', please run this script from the source code directory." command -v sudo >/dev/null 2>&1 || error "Could not find sudo, please install it. Exiting." diff --git a/json2c.sh b/json2c.sh deleted file mode 100755 index 01b14bba7..000000000 --- a/json2c.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -set -eu -case "$#" in - 1) - exec 0< "$1" - ;; - 2) - exec 0< "$1" - exec 1> "$2" - ;; - *) - echo "Usage: `basename -- "$0"` INPUT [OUTPUT]" >&2 - exit 64 - ;; -esac -od -t x1 -v | awk -v name="`basename -- "$1"`" ' - BEGIN { - if (name ~ /^[0-9]/) { - name = "__" name - } - gsub(/[^0-9A-Za-z]/, "_", name) - printf "unsigned char %s[] = {\n", name - } - { - for (i = 2; i <= NF; i++) { - printf "\t0x%s,\n", $i - len++ - } - } - END { - printf "};\nunsigned int %s_len = %u;\n", name, len - } -' diff --git a/version.sh b/version.sh deleted file mode 100755 index f92ac3e94..000000000 --- a/version.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -if [ -f VERSION ]; then - ver=$(cat VERSION) - rev=$(sed -e 's/^r\([0-9]\+\).*$/\1/' VERSION) -elif [ -x "$(command -v git)" -a -d ".git" ]; then - rev=$(git rev-list HEAD | wc -l | tr -d -c 0-9) - ver="r$rev~$(git rev-parse --short HEAD)" -else - echo "WARNING: Couldn't detect ezQuake version." >&2 - ver="r666" - rev="666" -fi - -case $1 in ---version|-v) - echo $ver;; ---revision|-r) - echo $rev;; -*) - echo $ver - echo $rev;; -esac - From 476ccf1c87670a667777b4a095b79d271faf3bda Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 19 Sep 2024 16:50:34 +0200 Subject: [PATCH 5/6] DOCS: Remove old docs. --- misc/docs/COMPILING_FOR_WINDOWS.md | 89 ------------------- misc/docs/COMPILING_ON_LINUX.txt | 31 ------- misc/docs/COMPILING_ON_LINUX_DOCKER.txt | 27 ------ misc/docs/COMPILING_ON_NETBSD.txt | 19 ---- misc/docs/COMPILING_ON_OSX.md | 30 ------- ...UILD_WINDOWS_ON_LINUX_using_Dockerfile.txt | 30 ------- 6 files changed, 226 deletions(-) delete mode 100644 misc/docs/COMPILING_FOR_WINDOWS.md delete mode 100644 misc/docs/COMPILING_ON_LINUX.txt delete mode 100644 misc/docs/COMPILING_ON_LINUX_DOCKER.txt delete mode 100644 misc/docs/COMPILING_ON_NETBSD.txt delete mode 100644 misc/docs/COMPILING_ON_OSX.md delete mode 100644 misc/docs/HOW_TO_BUILD_WINDOWS_ON_LINUX_using_Dockerfile.txt diff --git a/misc/docs/COMPILING_FOR_WINDOWS.md b/misc/docs/COMPILING_FOR_WINDOWS.md deleted file mode 100644 index fcbf1b984..000000000 --- a/misc/docs/COMPILING_FOR_WINDOWS.md +++ /dev/null @@ -1,89 +0,0 @@ -## Compiling for Windows - -### Using Visual Studio - -Open Visual Studio 2022, select _Clone a repository_ and point to this repository. - -This will automatically open the project as a CMake project and build the dependencies. - -The `msbuild-*` presets listed in the _Configurations_ drop-down are a good pick for this setup. - -To configure the game dir you want to run with you select `ezquake.exe` in the _Build Targets_ drop down -and continue to the menu _Debug_ -> _Debug and Launch Settings for ezquake_. This opens up `launch_schema.json` -where you add `currentDir` for the target you intend to launch: - -``` -{ - "version": ..., - "defaults": {}, - "configurations": [ - { - "type": ..., - "currentDir": "c:\\Quake" - } - ] -} -``` - -### Command line and/or Visual Studio Solution - -If this is a fresh clone, then start by running the `bootstrap.ps1` PowerShell script which -initializes support for building the 3rd party dependencies. You can do this via the right click -context menu on the file where you should see _'Run With PowerShell'_. - -First initialize the build system, which will build all 3rd party dependencies, takes some time. -``` -cmake --preset msbuild-x64 -``` -This will also generate a Visual Studio Solution under `build-msbuild-x64/ezquake.sln` based on -the compiler settings declared in `CMakeLists.txt` should you prefer that to Visual Studio's CMake -support. - -Then to build a specific configuration. -``` -cmake --build build-msbuild-x64 --config Release -``` - - -### Preparing Ubuntu Bash / WSL - -You can use the new Ubuntu Bash feature in Windows 10 to compile ezQuake for Windows. - -To enable Bash for Windows, press the `Start` button and type `Turn Windows f` and select `Turn Windows features on or off`. Scroll down to `Windows Subsystem for Linux (Beta)` and enable it. - -Now press WINDOWS+I, go to `Update & security` and then to the `For developers` tab. Enable `Developer mode`. - -Now press the `Start` button again and enter `bash`. Click it and install Bash. - -### Cross compiling from Linux or WSL - -Enter the following command to install all required prerequisites to build ezQuake: - -``` -sudo apt-get install -y \ - autoconf automake libtool pkg-config curl zip unzip tar \ - cmake ninja-build mingw-w64 -``` - -Now clone the ezQuake source code: - -``` -git clone https://github.com/ezQuake/ezquake-source.git ezquake -``` - -Initialize the build and compile dependencies: -``` -./bootstrap.sh -cmake --preset mingw64-x64-cross -``` -This will take some time the first invocation, but is a one-off cost. - -The dependency build cache is found in `${HOME}/.cache/vcpkg` if you -don't intend to build again and want to reclaim some space. - -Now build the ezQuake executable: -``` -cmake --build build-mingw64-x64-cross --config Release -``` - -This will produce `ezquake.exe` in the current directory. \ No newline at end of file diff --git a/misc/docs/COMPILING_ON_LINUX.txt b/misc/docs/COMPILING_ON_LINUX.txt deleted file mode 100644 index 930286560..000000000 --- a/misc/docs/COMPILING_ON_LINUX.txt +++ /dev/null @@ -1,31 +0,0 @@ -HOW TO BUILD ON LINUX: ------------------------------- - -1) Make sure you have the dependencies installed: - -- For Ubuntu 18.04+ or Debian Buster: - $ sudo apt-get install git build-essential libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype6-dev libsndfile-dev libpcre3-dev - -- For Fedora 25+: - $ sudo dnf install pcre-devel mesa-libGL-devel SDL2-devel make gcc jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libXxf86vm-devel - -2) Clone the git repository - $ git clone https://github.com/ezQuake/ezquake-source.git - -3) Switch to ezquake-source path - cd ~/ezquake-source/ - -4) Run the following (replace 5 with the number of cpu cores you have + 1) - $ make -j5 -Or in case of distros that come with libsndfile older than 1.025: - $ OLD_WAV_LOADING=1 make -j5 - -5) Copy the built binary to your quake folder, on 64bit linux - the binary will be called: - - ezquake-linux-x86_64 - - -TODO: ------ -Write down dependencies for other distros diff --git a/misc/docs/COMPILING_ON_LINUX_DOCKER.txt b/misc/docs/COMPILING_ON_LINUX_DOCKER.txt deleted file mode 100644 index 2fd4bb493..000000000 --- a/misc/docs/COMPILING_ON_LINUX_DOCKER.txt +++ /dev/null @@ -1,27 +0,0 @@ -HOW TO BUILD ON LINUX using Dockerfile: ---------------------------------------- - -1) Install Docker or something similar -2) Create docker image to be able to run compilation tools: - - docker build --no-cache -t ezq:dev-focal -f Dockerfile.focal . - -3) Run command to generate a binary for current linux platform: - - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" ezq:dev-focal make -j$(nproc) clean - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" ezq:dev-focal make -j$(nproc) all - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" ezq:dev-focal make -j$(nproc) strip - -4) As a result you should have a for example: `./ezquake-linux-x86_64` which can be used with ~/nquake - - cp -f ./ezquake-linux-x86_64 ~/nquake/ - cd ~/nquake/ - hash -r - ./ezquake-linux-x86_64 - - -TODO: ---------------------------------------- -- multi-arch -- other distros (centos, debian, older distros) -- using kaniko https://github.com/GoogleContainerTools/kaniko diff --git a/misc/docs/COMPILING_ON_NETBSD.txt b/misc/docs/COMPILING_ON_NETBSD.txt deleted file mode 100644 index e85ed0a04..000000000 --- a/misc/docs/COMPILING_ON_NETBSD.txt +++ /dev/null @@ -1,19 +0,0 @@ -HOW TO BUILD ON NETBSD: ------------------------------- - -1) Make sure you have the dependencies installed: - pkgin install gmake pkg-config speex speexdsp libsndfile jansson jpeg-9d SDL2 pcre png minizip - -2) Clone the git repository - $ git clone https://github.com/ezQuake/ezquake-source.git - -3) Switch to ezquake-source path - cd ./ezquake-source/ - -4) Run the following (replace 5 with the number of cpu cores you have + 1) - $ gmake -j5 - -5) Copy the built binary to your quake folder, on 64bit NetBSD - the binary will be called: - - ezquake-netbsd-x86_64 diff --git a/misc/docs/COMPILING_ON_OSX.md b/misc/docs/COMPILING_ON_OSX.md deleted file mode 100644 index bda80e1cf..000000000 --- a/misc/docs/COMPILING_ON_OSX.md +++ /dev/null @@ -1,30 +0,0 @@ -# How to compile on macOS - -Get Homebrew: http://brew.sh - -Run exactly as it says on the front page: -``` -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -``` - -Make sure you run the 'brew doctor' as instructed before doing anything else. - -Then run: -``` -brew install autoconf automake libtool cmake ninja -``` - -When it's done, initialize cmake to build the dependencies: -``` -./bootstrap.sh -cmake --preset macos-arm64 (or -x64) -``` - -And finally building ezQuake: -``` -cmake --build build-macos-arm64 --config Release -``` - -This will produce `build-macos-arm64/Release/ezQuake.app` which you can place anywhere. The first -launch will prompt you to select your Quake directory which will be automatically reused for -subsequent invocations. The application is sandboxed to this directory to keep your files safe. \ No newline at end of file diff --git a/misc/docs/HOW_TO_BUILD_WINDOWS_ON_LINUX_using_Dockerfile.txt b/misc/docs/HOW_TO_BUILD_WINDOWS_ON_LINUX_using_Dockerfile.txt deleted file mode 100644 index 84fc67025..000000000 --- a/misc/docs/HOW_TO_BUILD_WINDOWS_ON_LINUX_using_Dockerfile.txt +++ /dev/null @@ -1,30 +0,0 @@ -HOW TO BUILD WINDOWS ON LINUX using Dockerfile: ------------------------------------------------ - -This is quick description how to build ezquake for Windows under Linux in Docker. - -1) Install Docker or something similar -2) Create docker image to be able to run compilation tools: - - docker build --no-cache -t ezq:dev-focal-cross -f Dockerfile.focal-cross . - -3) Run command to generate a binary for current linux platform: - - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" ezq:dev-focal-cross make -j$(nproc) clean - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" ezq:dev-focal-cross dos2unix *.sh - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" -e EZ_CONFIG_FILE=.config_windows ezq:dev-focal-cross make -j$(nproc) all - docker run -it -v $(pwd):/ezquake-source --user "$(id -u):$(id -g)" -e EZ_CONFIG_FILE=.config_windows ezq:dev-focal-cross make strip - - -4) As a result you should have a for example: `ezquake.exe` which can be used with `nquake`, for example: - - cp -f ezquake.exe c:\nquake - cd c:\nquake - ezquake.exe - - -TODO: ---------------------------------------- -- multi-arch -- other distros (centos, debian, older distros) -- using kaniko https://github.com/GoogleContainerTools/kaniko From 8c54b507702abcf0ffc9c0fe4dff3a5471399953 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 19 Sep 2024 16:53:34 +0200 Subject: [PATCH 6/6] DOCS: Consolidate compilation docs to BUILD.md. --- BUILD.md | 244 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 55 +----------- 2 files changed, 247 insertions(+), 52 deletions(-) create mode 100644 BUILD.md diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 000000000..4be9c6e93 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,244 @@ +# Compiling ezQuake + +## Introduction + +To provide a consistent build on Windows, Linux, macOS and BSD across various compilers, +dynamic and static linking, all described in one single file, [CMake][cmake] is used, with +the help of [vcpkg][vcpkg] to support static linking. + +In its most basic form on Linux/BSD, with dynamic linking, a build can be invoked as follows: + +```shell +mkdir build && cd build +cmake .. -DCMAKE_BUILD_TYPE=Release # Configuration phase +make -j $(nproc) # Build phase +``` + +This will locate all system-wide dependencies and show a clear message if a mandatory +dependency is not installed. Check the output to see if it matches your expectations +in regard to optional dependencies. + +When configure phase passes, the build phase will produce a dynamically linked binary. +For convenience this binary is copied to the top project directory, but can otherwise +be found in the build directory at `build/ezquake-linux-x86_64`. + +The default mode of compilation is to not show the full command line, only errors and +warnings. To enable verbose mode, set `CMAKE_VERBOSE_MAKEFILE` to `ON`. + +While CMake can be configured via `CMAKE_C_CFLAGS`, it also supports picking up `CFLAGS` +from the aptly named environment variable `CFLAGS`. + +The ezQuake build also declares a few options on its own to customize the resulting executable. +Unfortunately CMake CLI has no built-in command to list them, so check `CMakeLists.txt`: + +```shell +grep -E ^option CMakeLists.txt +``` + +Putting the above customizations to work may look like this: +```shell +export CFLAGS=-march=native +mkdir build && cd build +cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DRENDERER_CLASSIC_OPENGL=OFF +make -j $(nproc) +``` + +CMake caches as much as possible when the build is initialized to allow for fast iteration +when developing. Should an option not activate as expected, removing the build directory +and starting over is always a failsafe. Static dependencies are [cached elsewhere](#Caches) +and will not have to be rebuilt if only the build directory is removed. + +## CMake Presets + +[CMake presets][cmake-presets] can be seen as aliases that associates a number of build +settings to a name. While this may not add much value for the trivial dynamically linked +Linux/BSD build, the presets do add some desirable conveniences for other targets as is +seen in later sections. + +There are two types of presets relevant to the ezQuake build: + +* Configuration Presets +* Build Presets + +The available presets can be listed via: + +```shell +$ cmake --list-presets +Available configure presets: + + "mingw64-x64-cross" + "mingw64-i686-cross" + ... + +$ cmake --build --list-presets +Available build presets: + + "msbuild-x64-debug" - Build msbuild-x64 debug + "msbuild-x64-release" - Build msbuild-x64 release + "msbuild-x64-relwithdebinfo" - Build msbuild-x64 release with debug info + ... +``` + +These can be invoked, regardless of underlying build system, via: + +```shell +# Creates build-dynamic directory, and initializes the build +cmake --preset dynamic + +# Builds executable in build-dynamic/Release/ezquake +cmake --build --preset dynamic-release + +# ...or if skipping the build preset, pass path to build directory instead +camke --build build-dynamic --config Release +``` + +The build directory is by convention always called `build-${presetName}` when using presets. + +All declared presets are of type _Multi-Config_ so they're able to produce _Debug_, +_Release_, and _RelWithDebInfo_ variants from the same configuration. + +While build presets are somewhat optional when building from the terminal, they add +convenience when working from within an editor with CMake support. + +## Static linking + +Static builds are supported on Windows, Linux and macOS and offloads building of +dependencies to [vcpkg][vcpkg]. The CMake configuration is agnostic to dynamic or +static linking and enabling of static linking happens via parametrizing the CMake +invocation with the vcpkg toolchain. This is done automatically by using any of the +Windows, macOS, or the static presets. + +Before starting a static build, vcpkg needs to be initialized. This is done by invoking +`bootstrap.sh` on *nix-like platforms. Depending on which [type of build](#Visual-Studio) +is used on Windows, the `bootstrap.ps1` PowerShell script does the equivalent. + +The invocation of a Linux static build is near identical to a dynamic build: +```shell +./bootstrap.sh +cmake --preset static +cmake --build build-static --config Release +``` + +If you haven't compiled a static version before, or if the project has updated the vcpkg +repository version since last build, this will take a few minutes. + +Note that for Linux/BSD builds, you have to install the appropriate X11/Wayland development +headers for the static build to work with each of those targets. + +## Cross-Compilation to Windows + +Any *nix environment can produce a Windows build via: +```shell +./bootstrap.sh +cmake --preset mingw64-x64-cross +cmake --build build-mingw64-x64-cross --config Release +``` + +## Visual Studio + +### CMake Mode + +Microsoft is highly invested in both CMake and vcpkg, so native support in Visual Studio has +existed for a number of years by now. Importing the project in Visual Studio 17 detects the +CMake and vcpkg combination and builds the dependencies. + +Once done, the build presets will be listed in the _Configurations_ drop down. The `msbuild-*` +or `ninja-msvc-*` related build presets are typically a good fit. + +To run ezQuake against a specific game directory, go via menu to _Debug_ > _Debug and Launch +Settings for ezquake_ which will open up the `launch_schema.json` file where you introduce +`currentDir` similar to the following: + +```json +{ + "version": "...", + "defaults": {}, + "configurations": [ + { + "type": "...", + "currentDir": "C:\\Quake" + } + ] +} +``` + +### Visual Studio Solution Mode + +As the Visual Studio Solution is generated first after CMake configuration phase has finished, +the `./bootstrap.ps1` PowerShell script must be invoked the first time to initialize vcpkg. + +```shell +powershell -File bootstrap.ps1 +camke --preset msbuild-x64 +``` + +Once done you will have a Visual Studio Solution in `build-msbuild-x64/ezquake.sln`. +Any compilation changes that should be upstreamed must be updated in `CMakeLists.txt`. + +During the configuration phase, if a `ezquake.vcxproj.user` file exists in the top directory, +this will be copied to the build directory next to the Visual Studio Solution to allow for +persisting custom settings as the solution is generated. + +## Xcode / macOS + +To simplify bundling static linking is used to build ezQuake on macOS, so start off by +invoking `bootstrap.sh` first. When initializing for example the `macos-arm64` preset +an Xcode project will be produced at `build-macos-arm64/ezquake.xcodeproj` with similar +structure to that of Visual Studio. + +The same preset is also used when building via the terminal: +``` +./bootstrap.sh +cmake --preset macos-arm64 +cmake --build build-macos-arm64 --config Release +``` +This will produce `ezQuake.app` under `build-macos-arm64/Release/ezQuake.app` by invoking +`xcodebuild` behind the scenes to do the actual building and bundling. + +## Caches + +If you don't intend to build ezQuake again and want to reclaim some space, you can find the shared vcpkg cache at: + +* All platforms + * `./vcpkg/buildtrees` +* *nix + * `~/.cache/vcpkg/` +* Windows + * `c:\Users\$UserName\AppData\Local\vcpkg` + +## Developer Tidbits + +### Adding new files to the project + +In [CMakeLists.txt](CMakeLists.txt) source files are categorized into their approximate use +cases (client, server, common, sys, etc), and this also applies to header files. The reason +for this is to serve editors with the correct context, and if generating either a Xcode or +Visual Studio project this categorization is also visualized in the project tree view. + +Looking forward, this will allow adding a `ezquake-sv` target by just reusing the relevant +subset of source files. + +### Managing static dependencies + +Vcpkg is used in [manifest mode][vcpkg-manifest], with the dependencies declared in `vcpkg.json`. +While it's possible to lock dependencies at a specific version, this is not used today. Instead +the vcpkg submodule dictates the set of dependency versions the project relies on. + +If adding a new mandatory dependency that static versions of ezQuake should use, first find it +at [vcpkg.io][vcpkg-list], and if missing, read up on [overlay ports][vcpkg-overlay]. + +### Target platforms + +If a specific platform requires customizations to how the static dependencies are built a [_triplet_][vcpkg-triplets] +for this platform can be introduced. An example of such an override is the [x64 MinGW](cmake/triplets/x64-mingw-static.cmake) +triplet that adds `-march=nehalem` when building dependencies. + + [cmake]: https://cmake.org/ + [cmake-presets]: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html + [cmake-cflags]: https://cmake.org/cmake/help/latest/envvar/CFLAGS.html + [vcpkg]: https://learn.microsoft.com/en-us/vcpkg/ + [vcpkg-manifest]: https://learn.microsoft.com/en-us/vcpkg/concepts/manifest-mode + [vcpkg-list]: https://vcpkg.io/en/ + [vcpkg-overlay]: https://learn.microsoft.com/en-us/vcpkg/concepts/overlay-ports + [vcpkg-triplets]: https://learn.microsoft.com/en-us/vcpkg/users/triplets + [vscmake]: https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio diff --git a/README.md b/README.md index d1c10b57d..deabd6b72 100644 --- a/README.md +++ b/README.md @@ -62,59 +62,10 @@ If you want to make a clean installation of ezQuake you can do this by following ## Compiling -### Compiling a Windows binary +On Linux, `./build-linux.sh` produces an ezQuake binary in the top directory. -See [misc/docs/COMPILING_FOR_WINDOWS.md](misc/docs/COMPILING_FOR_WINDOWS.md) - -### Compiling a Linux binary - -_These instructions were tested on Ubuntu_ - -Make sure you have the dependencies installed: - -(You may skip installing dependencies if you are going to use the build-linux.sh script included in the repository, this will take care of installing packages for you.) - -- For *Debian/Ubuntu 16.10+* -``` -sudo apt install git build-essential libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype6-dev libsndfile1-dev libpcre2-dev libminizip-dev -``` -- For *openSUSE Tumbleweed* -``` -sudo zypper install -t pattern devel_C_C++ -sudo zypper install git pcre2-devel Mesa-libGL-devel SDL2-devel libjansson-devel libexpat-devel libcurl-devel libpng16-devel libpng16-compat-devel libjpeg8-devel libjpeg-turbo libsndfile-devel speex-devel speexdsp-devel libXxf86vm-devel -``` -- For *Fedora* -``` -sudo dnf group install 'C Development Tools and Libraries' -sudo dnf install git pcre2-devel mesa-libEGL-devel SDL2-devel jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel libsndfile-devel speex-devel speexdsp-devel libXxf86vm-devel -``` - -Clone the git repository: -``` -git clone --recurse-submodules https://github.com/ezQuake/ezquake-source.git -``` - -Switch to `ezquake-source` path: -``` -cd ~/ezquake-source/ -``` - -Initialize/update git submodules: -``` -git submodule update --init --recursive --remote -``` - -Run the compilation (replace 5 with the number of cpu cores you have +1): -``` -make -j5 -``` -You can add `-jN` as a parameter to `make` to build in parallell. Use number of cpu cores plus 1 (e.g. `-j5` if you have a quad core processor). - -Copy the compiled binary to your Quake folder, on 64bit linux the binary will be called `ezquake-linux-x86_64`. - -### Compiling an OS X binary - -See [misc/docs/COMPILING_ON_OSX.md](misc/docs/COMPILING_ON_OSX.md) +For a more in-depth description of how to build on all platforms, have a look at +[BUILD.md](BUILD.md). ## Nightly builds