summaryrefslogtreecommitdiffhomepage
path: root/makefile
blob: ee57f2c05aba516273fc2da30220f5b61bb98d0b (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
29
30
31
32
33
34
35
CC			= clang
LD			= ld.lld
CCFLAGS		= --target=ppc64le -c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -D__HAVE_HCORE_APIS__ -D__hCore__ -I./ -I$(HOME)/
ASM			= nasm
ASMFLAGS	= -f elf64

# This file is the kernel, responsible of task management, memory, drivers and more.
KERNEL		= hKernel.elf

# The kernel entrypoint
ENTRY		= --script=Linker/PowerPC.ld

# Where the text segment is.
TEXT		= 0xc0000000

# we want a flat binary 
FMT			= elf64

.PHONY: kernel-build
kernel-build:
	$(CC) $(CCFLAGS) Source/*.cxx HALKit/PowerPC/PCI/*.cxx Source/Network/*.cpp\
		Source/Storage/*.cxx HALKit/PowerPC/*.cpp HALKit/PowerPC/*.s
	mv *.o Obj/

.PHONY: kernel-link
kernel-link:
	$(LD) -e $(ENTRY) Obj/*.o -o $(KERNEL)

.PHONY: all
all: kernel-build kernel-link
	echo "[hKernel] you can now link it!"

.PHONY: kernel-clean
kernel-clean:
	rm -f Obj/*.o $(KERNEL)