forked from brutal-org/brutal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
105 lines (80 loc) · 1.67 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.SUFFIXES:
.DEFAULT_GOAL := all
SHELL := /bin/bash
export LC_ALL=C
ifndef ECHO
T := $(shell $(MAKE) $(MAKECMDGOALS) --no-print-directory \
-nrRf $(firstword $(MAKEFILE_LIST)) \
ECHO="%COUNT_ME%" | grep -c "%COUNT_ME%")
N := x
C = $(words $N)$(eval N := x $N)
ECHO = @echo -e "`printf "\e[1m[$C/$T]\e[m" `"
endif
CFLAGS_STD ?= \
-std=gnu2x
CFLAGS_OPT ?= \
-O3
CFLAGS_WARN ?= \
-Wall \
-Wextra \
-Werror
INC_LIBS= \
-Isources/libs/ansi \
-Isources/libs/posix \
-Isources/libs/bsd \
-Isources/libs/gnu \
-Isources/libs/math
INC_LIBBRUTAL= \
-Isources/libs/
HOST_CFLAGS_INC ?= \
$(INC_LIBBRUTAL) \
-Isources/bins \
-Isources/ \
-Ithirdparty
CROSS_CFLAGS_INC ?= \
$(INC_LIBS) \
$(INC_LIBBRUTAL) \
-Isources/bins \
-Isources/ \
-Ithirdparty
BUILDDIR=build/$(CONFIG_ARCH)-$(CONFIG_TOOLCHAIN)
MKCWD=mkdir -p $(@D)
include meta/config/default.mk
include meta/toolchain/archs/$(CONFIG_ARCH).mk
include meta/toolchain/$(CONFIG_TOOLCHAIN)/.build.mk
include sources/kernel/.build.mk
include sources/bins/.cross.mk
include sources/bins/.host.mk
include sources/loader/.build.mk
include sysroot/.build.mk
include sources/libs/proto/.build.mk
.PHONY: all
all: $(ISO)
ifeq ($(QEMU_BOOT_METHOD), kernel)
run: $(ISO)
qemu-system-$(CONFIG_ARCH) \
$(QEMU_ARGS) \
-serial mon:stdio \
-no-reboot \
-no-shutdown \
-kernel $(KERNEL)
-hda $(ISO)
else ifeq ($(QEMU_BOOT_METHOD), iso)
run: $(ISO)
qemu-system-$(CONFIG_ARCH) \
$(QEMU_ARGS) \
-serial mon:stdio \
-no-reboot \
-no-shutdown \
-cdrom $(ISO)
endif
.PHONY: bochs
bochs: $(ISO)
bochs
.PHONY: clean
clean:
rm -rf $(BUILDDIR)
.PHONY: clean
clean-all:
rm -rf build/
-include $(DEPENDENCIES)