-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (40 loc) · 984 Bytes
/
Copy pathMakefile
File metadata and controls
47 lines (40 loc) · 984 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
all: kernel.iso
ARCH=x86_64
SRC_DIR = src
INC_DIR = include
KERNEL_DIR = kernel
KERNEL_PATH = ${SRC_DIR}/${KERNEL_DIR}
INCLUDE_DIRS = src/ include/
KERNEL_INCLUDE_DIRS = ${INCLUDE_DIRS} include/kernel/
INCLUDE_ARGS = ${foreach dir, ${INCLUDE_DIRS}, -I${dir}}
.SUFFIXES: .asm
ifeq ($(ARCH), "64")
override ARCH = x86_64
endif
ifeq ($(ARCH), "x86-64")
override ARCH = x86_64
endif
ifeq ($(ARCH), "32")
override ARCH = x86_32
endif
ifeq ($(ARCH), "x86-32")
override ARCH = x86_32
endif
ifeq ($(ARCH), "x86")
override ARCH = x86_64
endif
include platforms/$(ARCH)/$(ARCH).mk
kernel.sym: kernel.bin
nm $^ | grep " . " | awk '{ print $1" "$3}' > @
symbols: kernel.sym
stats:
cloc --yaml . | grep -E 'Assembly:|C:|C\+\+:' -A 4 | sed 's/nFiles/files/'
echo -n "Total: " && cloc --yaml . | grep -E 'SUM:' -A 4 | grep 'code: ' | sed 's/.*code: //g;s/$$/ SLoC/g'
.PHONY : stats
.SILENT : stats
clean:
for f ; \
do \
$(RM) $$f; \
done <<< `find . -name \.o`;
.PHONY : clean