2023-06-06 22:02:44 +00:00
|
|
|
# compile with `make all`
|
|
|
|
# make sure you've ran `make pluginenv` in the clonned Hyprland repo
|
2023-03-31 11:48:22 +00:00
|
|
|
|
|
|
|
PLUGIN_NAME=dwindle-autogroup
|
|
|
|
|
2023-06-06 22:00:04 +00:00
|
|
|
INSTALL_LOCATION=${HOME}/.local/share/hyprload/plugins/bin
|
|
|
|
|
2023-03-31 11:48:22 +00:00
|
|
|
SOURCE_FILES=$(wildcard src/*.cpp)
|
|
|
|
|
2023-07-23 16:16:30 +00:00
|
|
|
# Compiler/Linker flags
|
|
|
|
|
2023-06-06 22:32:58 +00:00
|
|
|
COMPILE_DEFINES=-DWLR_USE_UNSTABLE
|
|
|
|
|
2023-06-06 21:56:01 +00:00
|
|
|
COMPILE_FLAGS=-g -fPIC --no-gnu-unique -std=c++23
|
|
|
|
COMPILE_FLAGS+=`pkg-config --cflags pixman-1 libdrm hyprland`
|
|
|
|
COMPILE_FLAGS+=-Iinclude
|
|
|
|
|
|
|
|
LINK_FLAGS=-shared
|
|
|
|
|
2023-06-06 22:03:08 +00:00
|
|
|
# Phony targets (i.e. targets that don't actually build anything, and don't track dependencies)
|
|
|
|
# These will always be run when called
|
2023-07-23 16:16:30 +00:00
|
|
|
.PHONY: clean uninstall clangd
|
2023-03-31 11:48:22 +00:00
|
|
|
|
2023-07-23 16:16:30 +00:00
|
|
|
all:
|
2023-09-29 17:15:54 +00:00
|
|
|
$(MAKE) clear
|
2023-06-06 21:37:45 +00:00
|
|
|
@if ! pkg-config --exists hyprland; then \
|
|
|
|
echo 'Hyprland headers not available. Run `make pluginenv` in the root Hyprland directory.'; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2023-03-31 11:48:22 +00:00
|
|
|
|
2023-06-06 22:32:58 +00:00
|
|
|
g++ $(LINK_FLAGS) $(COMPILE_FLAGS) $(COMPILE_DEFINES) $(SOURCE_FILES) -o $(PLUGIN_NAME).so
|
2023-03-31 11:48:22 +00:00
|
|
|
|
2023-09-29 17:15:54 +00:00
|
|
|
install:
|
|
|
|
$(MAKE) all
|
2023-07-23 16:16:30 +00:00
|
|
|
mkdir -p $(INSTALL_LOCATION)
|
|
|
|
cp $(PLUGIN_NAME).so $(INSTALL_LOCATION)
|
|
|
|
|
|
|
|
uninstall:
|
2023-09-29 17:15:54 +00:00
|
|
|
rm -rf $(INSTALL_LOCATION)/$(PLUGIN_NAME).so
|
2023-07-23 16:16:30 +00:00
|
|
|
|
2023-09-29 17:15:54 +00:00
|
|
|
clear:
|
|
|
|
rm -f ./$(PLUGIN_NAME).so
|
2023-03-31 11:48:22 +00:00
|
|
|
|
|
|
|
clangd:
|
2023-06-06 22:32:58 +00:00
|
|
|
echo "$(COMPILE_FLAGS) $(COMPILE_DEFINES)" | \
|
2023-06-06 21:56:01 +00:00
|
|
|
sed 's/--no-gnu-unique//g' | \
|
|
|
|
sed 's/ -/\n-/g' | \
|
|
|
|
sed 's/std=c++23/std=c++2b/g' \
|
|
|
|
> compile_flags.txt
|