aboutsummaryrefslogtreecommitdiff
path: root/lib/Makefile
blob: ad430d6904f51c73bad6243c552ff1e481f825d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)