Kernel/Makefile

24 lines
No EOL
449 B
Makefile

CROSS_COMPILE = arm-none-eabi-
AS = $(CROSS_COMPILE)as
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
CFLAGS = -Wall -mcpu=arm926ej-s -nostdlib -ffreestanding
all: kernel.bin
kernel.elf: boot.o kernel.o
$(LD) -T boot.ld -o $@ $^
kernel.bin: kernel.elf
$(OBJCOPY) -O binary $< $@
boot.o: boot.s
$(AS) -mcpu=arm926ej-s $< -o $@
kernel.o: kernel.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f *.o *.elf *.bin