split-monitor-workspaces/Makefile

50 lines
1.5 KiB
Makefile
Raw Normal View History

2023-02-28 00:58:50 +01:00
# compile with HYPRLAND_HEADERS=<path_to_hl> make all
# make sure that the path above is to the root hl repo directory, NOT src/
# and that you have ran `make protocols` in the hl dir.
PLUGIN_NAME=split-monitor-workspaces
SOURCE_FILES=$(wildcard src/*.cpp)
2023-04-25 15:34:49 +02:00
COMPILE_FLAGS=-g -fPIC --no-gnu-unique -std=c++23
COMPILE_FLAGS+=-I "/usr/include/pixman-1"
COMPILE_FLAGS+=-I "/usr/include/libdrm"
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}"
2023-04-27 16:52:00 +02:00
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}/protocols"
2023-04-25 15:34:49 +02:00
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}/subprojects/wlroots/include"
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}/subprojects/wlroots/build/include"
COMPILE_FLAGS+=-Iinclude
2023-04-27 16:52:00 +02:00
COMPILE_DEFINES=-DWLR_USE_UNSTABLE
ifeq ($(shell whereis -b jq), "jq:")
$(error "jq not found. Please install jq.")
else
BUILT_WITH_NOXWAYLAND=$(shell hyprctl version -j | jq -r '.flags | .[]' | grep 'no xwayland')
ifneq ($(BUILT_WITH_NOXWAYLAND),)
COMPILE_DEFINES+=-DNO_XWAYLAND
endif
endif
2023-02-28 00:58:50 +01:00
.PHONY: clean clangd
all: check_env $(PLUGIN_NAME).so
install: all
cp $(PLUGIN_NAME).so ${HOME}/.local/share/hyprload/plugins/bin
check_env:
2023-04-27 16:52:00 +02:00
@if [ -z "${HYPRLAND_HEADERS}" ]; then \
echo "HYPRLAND_HEADERS not set. Please set it to the root of the hl repo directory."; \
exit 1; \
fi
2023-02-28 00:58:50 +01:00
$(PLUGIN_NAME).so: $(SOURCE_FILES) $(INCLUDE_FILES)
2023-04-27 16:52:00 +02:00
g++ -shared $(COMPILE_FLAGS) $(COMPILE_DEFINES) $(SOURCE_FILES) -o $(PLUGIN_NAME).so
2023-02-28 00:58:50 +01:00
clean:
2023-04-03 12:12:43 +02:00
rm -f ./$(PLUGIN_NAME).so
2023-02-28 00:58:50 +01:00
clangd:
printf "%b" "-I/usr/include/pixman-1\n-I/usr/include/libdrm\n-I${HYPRLAND_HEADERS}\n-Iinclude\n-std=c++2b" > compile_flags.txt