initial commit

This commit is contained in:
wt
2025-11-17 16:41:34 +07:00
commit 6d39a0c3b0
16 changed files with 33718 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
CC = gcc
CFLAGS = -Wall -g -std=gnu2x -ffunction-sections -fdata-sections
# -DMG_TLS=MG_TLS_OPENSSL
LDFLAGS =
INCLUDES = -I./src/lib -I./src
SRCS = $(wildcard src/lib/*.c src/file_db/*.c src/*.c src/config/*.c src/database/*.c src/api/*.c src/security/*.c src/utils/*.c)
OBJS = $(SRCS:.c=.o)
TARGET = wterm
BUILD_DIR=./build
CROSS_COMPILE =
LIBS = -lpthread
# -lcrypto -lssl
USE_SQLITE3 ?= 0
WERROR ?= 0
ifeq ($(shell uname), Linux)
LDFLAGS += -Wl,--gc-sections
endif
ifeq ($(WERROR), 1)
CFLAGS += -Werror
endif
all: $(TARGET)
$(TARGET): $(OBJS)
$(CROSS_COMPILE)$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
%.o: %.c
$(CROSS_COMPILE)$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
rm -f $(OBJS) $(TARGET) $(shell find . -type f -name '*.log')
test: $(TARGET)
bash ./tests.sh