diff options
author | kz6fittycent <jimmy.tigert@gmail.com> | 2023-12-12 14:06:44 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-12 14:06:44 -0600 |
commit | 2973a76f2b3183b571e6706e523aa42f6b1b7f69 (patch) | |
tree | b8b36a04d58984542735923d62d58da4ea4586fe | |
parent | fb782a2ab32cc60ff6bcaec5ae13514ce5ca5390 (diff) | |
parent | 0d357468b50a13b48868b4969b4f19000c90d5d6 (diff) |
Merge branch 'aristocratos:main' into main
57 files changed, 20420 insertions, 1130 deletions
diff --git a/.editorconfig b/.editorconfig index 63202f0..b27d25a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -[*.{cpp,h,sh,md,cfg,sample}] +[*.{cpp,h,hpp,sh,md,cfg,sample}] indent_style = tab indent_size = 4 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 45d2a03..ba33216 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -3,10 +3,10 @@ github: aristocratos patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username +ko_fi: aristocratos tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: https://paypal.me/aristocratos diff --git a/.github/workflows/continuous-build-freebsd.yml b/.github/workflows/continuous-build-freebsd.yml new file mode 100644 index 0000000..c7b68ab --- /dev/null +++ b/.github/workflows/continuous-build-freebsd.yml @@ -0,0 +1,75 @@ +name: Continuous Build FreeBSD + +on: + workflow_dispatch: + push: + branches: + - main + tags-ignore: + - '*.*' + paths: + - 'src/**' + - '!src/linux/**' + - '!src/osx/**' + - 'include/**' + - 'Makefile' + - '.github/workflows/continuous-build-freebsd.yml' + pull_request: + branches: + - main + paths: + - 'src/**' + - '!src/linux/**' + - '!src/osx/**' + - 'include/**' + - 'Makefile' + - '.github/workflows/continuous-build-freebsd.yml' + +jobs: + build-freebsd: + runs-on: ubuntu-22.04 + timeout-minutes: 20 + strategy: + matrix: + compiler: ["clang++", "g++"] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Compile + uses: vmactions/freebsd-vm@v1 + with: + release: '14.0' + usesh: true + prepare: | + pkg install -y gmake gcc coreutils git + git config --global --add safe.directory /home/runner/work/btop/btop + run: | + CXX=${{ matrix.compiler }} gmake STATIC=true STRIP=true + GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") + COMPILER=$(echo ${{ matrix.compiler }} | sed 's/clang++/llvm/' | sed 's/g++/gcc/') + mv bin/btop bin/btop-"$COMPILER"-"$GIT_HASH" + ls -alh bin + + - uses: actions/upload-artifact@v3 + with: + name: btop-x86_64-freebsd-14 + path: 'bin/*' + if-no-files-found: error + + build-freebsd-cmake: + runs-on: ubuntu-22.04 + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + + - name: Compile + uses: vmactions/freebsd-vm@v1 + with: + release: '14.0' + usesh: true + prepare: pkg install -y cmake git ninja + run: | + CXX=clang++ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBTOP_STATIC=ON + cmake --build build diff --git a/.github/workflows/continuous-build-linux.yml b/.github/workflows/continuous-build-linux.yml index af32d65..3ef236c 100644 --- a/.github/workflows/continuous-build-linux.yml +++ b/.github/workflows/continuous-build-linux.yml @@ -13,7 +13,17 @@ on: - '!src/freebsd/**' - 'include/**' - 'Makefile' - - '.github/workflows/continuous-build.yml' + - '.github/workflows/continuous-build-linux.yml' + pull_request: + branches: + - main + paths: + - 'src/**' + - '!src/osx/**' + - '!src/freebsd/**' + - 'include/**' + - 'Makefile' + - '.github/workflows/continuous-build-linux.yml' jobs: static-build: @@ -83,7 +93,9 @@ jobs: run: git config --global --add safe.directory /__w/btop/btop - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + submodules: recursive - name: Fix - Stopping at filesystem boundary run: git init # [fix Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).] @@ -107,7 +119,7 @@ jobs: cp bin/btop .artifacts/$FILENAME - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: btop-${{ matrix.toolchain }} path: '.artifacts/**' diff --git a/.github/workflows/continuous-build-macos.yml b/.github/workflows/continuous-build-macos.yml index 2cb5e4a..717e9a7 100644 --- a/.github/workflows/continuous-build-macos.yml +++ b/.github/workflows/continuous-build-macos.yml @@ -1,6 +1,7 @@ name: Continuous Build MacOS on: + workflow_dispatch: push: branches: - main @@ -12,15 +13,26 @@ on: - '!src/freebsd/**' - 'include/**' - 'Makefile' - - '.github/workflows/*' + - '.github/workflows/continuous-build-macos.yml' + pull_request: + branches: + - main + paths: + - 'src/**' + - '!src/linux/**' + - '!src/freebsd/**' + - 'include/**' + - 'Makefile' + - '.github/workflows/continuous-build-macos.yml' jobs: - build-osx: - + build-macos11: runs-on: macos-11 - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Compile run: | make CXX=g++-11 ARCH=x86_64 STATIC=true STRIP=true @@ -28,7 +40,30 @@ jobs: mv bin/btop bin/btop-x86_64-BigSur-$GIT_HASH ls -alh bin - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 + with: + name: btop-x86_64-macos11-BigSur + path: 'bin/*' + + build-macos12: + runs-on: macos-12 + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Compile + run: | + make CXX=g++-12 ARCH=x86_64 STATIC=true STRIP=true + GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") + mv bin/btop bin/btop-x86_64-Monterey-$GIT_HASH + ls -alh bin + + - uses: actions/upload-artifact@v3 with: - name: btop-x86_64-macos-BigSur + name: btop-x86_64-macos12-Monterey path: 'bin/*' @@ -51,6 +51,34 @@ bin btop .*/ +# Optional libraries +lib/rocm_smi_lib -#do not ignore .github directory -!.github
\ No newline at end of file +# Don't ignore .github directory +!.github/ + +# Ignore files created by Qt Creator +*.config +*.creator +*.creator.user +*.creator.user.* +*.cflags +*.cxxflags +*.files +*.includes + +# CMake +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + +# CLion +cmake-build-* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.gitmodules diff --git a/CHANGELOG.md b/CHANGELOG.md index dacbb53..c82b0f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,115 @@ +## v1.3.0 + +* Added Gpu Support | @romner-set | PR #529 + +* Elementarish theme: color update according to Elementary palette | @stradicat | PR #660 + +* Add alternative key codes for Delete, Insert, Home, End | @ivanp7 | PR #659 + +* Fix scrollbar not clearing sometimes. | @DecklynKern | PR #643 + +* Add keybind for toggling memory display mode in PROC box | @rahulaggarwal965 | PR #623 + +* Minor string initialization improvement | @imwints | PR #636 + +* Made disks statvfs logic asynchronous. | @crestfallnatwork | PR #633 + +* Fix signal list on non-linux/weird linux platforms | @lvxnull | PR #630 + +* Add option to accumulate a child's resources in parent in tree-view | @imwints | PR #618 + +* Add CMake support for Linux | @imwints | PR #589 + +* Horizon theme | @SidVeld | PR #610 + +* Fix short conversion of 1000-1023 *iB | @scorpion-26 | #609 + +* Fix integer overflows in btop_collect.cpp | @dorrellmw | #546 + +* Support compiling with LLVM | @imwints | #510 + +* Fix getting zfs pool name with '.' char in freebsd | @jfouquart | #602 + +* [macos/freebsd] support gcc13 | @joske | #600 + +* FreeBSD swap info | @rrveex | #560 + +* Create adwaita.theme | @flipflop133 | #485 + ++ Various fixes by @imwints, @simplepad, @joske, @gwena, @cpalv, @iambeingtracked, @mattico, @NexAdn + +## v1.2.13 + +* Makefile: VERBOSE=true flag for Makefile to display all compiler commands and fixed so already set CXXFLAGS and LDFLAGS are displayed. + +* Makefile: Added autodetection for gcc12 to make compiling on macos Ventura easier. + +* Changed: Reverted back to sysconf(_SC_NPROCESSORS_ONLN) for Cpu core count ant let the new dynamic update fix if cores are turned on later + +* Fixed: Ignore disks that fails in statvfs64() to avoid slowdowns and possible crashes. + +* Fixed: Moved up get_cpuHz() in the execution order to get better cpu clock reading. + +* Added: proc tree view: if there's more than 40 width left, try to print full cmd, by @Superty + +* Fixed: Show the first IP of the interface in NET box instead of the last, by @correabuscar + +* Changed: Replace getnameinfo with inet_ntop [on Linux], by @correabuscar + +* Fixed: Not picking up last username from /etc/passwd + +* Fixed: Process nice value underflowing, issue #461 + +* Changed: Replace getnameinfo with inet_ntop [on FreeBSD], by @correabuscar + +* Changed: Replace getnameinfo with inet_ntop [on macos], by @correabuscar + +## v1.2.12 + +* Added: Dynamic updating of max number of CPU cores. + +## v1.2.11 + +* Fixed: Number of cores wrongly detected for Ryzen in rare cases. + +## v1.2.10 + +* Fixed: Process tree filtering not case insensitive + +* Added: Paper theme, by @s6muel + +* Fixed: Extra checks to avoid crash on trying to replace empty strings in tree mode + +* Fixed: Crashing when cores are offline + +* Fixed: Cpu::collect() core count counter... + +* Changed: Using sysconf(_SC_NPROCESSORS_CONF) for number of cores instead of sysconf(_SC_NPROCESSORS_ONLN) + +* Maintenance: Code cleanup, by @stefanos82 + +## v1.2.9 + +* Fixed: Memory values not clearing properly when not in graph mode in mem box + +* Changed: kyli0x theme color update, by @kyli0x + +* Added: Elementarish theme, by @dennismayr + +* Added: key "?" to see help, by @mohi001 + +* Added: solarized_light theme, by @Fingerzam + +* Changed: Made ZFS stats collection compatible with zfs_pools_only option, by @simplepad + +* Changed: Rewrite of process sorting and tree generation including fixes for tree sorting and mouse support + +* Added: Option to hide the small cpu graphs for processes + +* Changed: Small graphs now show colors for each character + +* Fixed: Getting selfpath on macos (fix for finding theme folder) + ## v1.2.8 * Added: Support for ZFS pool io stats monitoring, by @simplepad diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ce4891d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,201 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# CMake configuration for btop +# + +cmake_minimum_required(VERSION 3.20) + +# Disable in-source builds since they would override the Makefile +if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + message(FATAL_ERROR "In-source builds are not allowed") +endif() + +project("btop" + VERSION 1.2.13 + DESCRIPTION "A monitor of resources" + HOMEPAGE_URL "https://github.com/aristocratos/btop" + LANGUAGES CXX +) + +# Make custom modules available +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") + +# When the build type is not set we can't fortify +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_COLOR_DIAGNOSTICS ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Options +include(CMakeDependentOption) +option(BTOP_STATIC "Link btop statically" OFF) +option(BTOP_LTO "Enable LTO" ON) +option(BTOP_USE_MOLD "Use mold to link btop" OFF) +option(BTOP_PEDANTIC "Enable a bunch of additional warnings" OFF) +option(BTOP_WERROR "Compile with warnings as errors" OFF) +option(BTOP_GPU "Enable GPU support" ON) +cmake_dependent_option(BTOP_RSMI_STATIC "Link statically to ROCm SMI" OFF "BTOP_GPU" OFF) + +if(BTOP_STATIC) + # Set this before calling find_package + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") +endif() + +include(CheckCXXCompilerFlag) +include(CheckIncludeFileCXX) +include(CheckIPOSupported) + +check_include_file_cxx(ranges CXX_HAS_RANGES) +if(NOT CXX_HAS_RANGES) + message(FATAL_ERROR "The compiler doesn't support <ranges>") +endif() + +add_executable(btop + src/btop.cpp + src/btop_config.cpp + src/btop_draw.cpp + src/btop_input.cpp + src/btop_menu.cpp + src/btop_shared.cpp + src/btop_theme.cpp + src/btop_tools.cpp +) + +# NOTE: Checks can be simplified with CMake 3.25 +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + target_sources(btop PRIVATE + src/osx/btop_collect.cpp + src/osx/sensors.cpp + src/osx/smc.cpp + ) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + target_sources(btop PRIVATE src/freebsd/btop_collect.cpp) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + target_sources(btop PRIVATE src/linux/btop_collect.cpp) +else() + message(FATAL_ERROR "${CMAKE_SYSTEM_NAME} is not supported") +endif() + +# Check for and enable LTO +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported AND BTOP_LTO) + set_target_properties(btop PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON) +endif() + +# TODO: enable more warnings in coordination with upstream +target_compile_options(btop PRIVATE + -Wall -Wextra -Wpedantic + -ftree-vectorize -fstack-clash-protection +) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(btop PRIVATE + -Wheader-hygiene -Wgnu -Wthread-safety + ) +endif() + +if(BTOP_PEDANTIC) + target_compile_options(btop PRIVATE + -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused + -Woverloaded-virtual -Wconversion -Wsign-conversion -Wdouble-promotion + -Wformat=2 -Wimplicit-fallthrough -Weffc++ + ) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(btop PRIVATE + -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wnull-dereference + -Wuseless-cast + ) + endif() +endif() + +if(BTOP_WERROR) + target_compile_options(btop PRIVATE -Werror) +endif() + +check_cxx_compiler_flag(-fstack-protector CXX_HAS_FSTACK_PROTECTOR) +if(CXX_HAS_FSTACK_PROTECTOR) + target_compile_options(btop PRIVATE -fstack-protector) +endif() + +check_cxx_compiler_flag(-fcf-protection CXX_HAS_FCF_PROTECTION) +if(CXX_HAS_FCF_PROTECTION) + target_compile_options(btop PRIVATE -fcf-protection) +endif() + +target_compile_definitions(btop PRIVATE + _FILE_OFFSET_BITS=64 + _GLIBCXX_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS=1 + # Only has an effect with optimizations enabled + $<$<NOT:$<CONFIG:Debug>>:_FORTIFY_SOURCE=2> +) + +# Enable GPU support +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND BTOP_GPU) + target_compile_definitions(btop PRIVATE GPU_SUPPORT) + + if(BTOP_RSMI_STATIC) + # ROCm doesn't properly add it's folders to the module path + # if `CMAKE_MODULE_PATH` is already set + # We could also manully append ROCm's path here + set(_CMAKE_MODULE_PATH CMAKE_MODULE_PATH) + unset(CMAKE_MODULE_PATH) + + # NOTE: This might be problematic in the future if other sub projects + # depend on this or if btop starts producing libraries + # Build a static ROCm library + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + + add_subdirectory(lib/rocm_smi_lib EXCLUDE_FROM_ALL) + + add_library(ROCm INTERFACE) + # Export ROCm's properties to a CMake target (which should've been done by ROCm :-/) + target_compile_definitions(ROCm INTERFACE RSMI_STATIC) + target_include_directories(ROCm INTERFACE lib/rocm_smi_lib/include) + target_link_libraries(ROCm INTERFACE rocm_smi64) + + set(CMAKE_MODULE_PATH _CMAKE_MODULE_PATH) + + target_link_libraries(btop PRIVATE ROCm) + endif() +endif() + +target_include_directories(btop SYSTEM PRIVATE include) + +# mold +if(BTOP_USE_MOLD) + target_link_options(btop PRIVATE -fuse-ld=mold) +endif() + +if(BTOP_STATIC) + target_compile_definitions(btop PRIVATE STATIC_BUILD) + target_link_options(btop PRIVATE -static LINKER:--fatal-warnings) +endif() + +# Add libraries +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +target_link_libraries(btop PRIVATE Threads::Threads) + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + target_link_libraries(btop PRIVATE $<LINK_LIBRARY:FRAMEWORK,CoreFoundation) + target_link_libraries(btop PRIVATE $<LINK_LIBRARY:FRAMEWORK,IOKit) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + find_package(devstat REQUIRED) + find_package(kvm REQUIRED) + target_link_libraries(btop PRIVATE devstat::devstat kvm::kvm) + if(BTOP_STATIC) + find_package(elf REQUIRED) + target_link_libraries(btop PRIVATE elf::elf) + endif() +endif() + +install(TARGETS btop RUNTIME) +install(FILES "btop.desktop" DESTINATION "share/applications") +install(FILES "Img/icon.png" DESTINATION "share/icons/hicolor/48x48/apps" RENAME "btop.png") +install(FILES "Img/icon.svg" DESTINATION "share/icons/hicolor/scalable/apps" RENAME "btop.svg") +install(DIRECTORY "themes" DESTINATION "share/btop") + @@ -1,6 +1,6 @@ -#* Btop++ makefile v1.5 +#* Btop++ makefile v1.6 -BANNER = \n \033[38;5;196m██████\033[38;5;240m╗ \033[38;5;196m████████\033[38;5;240m╗ \033[38;5;196m██████\033[38;5;240m╗ \033[38;5;196m██████\033[38;5;240m╗\n \033[38;5;160m██\033[38;5;239m╔══\033[38;5;160m██\033[38;5;239m╗╚══\033[38;5;160m██\033[38;5;239m╔══╝\033[38;5;160m██\033[38;5;239m╔═══\033[38;5;160m██\033[38;5;239m╗\033[38;5;160m██\033[38;5;239m╔══\033[38;5;160m██\033[38;5;239m╗ \033[38;5;160m██\033[38;5;239m╗ \033[38;5;160m██\033[38;5;239m╗\n \033[38;5;124m██████\033[38;5;238m╔╝ \033[38;5;124m██\033[38;5;238m║ \033[38;5;124m██\033[38;5;238m║ \033[38;5;124m██\033[38;5;238m║\033[38;5;124m██████\033[38;5;238m╔╝ \033[38;5;124m██████\033[38;5;238m╗\033[38;5;124m██████\033[38;5;238m╗\n \033[38;5;88m██\033[38;5;237m╔══\033[38;5;88m██\033[38;5;237m╗ \033[38;5;88m██\033[38;5;237m║ \033[38;5;88m██\033[38;5;237m║ \033[38;5;88m██\033[38;5;237m║\033[38;5;88m██\033[38;5;237m╔═══╝ ╚═\033[38;5;88m██\033[38;5;237m╔═╝╚═\033[38;5;88m██\033[38;5;237m╔═╝\n \033[38;5;52m██████\033[38;5;236m╔╝ \033[38;5;52m██\033[38;5;236m║ ╚\033[38;5;52m██████\033[38;5;236m╔╝\033[38;5;52m██\033[38;5;236m║ ╚═╝ ╚═╝\n \033[38;5;235m╚═════╝ ╚═╝ ╚═════╝ ╚═╝ \033[1;3;38;5;240mMakefile v1.5\033[0m +BANNER = \n \033[38;5;196m██████\033[38;5;240m╗ \033[38;5;196m████████\033[38;5;240m╗ \033[38;5;196m██████\033[38;5;240m╗ \033[38;5;196m██████\033[38;5;240m╗\n \033[38;5;160m██\033[38;5;239m╔══\033[38;5;160m██\033[38;5;239m╗╚══\033[38;5;160m██\033[38;5;239m╔══╝\033[38;5;160m██\033[38;5;239m╔═══\033[38;5;160m██\033[38;5;239m╗\033[38;5;160m██\033[38;5;239m╔══\033[38;5;160m██\033[38;5;239m╗ \033[38;5;160m██\033[38;5;239m╗ \033[38;5;160m██\033[38;5;239m╗\n \033[38;5;124m██████\033[38;5;238m╔╝ \033[38;5;124m██\033[38;5;238m║ \033[38;5;124m██\033[38;5;238m║ \033[38;5;124m██\033[38;5;238m║\033[38;5;124m██████\033[38;5;238m╔╝ \033[38;5;124m██████\033[38;5;238m╗\033[38;5;124m██████\033[38;5;238m╗\n \033[38;5;88m██\033[38;5;237m╔══\033[38;5;88m██\033[38;5;237m╗ \033[38;5;88m██\033[38;5;237m║ \033[38;5;88m██\033[38;5;237m║ \033[38;5;88m██\033[38;5;237m║\033[38;5;88m██\033[38;5;237m╔═══╝ ╚═\033[38;5;88m██\033[38;5;237m╔═╝╚═\033[38;5;88m██\033[38;5;237m╔═╝\n \033[38;5;52m██████\033[38;5;236m╔╝ \033[38;5;52m██\033[38;5;236m║ ╚\033[38;5;52m██████\033[38;5;236m╔╝\033[38;5;52m██\033[38;5;236m║ ╚═╝ ╚═╝\n \033[38;5;235m╚═════╝ ╚═╝ ╚═════╝ ╚═╝ \033[1;3;38;5;240mMakefile v1.6\033[0m override BTOP_VERSION := $(shell head -n100 src/btop.cpp 2>/dev/null | grep "Version =" | cut -f2 -d"\"" || echo " unknown") override TIMESTAMP := $(shell date +%s 2>/dev/null || echo "0") @@ -12,12 +12,12 @@ else endif ifneq ($(QUIET),true) - override PRE := info info-quiet override QUIET := false -else - override PRE := info-quiet endif +OLDCXX := $(CXXFLAGS) +OLDLD := $(LDFLAGS) + PREFIX ?= /usr/local #? Detect PLATFORM and ARCH from uname/gcc if not set @@ -36,6 +36,70 @@ endif override PLATFORM_LC := $(shell echo $(PLATFORM) | tr '[:upper:]' '[:lower:]') +#? GPU Support +ifeq ($(PLATFORM_LC)$(ARCH),linuxx86_64) + ifneq ($(STATIC),true) + GPU_SUPPORT := true + endif < |