libstadium/Makefile

40 lines
1.4 KiB
Makefile
Raw Normal View History

2023-08-20 00:12:21 +05:30
# libstadium makefile
CC = g++
2023-08-25 08:59:29 +05:30
CFLAGS_DEFAULT = -march=native -std=c++23
CFLAGS_DEBUG = -ggdb -Wall -Werror -Wno-reorder -Wno-uninitialized -fanalyzer -Wno-analyzer-use-of-uninitialized-value
#CFLAGS_DEBUG_S = -O0 -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow
2023-08-25 09:56:23 +05:30
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
2023-08-20 00:12:21 +05:30
SOURCES = src/Stadium.hpp src/Stadium.cpp \
src/Event.hpp src/Event.cpp \
src/Worker.hpp src/Worker.cpp \
src/KLDR.hpp \
src/Utils.hpp
2023-08-20 00:12:21 +05:30
SOURCES_TEST = src/test.cpp
#LINKED_LIBS = -l
OUTPUT_LIB = libstadium.so
OUTPUT_TEST_BIN = libstadiumtest_release
#OUTPUT_TEST_BIN_S = libstadiumtest_sanitizer
2023-08-25 09:56:23 +05:30
OUTPUT_TEST_BIN_F = libstadiumtest_fortified
2023-08-20 00:12:21 +05:30
2023-08-25 08:59:29 +05:30
default: clean release_test
2023-08-20 00:12:21 +05:30
debug_test: $(SOURCES) $(SOURCES_TEST)
2023-08-25 09:56:23 +05:30
$(CC) $(CFLAGS_DEFAULT) $(CFLAGS_DEBUG) $(CFLAGS_DEBUG_F) $(SOURCES) $(SOURCES_TEST) -o $(OUTPUT_TEST_BIN_F)
2023-08-20 00:12:21 +05:30
debug: $(SOURCES)
echo "NYI"
release_test: $(SOURCES)
2023-08-25 08:59:29 +05:30
$(CC) $(CFLAGS_DEFAULT) $(CFLAGS_RELEASE) $(SOURCES) $(SOURCES_TEST) -o $(OUTPUT_TEST_BIN)
2023-08-20 00:12:21 +05:30
release: $(SOURCES)
echo "NYI"
clean:
rm -f $(OUTPUT_LIB) $(OUTPUT_TEST_BIN_F) $(OUTPUT_TEST_BIN)