- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
Latest commit
26 lines (21 loc) · 649 Bytes
/
Copy pathMakefile
File metadata and controls
26 lines (21 loc) · 649 Bytes
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
# Usage:
# make ARCH=x86_64
# make ARCH=arm64
ARCH ?= x86_64
ifeq ($(ARCH), x86_64)
CC = x86_64-elf-gcc
AS = nasm
ASFLAGS = -f elf64
ARCH_OBJS = arch/x86_64/boot64.o arch/x86_64/io64.o
TARGET = kernel_x64.bin
else ifeq ($(ARCH), arm64)
CC = aarch64-none-elf-gcc
AS = aarch64-none-elf-as
ASFLAGS =
ARCH_OBJS = arch/arm64/boot_arm64.o arch/arm64/io_arm64.o
TARGET = kernel_arm64.bin
endif
COMMON_OBJS = main.o shell.o dos_commands.o separater.o percentage.o
all: $(TARGET)
$(TARGET): $(ARCH_OBJS)$(COMMON_OBJS)
$(CC) -T linker.ld -o $(TARGET) -ffreestanding -O2 -nostdlib $(ARCH_OBJS)$(COMMON_OBJS)