2024-11-08 12:22:42 +01:00
|
|
|
|
2024-12-13 16:03:01 +01:00
|
|
|
|
|
|
|
|
2024-12-13 20:05:27 +01:00
|
|
|
MAKEFLAGS := --jobs=$(shell nproc)
|
|
|
|
|
|
|
|
RELEASE=0
|
|
|
|
|
|
|
|
ifeq ($(RELEASE),1)
|
|
|
|
|
|
|
|
CXX_FLAGS = \
|
|
|
|
-std=c++23 \
|
2024-12-15 04:24:07 +01:00
|
|
|
-O3 \
|
2024-12-16 14:37:24 +01:00
|
|
|
-static -static-libgcc -static-libstdc++ \
|
2024-12-13 20:05:27 +01:00
|
|
|
-pedantic -pedantic-errors \
|
|
|
|
-Wall -Wextra -Wpedantic -Wconversion -Werror\
|
|
|
|
|
|
|
|
else
|
|
|
|
|
2024-11-08 12:22:42 +01:00
|
|
|
CXX_FLAGS = \
|
2024-11-18 12:35:38 +01:00
|
|
|
-std=c++23 \
|
2024-11-08 12:22:42 +01:00
|
|
|
-fsanitize=address,undefined \
|
2024-12-13 16:03:01 +01:00
|
|
|
-Og \
|
2024-11-08 12:22:42 +01:00
|
|
|
-pedantic -pedantic-errors \
|
2024-12-13 20:05:27 +01:00
|
|
|
-Wall -Wextra -Wpedantic -Wconversion -Werror\
|
|
|
|
|
|
|
|
endif
|
2024-12-13 16:03:01 +01:00
|
|
|
|
2024-12-13 20:05:27 +01:00
|
|
|
CXX = g++
|
2024-11-08 12:22:42 +01:00
|
|
|
|
|
|
|
OUT=build/sliger
|
|
|
|
|
2024-11-19 05:06:27 +01:00
|
|
|
CXX_HEADERS = $(shell find . -name "*.hpp" -type f -printf '%P\n')
|
2024-11-08 12:22:42 +01:00
|
|
|
|
2024-11-19 05:06:27 +01:00
|
|
|
CXX_SOURCES = $(shell find . -name "*.cpp" -type f -printf '%P\n')
|
2024-11-08 12:22:42 +01:00
|
|
|
|
|
|
|
CXX_OBJECTS = $(patsubst %.cpp,build/%.o,$(CXX_SOURCES))
|
|
|
|
|
|
|
|
all: build_dir $(OUT)
|
|
|
|
|
|
|
|
$(OUT): $(CXX_OBJECTS)
|
2024-12-12 10:17:09 +01:00
|
|
|
$(CXX) -o $@ $(CXX_FLAGS) $^
|
2024-11-08 12:22:42 +01:00
|
|
|
|
|
|
|
build_dir:
|
|
|
|
mkdir -p build/
|
|
|
|
|
|
|
|
build/%.o: %.cpp $(CXX_HEADERS)
|
2024-12-12 10:17:09 +01:00
|
|
|
$(CXX) -c -o $@ $(CXX_FLAGS) $<
|
2024-11-08 12:22:42 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build/
|
|
|
|
|