change queues, run exec speed optimizations
This commit is contained in:
32
Makefile
32
Makefile
@@ -4,14 +4,15 @@ SRC_DIR=src
|
||||
INC_DIR=inc
|
||||
CC=gcc
|
||||
OBJDUMP=objdump
|
||||
LIBS=deps/ptQueue/out/ptQueue.a deps/wsServer/libws.a deps/flatcc/lib/libflatccrt.a
|
||||
LIBS=deps/wsServer/libws.a deps/flatcc/lib/libflatccrt.a
|
||||
LIBS_HEADERS=deps/ $(OPENSSL_INCLUDE)
|
||||
# flatcc runtime and generated reader headers use const-dropping casts;
|
||||
# include both as system headers so -Wcast-qual doesn't apply to them
|
||||
SYSTEM_INCLUDES=-isystem deps/flatcc/include/ -isystem $(PROTO_INC_DIR)/
|
||||
STATIC_LIBS=crypto
|
||||
STANDART=c23
|
||||
OPTIMIZE=-Og
|
||||
# OPTIMIZE=-Og #3 -march=native
|
||||
OPTIMIZE=-O3 -march=native
|
||||
TARGET=main
|
||||
|
||||
FLATCC = deps/flatcc/bin/flatcc
|
||||
@@ -34,14 +35,16 @@ C_INCLUDES=-I$(INC_DIR)/ $(addprefix -I,$(LIBS_HEADERS))
|
||||
|
||||
C_DEFS=-D_POSIX_C_SOURCE=199309L
|
||||
|
||||
DISABLE_FLAGS=-Wno-unused-variable -Wno-unused-parameter -Wno-write-strings -Wno-pointer-arith -Wno-analyzer-infinite-loop
|
||||
DISABLE_FLAGS=-Wno-unused-variable -Wno-unused-parameter -Wno-write-strings -Wno-pointer-arith -Wno-analyzer-infinite-loop -Wno-unused-function -Wno-unused-but-set-variable
|
||||
PEDANTIC_FLAGS=-pedantic -pedantic-errors $(DISABLE_FLAGS) -Wall -Wcast-align -Wcast-qual -Wconversion -Wduplicated-branches -Wduplicated-cond -Werror -Wextra -Wfloat-equal -Wlogical-op -Wpedantic -Wredundant-decls -Wsign-conversion
|
||||
ANALYZER_FLAGS=-fanalyzer -fdiagnostics-show-option -fdiagnostics-color=always
|
||||
LSECTIONS=-ffunction-sections -fdata-sections -Wl,--gc-sections
|
||||
CFLAGS=$(C_DEFS) -g $(C_INCLUDES) $(SYSTEM_INCLUDES) $(DEFINES) $(OPTIMIZE) --std=$(STANDART) $(PEDANTIC_FLAGS) $(ANALYZER_FLAGS) -MMD -MP # -fno-omit-frame-pointer -fno-inline -fno-lto
|
||||
# CFLAGS=$(C_DEFS) -g -pthread $(C_INCLUDES) $(SYSTEM_INCLUDES) $(DEFINES) $(OPTIMIZE) --std=$(STANDART) $(PEDANTIC_FLAGS) $(ANALYZER_FLAGS) -MMD -MP -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline # -fno-omit-frame-pointer -fno-inline -fno-lto
|
||||
CFLAGS=$(C_DEFS) -g -pthread $(C_INCLUDES) $(SYSTEM_INCLUDES) $(DEFINES) $(OPTIMIZE) --std=$(STANDART) $(PEDANTIC_FLAGS) $(ANALYZER_FLAGS) -MMD -MP # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline # -fno-omit-frame-pointer -fno-inline -fno-lto
|
||||
STATICLIBS_FLAGS=$(addprefix -l,$(STATIC_LIBS))
|
||||
# LFLAGS=$(OPTIMIZE) -g $(PEDANTIC_FLAGS) $(DEFINES) $(STATICLIBS_FLAGS) $(LSECTIONS) -lm -fno-omit-frame-pointer -fno-inline -fno-lto
|
||||
LFLAGS=$(OPTIMIZE) -g $(PEDANTIC_FLAGS) $(DEFINES) $(STATICLIBS_FLAGS) -flto -fuse-linker-plugin $(LSECTIONS) -lm -fno-omit-frame-pointer -fno-inline
|
||||
# LFLAGS=$(OPTIMIZE) -g -pthread $(PEDANTIC_FLAGS) $(DEFINES) $(STATICLIBS_FLAGS) $(LSECTIONS) -lm -fno-omit-frame-pointer -fno-inline -fno-lto
|
||||
# LFLAGS=$(OPTIMIZE) -g -pthread $(PEDANTIC_FLAGS) $(DEFINES) $(STATICLIBS_FLAGS) -fuse-linker-plugin $(LSECTIONS) -lm -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fno-omit-frame-pointer -fno-inline -flto -lgcov # -fno-omit-frame-pointer -fno-inline # #-fprofile-generate # -flto
|
||||
LFLAGS=$(OPTIMIZE) -g -pthread $(PEDANTIC_FLAGS) $(DEFINES) $(STATICLIBS_FLAGS) -fuse-linker-plugin $(LSECTIONS) -lm # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fprofile-use # -fprofile-generate -fprofile-arcs -ftest-coverage # -fno-omit-frame-pointer -fno-inline -fno-lto # -fno-omit-frame-pointer -fno-inline -flto -lgcov # -fno-omit-frame-pointer -fno-inline # #-fprofile-generate # -flto
|
||||
|
||||
|
||||
|
||||
@@ -53,10 +56,18 @@ DEP = $(filter %.d, $(OBJECTS:.o=.d))
|
||||
OBJECTS += $(LIBS)
|
||||
vpath %.c $(sort $(dir $(C_SOURCES)))
|
||||
|
||||
# asan: CFLAGS := $(filter-out -fanalyzer,$(CFLAGS)) -fsanitize=address,undefined
|
||||
# asan: LFLAGS := $(filter-out -flto -fuse-linker-plugin,$(LFLAGS)) -fsanitize=address,undefined
|
||||
# asan: build
|
||||
|
||||
# tsan: CFLAGS := $(filter-out -fanalyzer,$(CFLAGS)) -fsanitize=thread
|
||||
# tsan: LFLAGS := $(filter-out -flto -fuse-linker-plugin,$(LFLAGS)) -fsanitize=thread
|
||||
# tsan: build
|
||||
|
||||
|
||||
all: build
|
||||
|
||||
build: date deps Dir proto python-proto target compile_commands
|
||||
build: date deps Dir proto python-proto target
|
||||
|
||||
rebuild: clean | build
|
||||
|
||||
@@ -121,10 +132,10 @@ $(FLATC):
|
||||
@$(MAKE) -C deps flatbuffers/build/flatc
|
||||
|
||||
|
||||
.PHONY: clean deps proto python-proto
|
||||
.PHONY: clean deps proto python-proto asan tsan clean
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILD_DIR)/* $(BUILD_DIR)/.* $(PROTO_INC_DIR)/* $(PROTO_SRC_DIR)/*
|
||||
# @rm -f compile_commands.json
|
||||
@echo -e '\033[0;31mCleaned\033[0m'
|
||||
|
||||
.NOTPARALLEL: date target rebuild deps proto
|
||||
@@ -133,6 +144,3 @@ date:
|
||||
@date
|
||||
@echo -e '\033[0m'
|
||||
|
||||
|
||||
compile_commands:
|
||||
# @bear -- ./.gen_compile_commands.sh $(TARGET) $(CC) "$(CFLAGS)" "$(LFLAGS)" "$(OBJECTS)"
|
||||
|
||||
Reference in New Issue
Block a user