build system refresh

This commit is contained in:
2026-07-16 16:09:12 -05:00
parent b588634253
commit 3246dbbd19
49 changed files with 185 additions and 203 deletions

View File

@@ -1,10 +1,14 @@
CC = i686-elf-gcc
LD = i686-elf-ld
CFLAGS = -ffreestanding -O2 -Wall -Wextra -I../../rocklibc/include
SYSROOT = ../sysroot
USR_INCLUDE = $(SYSROOT)/usr/include
USR_LIB = $(SYSROOT)/usr/lib
CFLAGS = -ffreestanding -O2 -Wall -Wextra -I$(USR_INCLUDE)
LDFLAGS = -m elf_i386 -nostdlib
TARGET = rocksh.elf
TARGET = rocksh
all: $(TARGET)
@@ -14,11 +18,12 @@ crt0.o: crt0.S
main.o: main.c
$(CC) $(CFLAGS) -c main.c -o main.o
$(TARGET): crt0.o main.o ../lib/rlibc.a
$(LD) $(LDFLAGS) -T linker.ld crt0.o main.o ../lib/rlibc.a -o $(TARGET)
$(TARGET): crt0.o main.o $(USR_LIB)/*
$(LD) $(LDFLAGS) -T linker.ld crt0.o main.o $(USR_LIB)/* -o $(TARGET)
cp $(TARGET) $(SYSROOT)/usr/bin
clean:
rm -f *.o $(TARGET) compile_commands.json
rm -f *.o $(TARGET) compile_commands.json
rm -rf .cache
.PHONY: all clean test