.PHONY: all clean combine prepare-combined copy-defs build build-combined
SRCS_DIR = ./src
SRCS = key-press.cpp layer-change.cpp init.cpp exit.cpp main.cpp send.cpp mouse-button.cpp
PREPAREDIR = out
OUTNAME = hyprshell.so
TARGET = $(OUTNAME)
HEADERS = globals.h handlers.h defs.h send.h
CXXFLAGS = -shared -fPIC --no-gnu-unique -std=c++2b -O2 -I/usr/include/pixman-1
prepare-combined: clean combine copy-defs
combine:
mkdir -p $(PREPAREDIR)
rm -f $(PREPAREDIR)/all.cpp
for src in $(SRCS); do \
printf "\n\n// $$src \n" >> $(PREPAREDIR)/all.cpp; \
cat $(SRCS_DIR)/$$src >> $(PREPAREDIR)/all.cpp; \
done
copy-defs:
for src in $(HEADERS); do \
cp $(SRCS_DIR)/$$src $(PREPAREDIR)/; \
done
build:
g++ $(CXXFLAGS) -o $(TARGET) $(SRCS_DIR)/*.cpp
test: build
Hyprland --config ./test-hyprland.conf
build-combined: prepare-combined
cp $(SRCS_DIR)/defs-test.h $(PREPAREDIR)/defs-test.h
g++ $(CXXFLAGS) -o $(TARGET) $(PREPAREDIR)/all.cpp
test-combined: build-combined
Hyprland --config ./test-hyprland.conf
clean:
rm -f $(TARGET)
rm -rf $(PREPAREDIR)