aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libc/Makefile')
-rw-r--r--libs/libc/Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/libc/Makefile b/libs/libc/Makefile
index 24970d8..cc1b836 100644
--- a/libs/libc/Makefile
+++ b/libs/libc/Makefile
@@ -1,7 +1,8 @@
# MIT License, Copyright (c) 2020 Marvin Borner
# TODO: Remove cpu from libc?
-COBJS = sanitize.o \
+COBJS = crt/crt0.o \
+ sanitize.o \
errno.o \
str.o \
alloc.o \
@@ -26,11 +27,12 @@ ASFLAGS = -f elf32
%.o: %.c
@$(CC) -c $(CFLAGS) $< -o $@
-libc: CFLAGS += -DUSER
+libc: CFLAGS += -pie -fPIE -fPIC -DUSER
libc: $(COBJS)
- @$(AS) $(ASFLAGS) crt/crt0.asm -o crt0.o
@mkdir -p ../../build/
- @$(AR) rcs ../../build/libc.a crt0.o $+
+ @$(AS) $(ASFLAGS) crt/crti.asm -o ../../build/crti.o
+ @$(AS) $(ASFLAGS) crt/crtn.asm -o ../../build/crtn.o
+ @$(AR) rcs ../../build/libc.a ../../build/crti.o ../../build/crti.o $+
libk: CFLAGS += -DKERNEL -ffreestanding -I../../kernel/inc/ $(CFLAGS_EXTRA)
libk: $(COBJS)