forked from le0kar0ub1/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (43 loc) · 1.15 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
###############################################################################
##
## This file is part of the Cosmos project, and is made available under
## the terms of the GNU General Public License version 3.
##
## Copyright (C) 2020 - Leo Karoubi
##
###############################################################################
sinclude mkhelper/def.mk
sinclude mkhelper/macro.mk
sinclude mkhelper/toolchain.mk
.PHONY: all iso
all iso: toolchain
$(MAKE) -C src
.PHONY: kernel
kernel: toolchain
$(MAKE) kernel -C src
.PHONY: toolchain
toolchain:
$(call EvalFatToolChainExistence)
$(call EvalBinaryToolChainExistence,gcc)
$(call EvalBinaryToolChainExistence,ld)
$(call EvalBinaryExistence,grub-mkrescue)
$(call EvalBinaryExistence,xorriso)
.PHONY: clean
clean:
rm -rf $(TARGET_BASE_PATH)
.PHONY: re
re: clean all
ifeq ($(debug),soft)
QEMUOPT = -monitor stdio --no-reboot
else ifeq ($(debug),gdb)
QEMUOPT = -s -S
else
QEMUOPT = -serial stdio
endif
.PHONY: run
run: iso
qemu-system-x86_64 -cdrom $(TARGET_BASE_PATH)/debug/$(TARGET_ISOKRN) \
-m 4G \
$(QEMUOPT) \
-enable-kvm \
-smp 4