slige/runtime/Makefile

43 lines
759 B
Makefile
Raw Normal View History

2024-11-08 12:22:42 +01:00
2024-12-13 16:03:01 +01:00
# CXX_FLAGS = \
# -std=c++23 \
# -Og \
# -fsanitize=address,undefined \
# -pedantic -pedantic-errors \
# -Wall -Wextra -Wpedantic -Wconversion -Werror \
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 16:03:01 +01:00
-Wall -Wextra -Wpedantic -Wconversion -Werror \
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))
2024-12-12 10:17:09 +01:00
CXX = g++
2024-11-08 12:22:42 +01:00
all: build_dir $(OUT)
$(OUT): $(CXX_OBJECTS)
2024-12-12 10:17:09 +01:00
$(CXX) -o $@ $(CXX_FLAGS) $^
2024-12-13 13:16:03 +01:00
git rev-parse HEAD > build/rev
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/