initial commit

This commit is contained in:
Matheus
2023-04-08 01:11:30 -03:00
commit df84704797
29 changed files with 1646 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
CSOURCES= $(shell find -name *.c)
ASMSOURCES= $(shell find -name *.asm)
OBJS=$(CSOURCES:.c=.o) $(ASMSOURCES:.asm=.asmo)
TARGET=x86-64
INCDIR=$(shell pwd)/include
ARCHDIR=$(shell pwd)/arch/$(TARGET)/
LDFLAGS=-ffreestanding -nostdlib -lgcc -Wl,-T,"$(ARCHDIR)/kernel.ld" -debug
CFLAGS=-ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -nostdlib -nostdinc -I "${INCDIR}"
ASFLAGS=-felf64
astral: $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.asmo: %.asm
nasm $(ASFLAGS) -o $@ $<