summaryrefslogtreecommitdiffstats
path: root/lib/libc/Makefile
blob: 8163b2e023f6c9f1e5cd7e3ee4eea137806eb0dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
include $(CONFIG)

CDIRS := stdio ctype string

CFILES += $(foreach dir,$(CDIRS),$(wildcard $(dir)/*.c))

OFILES := $(patsubst %.c,%.o,$(CFILES))

CFLAGS := -ffreestanding -nostdlib

all: ${OFILES}
	ar rcs $(OUT)/libc.a $(OFILES)

%.o:%.c
	$(CC) $(CFLAGS) -c $< -o $@