aboutsummaryrefslogtreecommitdiff
path: root/lib/Makefile
diff options
context:
space:
mode:
authorMarvin Borner2020-08-09 16:51:01 +0200
committerMarvin Borner2020-08-09 16:51:01 +0200
commit162d024a53e1e31e00ff0b6f47dd4590edebc551 (patch)
tree711d3886c300dfaddffdafaa89b690b45eb2101d /lib/Makefile
parent79f2fa136f26a0b87917336e089485712ee49bd6 (diff)
Heavy restructuring of libc, kernel and apps
Diffstat (limited to 'lib/Makefile')
-rw-r--r--lib/Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644
index 0000000..ad430d6
--- /dev/null
+++ b/lib/Makefile
@@ -0,0 +1,24 @@
+# MIT License, Copyright (c) 2020 Marvin Borner
+
+COBJS = str.o \
+ mem.o \
+ math.o \
+ conv.o \
+ print.o
+CC = ../cross/opt/bin/i686-elf-gcc
+LD = ../cross/opt/bin/i686-elf-ld
+OC = ../cross/opt/bin/i686-elf-ar
+
+# Flags to make the binary smaller TODO: Remove after indirect pointer support!
+CSFLAGS = -mpreferred-stack-boundary=2 -fno-asynchronous-unwind-tables -Os
+
+CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -fno-builtin -mgeneral-regs-only -std=c99 -m32 -pedantic-errors -Iinc/
+
+all: compile
+
+%.o: %.c
+ @$(CC) -c $(CFLAGS) $< -o $@
+
+compile: $(COBJS)
+ @mkdir -p ../build/
+ @$(AR) qc ../build/libc.a $(COBJS)