Updated Makefile

Added a clean recipe to remove all built components.
This commit is contained in:
Ethan Smith-Coss 2024-07-01 18:54:36 +01:00
parent 3f0a9b8514
commit b8f1af3173
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B

View File

@ -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