summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/arm64-desktop.make
blob: d38f0cbd99c485d6883bd0505838940963ada770 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
##################################################
# (c) Amlal El Mahrouss, licensed under the Apache 2.0 license.
# This is the microKernel makefile.
##################################################

CC			= clang++
LD			= lld-link
CCFLAGS		= -fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \
			 -target aarch64-unknown-windows \
				-std=c++20 -D__nekernel_max_cores -O3 -D__NEKERNEL__ -D__NEOSKRNL__  -D__NE_VEPM__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_API__ -D__NE__ -I../

ASM 		= clang++

DISKDRIVER = -D__USE_FLASH_MEM__

ifneq ($(DEBUG_SUPPORT), )
DEBUG =  -D__DEBUG__
endif

COPY		= cp

LDFLAGS		= -subsystem:efi_application -entry:hal_init_platform /nodefaultlib
LDOBJ		= obj/*.obj

# This file is the Kernel, responsible of task management and memory.
KERNEL		= ne_kernel

.PHONY: error
error:
	@echo "=== ERROR ==="
	@echo "=> Use a specific target."

MOVEALL=./move-all-aarch64.sh

.PHONY: nekernel-arm64-epm
nekernel-arm64-epm: clean
	$(CC) $(CCFLAGS) $(DISKDRIVER) $(DEBUG) $(wildcard src/*.cpp) \
	       $(wildcard src/FS/*.cpp) $(wildcard HALKit/ARM64/Storage/*.cpp) \
			$(wildcard HALKit/ARM64/PCI/*.cpp) $(wildcard src/Network/*.cpp) $(wildcard src/Storage/*.cpp) \
			$(wildcard HALKit/ARM64/*.cpp) $(wildcard HALKit/ARM64/*.cpp) \
			$(wildcard HALKit/ARM64/*.s) $(wildcard HALKit/ARM64/APM/*.cpp)

	$(MOVEALL)

OBJCOPY=x86_64-w64-mingw32-objcopy

.PHONY: link-arm64-epm
link-arm64-epm:
	$(LD) $(LDFLAGS) $(LDOBJ) /out:$(KERNEL)

.PHONY: all
all: nekernel-arm64-epm link-arm64-epm
	@echo "Kernel => OK."

.PHONY: help
help:
	@echo "=== HELP ==="
	@echo "all: Build Kernel and link it."
	@echo "link-arm64-epm: Link Kernel for EPM based disks."
	@echo "nekernel-arm64-epm: Build Kernel for EPM based disks."

.PHONY: clean
clean:
	rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL)