Updated Makefile

Fixed bugs with targets. Removed all if statements for targets related to git submodules. These are their own targets now.
This commit is contained in:
Ethan Smith-Coss 2024-06-18 20:30:29 +01:00
parent 5ebadd41ca
commit 80e505e834
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B

View File

@ -9,24 +9,22 @@ INC_SYSTEM_PATH=/usr/include
default-target: build
# Build Hyprland if it's not installed on the system
__Hyperland = $(BIN_SYSTEM_PATH)/hyprland
$(__Hyperland): $(__Hyperlang) $(__Hypercursor)
if [ ! -d Hyprland ]; then
Hyprland:
git submodule init
git submodule update --remote Hyprland
fi
__Hyperland = $(BIN_SYSTEM_PATH)/hyprland
$(__Hyperland): $(__Hyperlang) $(__Hypercursor)
$(MAKE) -C Hyprland all
# Build hyprcursor if the .hpp file is not installed (required hyprlang)
__Hypercursor = $(INC_SYSTEM_PATH)/hyprcursor.hpp
$(__Hypercursor): $(__Hyperlang)
if [ ! -d hyprcursor ]; then
hyprcursor:
git submodule init
git submodule update --remote hyprcursor
fi
__Hypercursor = $(INC_SYSTEM_PATH)/hyprcursor.hpp
$(__Hypercursor): $(__Hyperlang)
$(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./hyprcursor/build
$(CMAKE) --build ./build --config Release --target all \
-DCMAKE_INSTALL_PREFIX:PATH=/usr -S ./hyprcursor -B ./hyprcursor/build
$(CMAKE) --build ./hyprcursor/build --config Release --target all \
-j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`
@echo "Installing library hyprcursor..."
sudo $(CMAKE) --install hyprcursor/build
@ -44,12 +42,11 @@ $(__Hyprutils): hyprutils
sudo $(CMAKE) --install hyprutils/build
# Build hyprlang if the .hpp file is not installed
__Hyprlang = $(INC_SYSTEM_PATH)/hyprlang.hpp
$(__Hyprlang): $(__Hyprutils)
if [ ! -d hyprlang ]; then
hyprlang:
git submodule init
git submodule update --remote hyprlang
fi
__Hyprlang = $(INC_SYSTEM_PATH)/hyprlang.hpp
$(__Hyprlang): $(__Hyprutils)
# built using cmake
$(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./hyprlang/build
@ -60,36 +57,34 @@ $(__Hyprlang): $(__Hyprutils)
sudo $(CMAKE) --install ./hyprlang/build
# Build hyprlock if it's not installed on the system
__Hyprlock = $(BIN_SYSTEM_PATH)/hyprlock
$(__Hyprlock): $(__Hyprlang)
if [ ! -d hyprlock ]; then
hyprlock:
git submodule init
git submodule update --remote hyprlock
fi
__Hyprlock = $(BIN_SYSTEM_PATH)/hyprlock
$(__Hyprlock): $(__Hyprlang)
$(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \
-S . -B ./hyprlock/build
$(CMAKE) --build ./hyprlock/build --config Release --target hyprlock \
-j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`
# Build hyprpaper if it's not installed on the system
__Hyprpaper = $(BIN_SYSTEM_PATH)/hyprpaper
hyprpaper: $(__Hyprlang)
if [ ! -d hyprpaper ]; then
hyprpaper:
git submodule init
git submodule update --remote hyprpaper
fi
__Hyprpaper = $(BIN_SYSTEM_PATH)/hyprpaper
hyprpaper: $(__Hyprlang)
$(CMAKE) --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./hyprpaper/build
$(CMAKE) --build ./hyprpaper/build --config Release --target hyprpaper \
-j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`
__Wl_clipboard = $(BIN_SYSTEM_PATH)/wl-copy $(BIN_SYSTEM_PATH)/wl-paste
$(__Wl_clipboard):
if [ ! -d wl-clipboard ]; then
# Build wl-clipboard if it's not installed on the system
wl-clipboard:
git submodule init
git submodule update --remote wl-clipboard
fi
$(MESON) setup -C wl-clipboard build
__Wl_clipboard = $(BIN_SYSTEM_PATH)/wl-copy $(BIN_SYSTEM_PATH)/wl-paste
$(__Wl_clipboard):
cd wl-clipboard && $(MESON) setup wl-clipboard build
ninja -C wl-clipboard/build
# Build and install tomlplusplus if it's not on the system
@ -98,9 +93,8 @@ tomlplusplus:
__Tomlplusplus = $(INC_SYSTEM_PATH)/toml++
$(__Tomlplusplus): tomlplusplus
@echo "Building and installing tomlplusplus..."
cd tomlplusplus && $(MESON) setup build --buildtype=release
cd tomlplusplus && $(MESON) setup build --buildtype=release --prefix=/usr
ninja -C tomlplusplus/build
DESTDIR=$(INC_SYSTEM_PATH)/toml++ \
sudo $(MESON) install -C tomlplusplus/build
### PHONY targets that a user would run ###