slige/runtime/Makefile

52 lines
806 B
Makefile
Raw Normal View History

2024-11-08 11:22:42 +00:00
2024-12-13 15:03:01 +00:00
2024-12-13 19:05:27 +00:00
MAKEFLAGS := --jobs=$(shell nproc)
RELEASE=0
ifeq ($(RELEASE),1)
CXX_FLAGS = \
-std=c++23 \
2024-12-15 03:24:07 +00:00
-O3 \
2024-12-16 13:37:24 +00:00
-static -static-libgcc -static-libstdc++ \
2024-12-13 19:05:27 +00:00
-pedantic -pedantic-errors \
-Wall -Wextra -Wpedantic -Wconversion -Werror\
else
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 19:05:27 +00:00
-Wall -Wextra -Wpedantic -Wconversion -Werror\
endif
2024-12-13 15:03:01 +00:00
2024-12-13 19:05:27 +00:00
CXX = g++
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))
all: build_dir $(OUT)
$(OUT): $(CXX_OBJECTS)
2024-12-12 09:17:09 +00:00
$(CXX) -o $@ $(CXX_FLAGS) $^
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/