-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (47 loc) · 1.81 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
INCLUDE_N = includes
OBJECTS_N = obj
MAKEFILE_N = Makefile
ROOT = ATOS/
CORE_DIR = core/
CORE_BOOT = core/boot/
CORE_CPU = core/cpu/
CORE_KERNEL = core/kernel/
CORE_MEMORY = core/memory/
CORE_DEVICE = core/device/
DISPLAY_DIR = display/
DISPLAY_BASIC_DIR = basic/
ASSEMBLY_DIR = assembly/
LIBRARY_DIR = library/
CURRENT_DIR = $(shell pwd)
INCLUDES_DIR = -I $(CURRENT_DIR)/$(ROOT)$(CORE_BOOT)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(CORE_CPU)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(CORE_KERNEL)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(CORE_MEMORY)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(CORE_DEVICE)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(DISPLAY_DIR)$(DISPLAY_BASIC_DIR)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(ENTRY_DIR)$(INCLUDE_N) \
-I $(CURRENT_DIR)/$(ROOT)$(LIBRARY_DIR)$(INCLUDE_N) \
OBJECTS_DIR = $(ROOT)$(CORE_DIR)$(OBJECTS_N)/* \
$(ROOT)$(DISPLAY_DIR)$(OBJECTS_N)/* \
$(ROOT)$(ASSEMBLY_DIR)$(OBJECTS_N)/* \
$(ROOT)$(LIBRARY_DIR)$(OBJECTS_N)/* \
CC = i686-elf-gcc
LD_SCRIPT = linker/linker.ld
LD_FLAGS = -T $(LD_SCRIPT) -ffreestanding -O2 -nostdlib
LD = $(CC) $(LD_FLAGS)
NAME = release/boot/atos.bin
ISO_NAME = atos.iso
all:
$(MAKE) -C $(ROOT)$(CORE_DIR) INCLUDES="$(INCLUDES_DIR)"
$(MAKE) -C $(ROOT)$(DISPLAY_DIR) INCLUDES="$(INCLUDES_DIR)"
$(MAKE) -C $(ROOT)$(ASSEMBLY_DIR) INCLUDES="$(INCLUDES_DIR)"
$(MAKE) -C $(ROOT)$(LIBRARY_DIR) INCLUDES="$(INCLUDES_DIR)"
$(LD) -o $(NAME) $(OBJECTS_DIR)
grub-mkrescue -o atos.iso release/
clean:
$(MAKE) clean -C $(ROOT)$(CORE_DIR)
$(MAKE) clean -C $(ROOT)$(DISPLAY_DIR)
$(MAKE) clean -C $(ROOT)$(ASSEMBLY_DIR)
$(MAKE) clean -C $(ROOT)$(LIBRARY_DIR)
rm -rf $(NAME)
rm -rf $(ISO_NAME)