-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.08 KB
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CXX ?= c++
CXXFLAGS ?= -march=native -pipe -fno-plt
CXXFLAGS += -Wall -Wextra -std=c++23 -fPIC -fno-gnu-unique
LDFLAGS ?=
LDFLAGS += -shared -fno-gnu-unique
INCLUDES = $(shell pkg-config --cflags-only-I hyprland pixman-1 libdrm)
CXXFLAGS += -DWLR_USE_UNSTABLE
# `pkg-config` some how fails to provide the correct path to wlr headers.
INCLUDES += -I/usr/include/hyprland/wlroots-hyprland
ifdef DEBUG
CXXFLAGS += -Og -g
else
CXXFLAGS += -O3 -DNDEBUG
endif
SRCDIR = src
BINDIR ?= build
TARGET = hypaper.so
SRC = $(wildcard $(SRCDIR)/*.cc)
OBJ = $(patsubst $(SRCDIR)/%.cc,$(BINDIR)/%.o,$(SRC))
OUT = $(BINDIR)/$(TARGET)
all: $(OUT)
.PHONY: debug
debug:
make DEBUG=1
$(BINDIR):
[ -d "$@" ] || mkdir "$@"
$(OUT): $(OBJ)
$(CXX) $(LDFLAGS) $^ -o $@
$(BINDIR)/%.o: $(SRCDIR)/%.cc | $(BINDIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
.PHONY: clean
clean:
rm $(OUT) $(OBJ)
.PNONY: plugin-load plugin-unload plugin-layout
plugin-load: $(OUT)
hyprctl plugin load $(abspath $(OUT))
plugin-unload: $(OUT)
hyprctl plugin unload $(abspath $(OUT))
plugin-layout:
hyprctl keyword general:layout paper