From c461b3c67b9ddc0bcfe2031f3d598138221a710d Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 24 Oct 2024 23:08:50 +0200 Subject: [PATCH] make: remove static targets --- .github/workflows/build.yml | 2 +- Makefile | 66 ++----------------------------------- README.md | 24 ++------------ 3 files changed, 6 insertions(+), 86 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1356c330b..2084792ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,7 +78,7 @@ jobs: - name: build run: | ${{env.CCACHE_SETTINGS}} - make release-static-win64 -j${{env.MAKE_JOB_COUNT}} + make release-static -j${{env.MAKE_JOB_COUNT}} build-arch: name: 'Arch Linux' diff --git a/Makefile b/Makefile index abcabc24a..2c03ed99f 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ cmake-debug: cd $(builddir)/debug && cmake -D CMAKE_BUILD_TYPE=Debug $(topdir) debug: cmake-debug - cd $(builddir)/debug && $(MAKE) + cd $(builddir)/debug && cmake --build . # Temporarily disable some tests: # * libwallet_api_tests fail (Issue #895) @@ -75,24 +75,12 @@ debug-all: mkdir -p $(builddir)/debug cd $(builddir)/debug && cmake -D BUILD_TESTS=ON -D BUILD_SHARED_LIBS=OFF -D CMAKE_BUILD_TYPE=Debug $(topdir) && $(MAKE) -debug-static-all: - mkdir -p $(builddir)/debug - cd $(builddir)/debug && cmake -D BUILD_TESTS=ON -D STATIC=ON -D CMAKE_BUILD_TYPE=Debug $(topdir) && $(MAKE) - -debug-static-win64: - mkdir -p $(builddir)/debug - cd $(builddir)/debug && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x64" $(topdir) && $(MAKE) - -debug-static-win32: - mkdir -p $(builddir)/debug - cd $(builddir)/debug && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x32" $(topdir) && $(MAKE) - cmake-release: mkdir -p $(builddir)/release cd $(builddir)/release && cmake -D CMAKE_BUILD_TYPE=Release $(topdir) release: cmake-release - cd $(builddir)/release && $(MAKE) + cd $(builddir)/release && cmake --build . release-test: mkdir -p $(builddir)/release @@ -104,60 +92,12 @@ release-all: release-static: mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE) + cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="default" -D CMAKE_BUILD_TYPE=Release $(topdir) && cmake --build . coverage: mkdir -p $(builddir)/debug cd $(builddir)/debug && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug -D COVERAGE=ON $(topdir) && $(MAKE) && $(MAKE) test -# Targets for specific prebuilt builds which will be advertised for updates by their build tag - -release-static-linux-armv6: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv6zk" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="linux-armv6" $(topdir) && $(MAKE) - -release-static-linux-armv7: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="linux-armv7" $(topdir) && $(MAKE) - -release-static-android-armv7: - mkdir -p $(builddir)/release/translations - cd $(builddir)/release/translations && cmake ../../../translations && $(MAKE) - cd $(builddir)/release && CC=arm-linux-androideabi-clang CXX=arm-linux-androideabi-clang++ cmake -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Release -D ANDROID=true -D BUILD_TAG="android-armv7" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARM_MODE=ON -D CMAKE_ANDROID_ARCH_ABI="armeabi-v7a" ../.. && $(MAKE) - -release-static-android-armv8: - mkdir -p $(builddir)/release/translations - cd $(builddir)/release/translations && cmake ../../../translations && $(MAKE) - cd $(builddir)/release && CC=aarch64-linux-android-clang CXX=aarch64-linux-android-clang++ cmake -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D ANDROID=true -D BUILD_TAG="android-armv8" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI="arm64-v8a" ../.. && $(MAKE) - -release-static-linux-armv8: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="linux-armv8" $(topdir) && $(MAKE) - -release-static-linux-x86_64: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="linux-x64" $(topdir) && $(MAKE) - -release-static-freebsd-x86_64: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="freebsd-x64" $(topdir) && $(MAKE) - -release-static-mac-x86_64: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="mac-x64" $(topdir) && $(MAKE) - -release-static-linux-i686: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="linux-x86" $(topdir) && $(MAKE) - -release-static-win64: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x64" $(topdir) && $(MAKE) - -release-static-win32: - mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x32" $(topdir) && $(MAKE) - fuzz: mkdir -p $(builddir)/fuzz cd $(builddir)/fuzz && cmake -D STATIC=ON -D SANITIZE=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D CMAKE_C_COMPILER=afl-gcc -D CMAKE_CXX_COMPILER=afl-g++ -D ARCH="x86-64" -D CMAKE_BUILD_TYPE=fuzz -D BUILD_TAG="linux-x64" $(topdir) && $(MAKE) diff --git a/README.md b/README.md index a2a221c8d..be4c257d2 100644 --- a/README.md +++ b/README.md @@ -286,14 +286,6 @@ invokes cmake commands as needed. make debug ``` -* **Optional**: to build statically-linked binaries: - - ```bash - make release-static - ``` - -Dependencies need to be built with -fPIC. Static libraries usually aren't, so you may have to build them yourself with -fPIC. Refer to their documentation for how to build them. - * **Optional**: build documentation in `doc/html` (omit `HAVE_DOT=YES` if `graphviz` is not installed): ```bash @@ -402,7 +394,7 @@ application. * To build Monero, run: ```bash - make release-static-win64 + make release-static -j $(nproc) ``` The resulting executables can be found in `build/release/bin` @@ -411,7 +403,7 @@ application. * **Optional**: to build Windows binaries suitable for debugging, run: ```bash - make debug-static-win64 + make debug -j $(nproc) ``` The resulting executables can be found in `build/debug/bin` @@ -462,18 +454,6 @@ cd ../.. Then you can run make as usual. -### Building portable statically linked binaries - -By default, in either dynamically or statically linked builds, binaries target the specific host processor on which the build happens and are not portable to other processors. Portable binaries can be built using the following targets: - -* ```make release-static-linux-x86_64``` builds binaries on Linux on x86_64 portable across POSIX systems on x86_64 processors -* ```make release-static-linux-i686``` builds binaries on Linux on x86_64 or i686 portable across POSIX systems on i686 processors -* ```make release-static-linux-armv8``` builds binaries on Linux portable across POSIX systems on armv8 processors -* ```make release-static-linux-armv7``` builds binaries on Linux portable across POSIX systems on armv7 processors -* ```make release-static-linux-armv6``` builds binaries on Linux portable across POSIX systems on armv6 processors -* ```make release-static-win64``` builds binaries on 64-bit Windows portable across 64-bit Windows systems -* ```make release-static-win32``` builds binaries on 64-bit or 32-bit Windows portable across 32-bit Windows systems - ### Cross Compiling You can also cross-compile static binaries on Linux for Windows and macOS with the `depends` system.