blob: c69c470e899d8140555bd91a0728fe71c8b8d4dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
CFILES = $(shell find src/ -name "*.c")
OBJ = $(shell find build/ -name "*.o")
OBJ += $(CFILES:.c=.o)
LIBC_OUT = libc.a
.PHONY: all
all: build sys $(OBJ) target
ar rcs $(LIBC_OUT) $(OBJ)
%.o: %.c
$(CC) -ffreestanding -nostdlib -Iinclude/ -I$(TARGET)/include/ -c $< -o $@
.PHONY: target
target:
cd $(TARGET); make CC=$(CC) LD=$(LD) AS=$(AS)
.PHONY: sys
sys:
mkdir -p sys/
rsync -av ../../sys/include/sys/* include/sys/
# Create build directory
build:
mkdir -p $@
.PHONY: clean
clean:
rm -rf build/
|