include c std lib

This commit is contained in:
nub31
2025-06-29 15:50:06 +02:00
parent 058853ef02
commit 5bc222c672
3 changed files with 5 additions and 3 deletions

View File

@@ -1,8 +1,10 @@
CFLAGS = -Wall -Werror -Wextra -g
OBJECTS := $(shell dotnet run --project ../src/compiler/CLI/CLI.csproj src/main.nub src/c.nub)
example:
mkdir -p bin
gcc -o bin/out $(OBJECTS)
gcc $(CFLAGS) -o bin/out lib/libruntime_x64.a $(OBJECTS)
clean:
rm -r bin bin-int

View File

@@ -1,4 +1,4 @@
namespace c
extern func printf(fmt: cstring, arg: u64): void
// extern func printf(fmt: cstring, arg: u64): void
extern func puts(fmt: cstring)

View File

@@ -1,7 +1,7 @@
CC ?= x86_64-linux-gnu-gcc
TARGET ?= x64
CFLAGS = -nostdlib -ffreestanding -Wall -Werror -Wextra -g
CFLAGS = -Wall -Werror -Wextra -g
libruntime: bin-int/runtime.o
$(CC) $(CFLAGS) -c targets/$(TARGET).s -o bin-int/$(TARGET).o