2024-11-08 11:22:42 +00:00
|
|
|
|
|
|
|
CXX_FLAGS = \
|
2024-11-18 11:35:38 +00:00
|
|
|
-std=c++23 \
|
2024-11-08 11:22:42 +00:00
|
|
|
-Og \
|
|
|
|
-fsanitize=address,undefined \
|
|
|
|
-pedantic -pedantic-errors \
|
|
|
|
-Wall -Wextra -Wpedantic -Wconversion \
|
|
|
|
|
|
|
|
OUT=build/sliger
|
|
|
|
|
2024-11-19 04:06:27 +00:00
|
|
|
CXX_HEADERS = $(shell find . -name "*.hpp" -type f -printf '%P\n')
|
2024-11-08 11:22:42 +00:00
|
|
|
|
2024-11-19 04:06:27 +00:00
|
|
|
CXX_SOURCES = $(shell find . -name "*.cpp" -type f -printf '%P\n')
|
2024-11-08 11:22:42 +00:00
|
|
|
|
|
|
|
CXX_OBJECTS = $(patsubst %.cpp,build/%.o,$(CXX_SOURCES))
|
|
|
|
|
|
|
|
all: build_dir $(OUT)
|
|
|
|
|
|
|
|
$(OUT): $(CXX_OBJECTS)
|
|
|
|
g++ -o $@ $(CXX_FLAGS) $^
|
|
|
|
|
|
|
|
build_dir:
|
|
|
|
mkdir -p build/
|
|
|
|
|
|
|
|
build/%.o: %.cpp $(CXX_HEADERS)
|
|
|
|
g++ -c -o $@ $(CXX_FLAGS) $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build/
|
|
|
|
|