split-monitor-workspaces/Makefile

55 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2023-02-28 00:58:50 +01:00
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
2023-05-08 11:55:05 +02:00
COMPILE_FLAGS+=`pkg-config --cflags pixman-1 libdrm hyprland`
2023-04-25 15:34:49 +02:00
COMPILE_FLAGS+=-Iinclude
2023-04-27 16:52:00 +02:00
COMPILE_DEFINES=-DWLR_USE_UNSTABLE
2023-06-04 22:15:56 +02:00
INSTALL_LOCATION=${HOME}/.local/share/hyprload/plugins/bin
2023-04-27 16:52:00 +02:00
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
2023-06-04 22:15:56 +02:00
mkdir -p ${INSTALL_LOCATION}
cp $(PLUGIN_NAME).so ${INSTALL_LOCATION}
2023-02-28 00:58:50 +01:00
check_env:
2023-05-08 11:55:05 +02:00
@if pkg-config --exists hyprland; then \
echo 'Hyprland headers found.'; \
else \
echo 'Hyprland headers not available. Run `make pluginenv` in the root Hyprland directory.'; \
2023-04-27 16:52:00 +02:00
exit 1; \
fi
2023-05-08 11:55:05 +02:00
@if [ -z $(BUILT_WITH_NOXWAYLAND) ]; then \
echo 'Building with XWayland support.'; \
else \
echo 'Building without XWayland support.'; \
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:
2023-05-08 11:55:05 +02:00
echo "$(COMPILE_FLAGS) $(COMPILE_DEFINES)" | \
sed 's/--no-gnu-unique//g' | \
sed 's/ -/\n-/g' | \
sed 's/std=c++23/std=c++2b/g' \
> compile_flags.txt