add backend

This commit is contained in:
SimonFJ20 2026-03-20 12:34:55 +01:00
parent 08d89e0103
commit c1f4f75fec
5 changed files with 66 additions and 0 deletions

15
backend/.clang-format Normal file
View File

@ -0,0 +1,15 @@
BasedOnStyle: WebKit
IndentWidth: 4
ColumnLimit: 80
IndentCaseLabels: true
InsertNewlineAtEOF: true
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
BinPackLongBracedList: false
BinPackParameters: OnePerLine
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true

1
backend/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

36
backend/Makefile Normal file
View File

@ -0,0 +1,36 @@
MAKEFLAGS += -j16
CC=gcc
LD=gcc
CFLAGS=-std=c23 -pedantic-errors -Wall -Wextra -Wconversion
LDFLAGS=
CFLAGS+=-g
# CFLAGS+=-ggdb
CFLAGS+=-fsanitize=address
build_dir = build
obj_dir = $(build_dir)/obj
sources = \
src/main.c
target=$(build_dir)/backend
all: $(target)
$(target): $(sources:%.c=$(obj_dir)/%.o)
$(LD) -o $@ $(CFLAGS) $(LDFLAGS) $^
$(obj_dir)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) $< -c -o $@ -MMD -MP $(CFLAGS)
clean:
rm -rf $(build_dir)
-include $(sources:%.c=$(obj_dir)/%.d)

View File

@ -0,0 +1,7 @@
-xc
-std=c23
-pedantic-errors
-Wall
-Wextra
-Wconversion

7
backend/src/main.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main(void)
{
printf("hello\n");
}