chore: parallelize build

This commit is contained in:
Familex 2025-07-19 02:05:14 +03:00
commit f2a35be02b
Failed to generate hash of commit
2 changed files with 16 additions and 6 deletions

View file

@ -1,18 +1,27 @@
PLUGIN_NAME=dynamic-cursors
SOURCE_FILES=$(wildcard ./src/*.cpp ./src/*/*.cpp)
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 | awk '{print $$NF "/src";}') \
$(shell pkg-config --cflags pixman-1 libdrm hyprland)
OUTPUT=out/$(PLUGIN_NAME).so
.PHONY: all clean load unload
all: $(OUTPUT)
$(OUTPUT): $(SOURCE_FILES)
mkdir -p out
$(CXX) -shared -Wall --no-gnu-unique -fPIC $(SOURCE_FILES) -g `pkg-config --cflags hyprland | awk '{print $$NF "/src";}'` `pkg-config --cflags pixman-1 libdrm hyprland` -std=c++26 -o $(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 -f $(OUTPUT)
$(RM) $(OUTPUT) $(OBJECT_FILES)
load: all unload
hyprctl plugin load ${PWD}/$(OUTPUT)