libstadium/Makefile
2023-08-25 07:26:23 +03:00

37 lines
1.3 KiB
Makefile

# libstadium makefile
CC = g++
CFLAGS_DEFAULT = -march=native -std=c++23
CFLAGS_DEBUG = -Wall -Werror -Wno-uninitialized -Wno-analyzer-use-of-uninitialized-value -fanalyzer -ggdb
CFLAGS_DEBUG_S = -O0 -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow
CFLAGS_DEBUG_F = -O1 -D_FORTIFY_SOURCE=3
CFLAGS_RELEASE = -static-libgcc -static-libstdc++ -static -Ofast -fdevirtualize-speculatively -fdata-sections -ffunction-sections -Wl,-gc-sections -Wl,-strip-all -Wl,-strip-discarded -flto -s -D_FORTIFY_SOURCE=3
SOURCES = src/stadium.hpp src/stadium.cpp src/kldr.hpp
SOURCES_TEST = src/test.cpp
#LINKED_LIBS = -l
OUTPUT_LIB = libstadium.so
OUTPUT_TEST_BIN_S = libstadiumtest_sanitizer
OUTPUT_TEST_BIN_F = libstadiumtest_fortified
default: clean release_test
debug_test: $(SOURCES) $(SOURCES_TEST)
$(CC) $(CFLAGS_DEFAULT) $(CFLAGS_DEBUG) $(CFLAGS_DEBUG_S) $(SOURCES) $(SOURCES_TEST) -o $(OUTPUT_TEST_BIN_S)
$(CC) $(CFLAGS_DEFAULT) $(CFLAGS_DEBUG) $(CFLAGS_DEBUG_F) $(SOURCES) $(SOURCES_TEST) -o $(OUTPUT_TEST_BIN_F)
#$(LINKED_LIBS)
debug: $(SOURCES)
echo "NYI"
release_test: $(SOURCES)
$(CC) $(CFLAGS_DEFAULT) $(CFLAGS_RELEASE) $(SOURCES) $(SOURCES_TEST) -o $(OUTPUT_TEST_BIN)
release: $(SOURCES)
echo "NYI"
clean:
rm -f $(OUTPUT_LIB) $(OUTPUT_TEST_BIN_S) $(OUTPUT_TEST_BIN_F)