From 9c3b2d6a4b3d9ff0d24fe869ec41bccf24e91620 Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Sun, 17 Nov 2024 18:45:18 +0000 Subject: [PATCH] Moved variables for targets to the top --- Makefile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 8a51517..68876a8 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,19 @@ COMPONENTS=hyprcursor hyprlang hyprlock hyprpaper hyprutils wl-clipboard \ # Set the default target to build .DEFAULT_GOAL := all +### Makefile variable definitions for targets ### + +__Hyprlang = $(INCLUDE_SYS_PATH)/hyprlang.hpp +__Hyprcursor = $(INCLUDE_SYS_PATH)/hyprcursor +__Hyprutils = $(INCLUDE_SYS_PATH)/hyprutils +__Hyprwayland-scanner = /usr/lib64/cmake/hyprwayland-scanner +__Libxcb-errors = /usr/lib/pkgconfig/xcb-errors.pc +__Aquamarine = $(INCLUDE_SYS_PATH)/aquamarine +__Hyprland = Hyprland/build/Hyprland +__Hyprlock = hyprlock/build/hyprlock +__Hyprpaper = hyprpaper/build/hyprpaper +__Wl_clipboard = wl-clipboard/build/src + ### Makefile targets for hyprwm libraries ### # Build and install tomlplusplus if it's not on the system @@ -24,7 +37,6 @@ $(__Tomlplusplus): tomlplusplus # Build hyprlang if the .hpp file is not installed # Library for hyprwm -__Hyprlang = $(INCLUDE_SYS_PATH)/hyprlang.hpp $(__Hyprlang): hyprlang $(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX:PATH=/usr -S ./hyprlang -B ./hyprlang/build @@ -36,7 +48,6 @@ $(__Hyprlang): hyprlang # Build hyprcursor if the .hpp file is not installed (required hyprlang) # Library for hyprwm -__Hyprcursor = $(INCLUDE_SYS_PATH)/hyprcursor $(__Hyprcursor): $(__Tomlplusplus) $(__Hyprlang) hyprcursor $(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX:PATH=/usr -S ./hyprcursor -B ./hyprcursor/build @@ -47,7 +58,6 @@ $(__Hyprcursor): $(__Tomlplusplus) $(__Hyprlang) hyprcursor # Build hyprutils if the .hpp file is not installed # Library for hyprwm -__Hyprutils = $(INCLUDE_SYS_PATH)/hyprutils $(__Hyprutils): hyprutils $(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX:PATH=/usr -S ./hyprutils -B ./hyprutils/build @@ -55,7 +65,6 @@ $(__Hyprutils): hyprutils -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` sudo $(CMAKE) --install hyprutils/build -__Hyprwayland-scanner = /usr/lib64/cmake/hyprwayland-scanner $(__Hyprwayland-scanner): hyprwayland-scanner $(CMAKE) -DCMAKE_INSTALL_PREFIX=/usr -S ./hyprwayland-scanner \ -B hyprwayland-scanner/build @@ -66,7 +75,6 @@ $(__Hyprwayland-scanner): hyprwayland-scanner libxcb-errors: git clone https://gitlab.freedesktop.org/xorg/lib/libxcb-errors.git -__Libxcb-errors = /usr/lib/pkgconfig/xcb-errors.pc $(__Libxcb-errors): libxcb-errors @echo "Building and installing library libxcb-errors..." cd libxcb-errors && { \ @@ -75,7 +83,6 @@ $(__Libxcb-errors): libxcb-errors /bin/sh configure --prefix=/usr ; } make -C libxcb-errors && sudo make -C libxcb-errors install -__Aquamarine = $(INCLUDE_SYS_PATH)/aquamarine $(__Aquamarine): $(__Hyprwayland-scanner) $(__Hyprutils) aquamarine $(CMAKE) -DCMAKE_INSTALL_PREFIX=/usr -S ./aquamarine \ -B aquamarine/build @@ -87,14 +94,12 @@ $(__Aquamarine): $(__Hyprwayland-scanner) $(__Hyprutils) aquamarine ### Makefile targets for hyprwm apps ### # Build Hyprland if it's not installed on the system -__Hyprland = Hyprland/build/Hyprland $(__Hyprland): $(__Hyprcursor) $(__Libxcb-errors) $(__Aquamarine) @echo "Building Hyprland..." sudo $(MAKE) -C Hyprland all sudo chown -R $$USER:$$USER Hyprland/build # Build hyprlock if it's not installed on the system -__Hyprlock = hyprlock/build/hyprlock $(__Hyprlock): $(__Hyprlang) @echo "Building hyprlock..." $(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \ @@ -103,7 +108,6 @@ $(__Hyprlock): $(__Hyprlang) -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` # Build hyprpaper if it's not installed on the system -__Hyprpaper = hyprpaper/build/hyprpaper $(__Hyprpaper): $(__Hyprlang) @echo "Building hyprpaper..." $(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \ @@ -112,7 +116,6 @@ $(__Hyprpaper): $(__Hyprlang) -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` # Build wl-clipboard if it's not installed on the system -__Wl_clipboard = wl-clipboard/build/src $(__Wl_clipboard)/wl-copy $(__Wl_clipboard)/wl-paste &: cd wl-clipboard && $(MESON) setup --prefix=/usr build ninja -C wl-clipboard/build