slige/runtime/Makefile

43 lines
759 B
Makefile
Raw Normal View History

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