-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (38 loc) · 1.04 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
OBJECTS = boot.o kernel.o
PYC = bin/pycer
PYFLAGS = -m32 -fno-builtin -fno-stack-protector \
-Wall -Wextra -Werror -c
PYEXTRAFLAGS = -nostdlib -nostdinc -nostartfiles -nodefaultlibs
LDFLAGS = -N -T linker.ld -melf_i386
AS = nasm
ASFLAGS = -f elf32
all: kernel os.iso
dev: kernel.cpp
run: kernel os.iso
@echo "--> Running kernel"
@python.exe run_iso.py
kernel: $(OBJECTS)
@ld $(LDFLAGS) $(OBJECTS) -o iso/boot/kernel
@echo "--> Compiled Kernel"
os.iso: kernel
@echo "--> Generating os.iso file"
@genisoimage -R \
-b boot/grub/stage2_eltorito \
-no-emul-boot \
-boot-load-size 4 \
-A pykern \
-boot-info-table \
-o os.iso \
iso
@echo "--> Completed building OS"
%.o: %.py
@$(PYC) $< $(PYFLAGS) -o $@
@echo "--> Compiled $<"
%.cpp: %.py
@$(PYC) -S $<
@echo "--> Compiled $<"
%.o: %.asm
@$(AS) $(ASFLAGS) $<
@echo "--> Compiled $<"
clean:
@rm -rf *.o iso/boot/kernel os.iso *.cpp *.log