This commit is contained in:
nub31
2025-06-26 15:15:01 +02:00
parent 812ecdf594
commit 105ac69b1c
5 changed files with 41 additions and 18 deletions

View File

@@ -1,15 +1,16 @@
CC = gcc
CC ?= x86_64-linux-gnu-gcc
TARGET ?= x64
CFLAGS = -nostdlib -ffreestanding -Wall -Werror -Wextra
x64: runtime.o x64.o
libruntime: out-int/runtime.o
$(CC) $(CFLAGS) -c targets/$(TARGET).s -o out-int/$(TARGET).o
mkdir -p out
ar rcs out/libruntime.a runtime.o x64.o
ar rcs out/libruntime_$(TARGET).a out-int/runtime.o out-int/$(TARGET).o
runtime.o: runtime/runtime.c
$(CC) $(CFLAGS) -c runtime/runtime.c -o runtime.o
x64.o: runtime.o platform/x64.s
$(CC) $(CFLAGS) -c platform/x64.s -o x64.o
out-int/runtime.o: runtime/runtime.c
mkdir -p out-int
$(CC) $(CFLAGS) -c runtime/runtime.c -o out-int/runtime.o
clean:
rm -r out runtime.o x64.o
rm -r out out-int