Updated libc

This commit is contained in:
Alex
2022-12-07 13:53:08 +02:00
parent bc92258a5f
commit 2b57c3126a
28 changed files with 360 additions and 65 deletions

View File

@ -2,12 +2,13 @@
include ../../../Makefile.conf
CC = ../../../$(COMPILER_PATH)/$(COMPILER_ARCH)gcc
AS = ../../../$(COMPILER_PATH)/$(COMPILER_ARCH)as
NASM = /usr/bin/nasm
C_SOURCES = $(shell find ./ -type f -name '*.c')
S_SOURCES = $(shell find ./ -type f -name '*.s')
S_SOURCES = $(shell find ./ -type f -name '*.S')
ASM_SOURCES = $(shell find ./ -type f -name '*.asm')
OBJ = ${C_SOURCES:.c=.o} ${ASM_SOURCES:.asm=.o} ${S_SOURCES:.s=.o}
OBJ = ${C_SOURCES:.c=.o} ${ASM_SOURCES:.asm=.o} ${S_SOURCES:.S=.o}
ifeq ($(OSARCH), amd64)
ASM_ARCH := elf64
@ -19,13 +20,13 @@ build: $(OBJ)
mv $^ ../../out/system/lib/
%.o: %.c
$(CC) -nostdlib -std=c17 -c $< -o $@
$(CC) -nostdlib -mno-red-zone -std=c17 -c $< -o $@
%.o: %.asm
$(NASM) $< -f $(ASM_ARCH) -o $@
%.bin: %.s
$(NASM) $< -f $(ASM_ARCH) -o $@
%.o: %.S
$(AS) -c $< -o $@
clean: