File utilities and datatype implementation for a C-based code generator (#5)

Co-authored-by: Abdelrahman Said <said.abdelrahman@flawlessai.com>
Reviewed-on: #5
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit is contained in:
2025-09-20 13:48:08 +00:00
committed by Abdelrahman Said
parent 09e96f8112
commit 14bd6ce5fd
52 changed files with 3814 additions and 944 deletions

View File

@@ -1,3 +1,5 @@
.PHONY: help full prng testing uuid core primitives all clean builddir build-test run-test codegen install build-lib ccodegen
# External variables
CC = clang
CXX = clang++
@@ -29,11 +31,11 @@ override LIB_INSTALL := $(ABS_INSTALL_PREFIX)/lib
override HEADER_INSTALL_CMD := scripts/header_install.sh
ifeq ($(BUILD_TYPE),Debug)
CFLAGS += -g -fsanitize=address,undefined -DWAPP_DEBUG_ASSERT
override CFLAGS += -g -fsanitize=address,undefined -DWAPP_DEBUG_ASSERT
else ifeq ($(BUILD_TYPE),RelWithDebInfo)
CFLAGS += -g -O2 -fsanitize=address,undefined -DWAPP_DEBUG_ASSERT
override CFLAGS += -g -O2 -fsanitize=address,undefined -DWAPP_DEBUG_ASSERT
else ifeq ($(BUILD_TYPE),Release)
CFLAGS += -O3
override CFLAGS += -O3
else
$(error Invalid BUILD type '$(BUILD_TYPE)'. Use 'Debug', 'RelWithDebInfo' or 'Release')
endif
@@ -43,8 +45,6 @@ ifeq ($(CC),gcc)
export ASAN_OPTIONS=verify_asan_link_order=0
endif
.PHONY: help full prng testing uuid core primitives all clean builddir build-test run-test codegen install build-lib
all: clean builddir codegen run-c-test full run-cc-test
help:
@@ -126,3 +126,6 @@ build-lib: builddir
$(CC) -c $(CSTD) $(CFLAGS) $(LIBFLAGS) $(LIB_SRC) -o $(OBJ_OUT)
$(AR) r $(LIB_OUT) $(OBJ_OUT)
@rm $(OBJ_OUT)
ccodegen:
$(CC) $(CSTD) $(CFLAGS) $(LIBFLAGS) -Isrc/core src/core/wapp_core.c ccodegen/*.c -o ccgen