-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (25 loc) · 931 Bytes
/
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
ASM_SOURCES=$(patsubst %.s, %.o, $(wildcard arch/x86/asm/*.s))
ARCH_CPP_SOURCES=$(patsubst %.cpp, %.o, $(wildcard arch/x86/*.cpp))
ARCH_C_SOURCES=$(patsubst %.c, %.o, $(wildcard arch/x86/*.c))
ARCH_SOURCES=$(ARCH_CPP_SOURCES) $(ARCH_C_SOURCES)
KERNEL_SOURCES=$(patsubst %.c, %.o, $(wildcard kernel/*.c)) $(patsubst %.cpp, %.o, $(wildcard kernel/*.cpp))
SOURCES=$(ASM_SOURCES) $(ARCH_SOURCES) $(KERNEL_SOURCES)
CXXFLAGS=-I./include -m32 -ffreestanding -fno-rtti -fno-exceptions -nostdlib -nostdinc -fno-stack-protector
CFLAGS=-I./include -m32 -ffreestanding -fno-exceptions -nostdlib -nostdinc -fno-stack-protector
LDFLAGS=-m elf_i386 -Tlink.ld
NASM_FLAGS=-felf -g
all: $(SOURCES) link
link:
ld $(LDFLAGS) -o phOS.img $(SOURCES)
clean:
rm -rvf $(SOURCES)
.s.o:
nasm $(NASM_FLAGS) $<
qemu-start:
@echo "Starting qemu"
@./boot.sh qemu
bochs-start:
@echo "Starting bochs"
@./boot.sh
tags:
@ctags -R -f phOS.tags .