36 lines
939 B
Makefile
36 lines
939 B
Makefile
MAKEFLAGS := "-j $(shell nproc)" # still doesnt work tbh
|
|
|
|
# compiling with C++26
|
|
CXXFLAGS := -std=c++2c -fdiagnostics-color=always -Iinclude -lwebsockets -lz -Wall -Wextra -Wpedantic -Werror
|
|
CXXFLAGS += -MMD -MP
|
|
CXXFLAGS += -O2 -s
|
|
|
|
SOURCES := $(wildcard src/*.cpp) main.cpp
|
|
OBJECTS := $(SOURCES:.cpp=.o)
|
|
DEPS := $(OBJECTS:.o=.d)
|
|
|
|
# glowny target, linkuje linuxSmartie, potrzebuje ${OBJECTS}, jest na samej górze wiec jest domyslny
|
|
linuxSmartie: $(OBJECTS)
|
|
g++ $(CXXFLAGS) -o $@ $^
|
|
|
|
# kompiluje obiekty, potrzebuje zrodel cpp
|
|
%.o: %.cpp
|
|
g++ $(CXXFLAGS) -c $< -o $@
|
|
|
|
-include $(DEPS)
|
|
|
|
.PHONY: clean cleanobj install_service
|
|
|
|
cleanobj:
|
|
rm -f $(OBJECTS) $(DEPS) $(TEST_OBJS)
|
|
|
|
clean: cleanobj
|
|
rm -f linuxSmartie
|
|
|
|
install_service:
|
|
mkdir -p ~/.config/systemd/user
|
|
cp linuxSmartie.service ~/.config/systemd/user/linuxSmartie.service
|
|
systemctl --user daemon-reload
|
|
systemctl --user enable linuxSmartie
|
|
systemctl --user start linuxSmartie
|