From b8f1af317331b19464902d52c5d3b225c036be28 Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Mon, 1 Jul 2024 18:54:36 +0100 Subject: [PATCH] Updated Makefile Added a clean recipe to remove all built components. --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 098eab3..d23183e 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ CMAKE=/usr/bin/cmake MESON=/usr/bin/meson # Paths for installed apps INCLUDE_SYS_PATH=/usr/include +# Components and libraries +COMPONENTS=hyprcursor Hyprland hyprlang hyprlock hyprpaper hyprutils \ + hyprwayland-scanner wl-clipboard tomlplusplus libxcb-errors # Set the default target to build .DEFAULT_GOAL := all @@ -106,7 +109,6 @@ $(__Wl_clipboard)/wl-copy $(__Wl_clipboard)/wl-paste &: ninja -C wl-clipboard/build ### PHONY targets that a user would run ### -.PHONY : all all: @if git submodule status | grep --quiet '^-' ; then\ echo "Git submodules have not been initialised. Please run: git \ @@ -115,10 +117,8 @@ submodule update --init --recursive" ; exit 1 ;\ @cd Hyprland/subprojects && git submodule update --init $(MAKE) build -.PHONY : build build: $(__Hyprlock) $(__Hyprpaper) $(__Wl_clipboard)/wl-copy $(__Hyprland) -.PHONY : install install: build @echo "Installing hyprlock..." sudo $(CMAKE) --install hyprlock/build @@ -129,8 +129,12 @@ install: build @echo "Installing Hyprland" sudo $(MAKE) -C Hyprland install - -.PHONY: test test: build @echo "Be real, you don't want to do this, so we'll abort." $(error No test-suite implemented) + +clean: + @echo "Cleaning up from build process..." + sudo rm -rf $(addsuffix /build, $(COMPONENTS)) >/dev/null 2>&1 + +.PHONY : all build install test