-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (29 loc) · 1021 Bytes
/
Copy pathMakefile
File metadata and controls
47 lines (29 loc) · 1021 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
CXX = g++
CXXFLAGS = -fPIC --no-gnu-unique -Isrc/ -g -std=c++2b
SRC_DIR = src
OBJ_DIR = out/obj
OUT_DIR = out
SRCS = $(wildcard $(SRC_DIR)/*.cpp)
OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS))
DEPS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.d, $(SRCS))
INCLUDES = $(shell pkg-config --cflags pixman-1 libdrm hyprland hyprlang)
TARGET = $(OUT_DIR)/hypr-darkwindow.so
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) -shared $^ -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)/%.d | $(OBJ_DIR)
$(CXX) $(INCLUDES) $(CXXFLAGS) -MT $@ -MMD -MP -MF $(OBJ_DIR)/$*.d -c $< -o $@
$(OBJ_DIR):
@mkdir -p $@
$(DEPS):
include $(wildcard $(DEPS))
clean:
rm -rf $(OUT_DIR)
load: unload $(TARGET)
hyprctl plugin load $(shell pwd)/$(TARGET)
unload:
hyprctl plugin unload $(shell pwd)/$(TARGET)
VSC_CONF = .vscode/c_cpp_properties.json
vscode:
cat <<< $$(jq '.configurations[].includePath = ("$(INCLUDES)"|gsub("(^|(?<= ))-I";"")|split(" "))' $(VSC_CONF)) > $(VSC_CONF)
.PHONY: all vscode clean load unload