Impl basic ws binary proto with data and execution state manipulation
This commit is contained in:
34
Makefile
34
Makefile
@@ -1,10 +1,12 @@
|
||||
OPENSSL_INCLUDE ?= /usr/include/openssl/
|
||||
BUILD_DIR=out
|
||||
SRC_DIR=src
|
||||
INC_DIR=inc
|
||||
CC=gcc
|
||||
OBJDUMP=objdump
|
||||
LIBS=deps/tomlc99/libtoml.a deps/ptQueue/out/ptQueue.a deps/wsServer/libws.a
|
||||
LIBS_HEADERS=deps/
|
||||
LIBS_HEADERS=deps/ $(OPENSSL_INCLUDE)
|
||||
STATIC_LIBS=crypto
|
||||
STANDART=c23
|
||||
OPTIMIZE=-Og
|
||||
TARGET=main
|
||||
@@ -12,38 +14,41 @@ TARGET=main
|
||||
|
||||
DEFINES=#-DOPCODE_WORDSIZE=2 -DMEM_CELL_WORDS=1 -DPC_WORDSIZE=2 -DGP_REG_CELL_WORDS=1 -DIO_REG_CELL_WORDS=1
|
||||
|
||||
C_SOURCES=$(wildcard $(SRC_DIR)/*.c)
|
||||
# C_SOURCES=$(wildcard $(SRC_DIR)/*.c)
|
||||
C_HEADERS=$(wildcard $(INC_DIR)/*.h)
|
||||
C_SOURCES := $(shell find $(SRC_DIR) -type f -name '*.c')
|
||||
|
||||
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
|
||||
DISABLE_FLAGS=-Wno-unused-variable -Wno-unused-parameter -Wno-write-strings -Wno-pointer-arith -Wno-analyzer-infinite-loop
|
||||
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) $(DEFINES) $(OPTIMIZE) --std=$(STANDART) $(PEDANTIC_FLAGS) $(ANALYZER_FLAGS)
|
||||
LFLAGS=$(OPTIMIZE) -g $(PEDANTIC_FLAGS) $(DEFINES) -flto -fuse-linker-plugin $(LSECTIONS) -lm
|
||||
CFLAGS=$(C_DEFS) -g $(C_INCLUDES) $(DEFINES) $(OPTIMIZE) --std=$(STANDART) $(PEDANTIC_FLAGS) $(ANALYZER_FLAGS) -MMD -MP
|
||||
STATICLIBS_FLAGS=$(addprefix -l,$(STATIC_LIBS))
|
||||
LFLAGS=$(OPTIMIZE) -g $(PEDANTIC_FLAGS) $(DEFINES) $(STATICLIBS_FLAGS) -flto -fuse-linker-plugin $(LSECTIONS) -lm
|
||||
|
||||
|
||||
|
||||
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) $(LIBS)
|
||||
OBJECTS = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES))
|
||||
|
||||
DEP = $(filter %.d, $(OBJECTS:.o=.d))
|
||||
$(info $(DEP))
|
||||
|
||||
OBJECTS += $(LIBS)
|
||||
vpath %.c $(sort $(dir $(C_SOURCES)))
|
||||
vpath %.h $(sort $(dir $(C_HEADERS)))
|
||||
|
||||
# $(info SOURCES=$(C_SOURCES))
|
||||
# $(info HEADERS=$(C_HEADERS))
|
||||
# $(info OBJECTS=$(OBJECTS))
|
||||
|
||||
|
||||
all: build
|
||||
|
||||
build: date deps Dir $(C_HEADERS) target compile_commands
|
||||
build: date deps Dir target compile_commands
|
||||
|
||||
rebuild: clean | build
|
||||
|
||||
$(info $(DEP))
|
||||
|
||||
-include $(DEP)
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
||||
@echo -e '\033[1;32mCC\t'$<'\t->\t'$@'\033[0m'
|
||||
@$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
|
||||
@@ -62,6 +67,7 @@ deps:
|
||||
|
||||
BuildDir:
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
$(shell mkdir -p $(dir $(OBJECTS)))
|
||||
|
||||
SrcDir:
|
||||
@mkdir -p $(SRC_DIR)
|
||||
|
||||
Reference in New Issue
Block a user