Files
RockOS/programs/makefile

24 lines
559 B
Makefile
Raw Normal View History

2026-06-16 18:44:31 -05:00
CC = i686-elf-gcc
LD = i686-elf-ld
CFLAGS = -ffreestanding -O2 -Wall -Wextra -ffunction-sections -fdata-sections -I../rocklibc/include
LDFLAGS = -m elf_i386 -nostdlib --gc-sections
2026-06-16 18:44:31 -05:00
TARGET = origin.elf
2026-06-16 18:44:31 -05:00
all: $(TARGET)
2026-06-16 18:44:31 -05:00
crt0.o: crt0.s
$(CC) $(CFLAGS) -c crt0.s -o crt0.o
main.o: main.c
$(CC) $(CFLAGS) -c main.c -o main.o
$(TARGET): crt0.o main.o ../rocklibc/rlibc.a
$(LD) $(LDFLAGS) -T linker.ld crt0.o main.o ../rocklibc/rlibc.a $(shell $(CC) -print-libgcc-file-name) -o $(TARGET)
cp $(TARGET) ../initrd
2026-06-16 18:44:31 -05:00
clean:
rm -f *.o $(TARGET)
.PHONY: all clean