-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (20 loc) · 710 Bytes
/
Makefile
File metadata and controls
29 lines (20 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
PLUGIN_NAME=device-windowrule
SOURCE_FILES := $(wildcard ./src/*.cpp ./src/*/*.cpp)
OBJECT_FILES := $(patsubst ./src/%.cpp, out/%.o, $(SOURCE_FILES))
CXX_FLAGS := -Wall --no-gnu-unique -fPIC -std=c++26 -g \
$(shell pkg-config --cflags hyprland pixman-1 libdrm | sed 's#-I\([^ ]*/hyprland\)\($$\| \)#-I\1 -I\1/src #g')
OUTPUT=out/$(PLUGIN_NAME).so
.PHONY: all clean load unload
all: $(OUTPUT)
$(OUTPUT): $(OBJECT_FILES)
$(CXX) -shared $^ -o $@
# Compile step (object file per .cpp)
out/%.o: ./src/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXX_FLAGS) -c $< -o $@
clean:
$(RM) $(OUTPUT) $(OBJECT_FILES)
load: all unload
hyprctl plugin load ${PWD}/$(OUTPUT)
unload:
hyprctl plugin unload ${PWD}/$(OUTPUT)