-
Notifications
You must be signed in to change notification settings - Fork 0
/
MAKEFILE
26 lines (18 loc) · 892 Bytes
/
MAKEFILE
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
CC = aarch64-elf-gcc
CFLAGS = -Wall -O2 -ffreestanding -nostdlib -I./Libs/BasicLibrary
LDFLAGS = -T linker.ld -lgcc
OBJS = bootloader.o uart.o basic_library.o kernelmain.o
all: kernel.img
kernel.img: $(OBJS)
$(CC) $(CFLAGS) -o kernel.elf $(OBJS) $(LDFLAGS)
aarch64-elf-objcopy -O binary kernel.elf kernel.img
bootloader.o: /Bootloader_&_assembly_code/Bootloader.s
$(CC) $(CFLAGS) -c /Bootloader_&_assembly_code/Bootloader.s -o bootloader.o
uart.o: ./Libs/BasicLibrary/uart.c ./Libs/BasicLibrary/uart.h
$(CC) $(CFLAGS) -c ./Libs/BasicLibrary/uart.c -o uart.o
basic_library.o: ./Libs/BasicLibrary/basic_library.c ./Libs/BasicLibrary/basic_library.h ./Libs/BasicLibrary/stdarg.h
$(CC) $(CFLAGS) -c ./Libs/BasicLibrary/basic_library.c -o basic_library.o
kernelmain.o: /KernelMain/kernelmain.c
$(CC) $(CFLAGS) -c /KernelMain/kernelmain.c -o kernelmain.o
clean:
rm -f *.o *.elf *.img