-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (29 loc) · 1008 Bytes
/
Makefile
File metadata and controls
43 lines (29 loc) · 1008 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
#########################
# FOS is made of two disks at present:
#########################
BOOT_DISKA = build/fos.bin
BOOT_DISKB = build/disk2.img
#########################
BOOT_OBJECT = build/bootloader.elf
KERNEL_OBJECTS = $(shell find kernel -name *.o)
all: kernel $(BOOT_DISKA) $(BOOT_DISKB)
$(BOOT_DISKA): build/fos.elf
i686-elf-objcopy -O binary build/fos.elf build/fos.bin
build/fos.elf: $(KERNEL_OBJECTS) $(BOOT_OBJECT)
i686-elf-ld -L build/ -T boot/fos.ld $(KERNEL_OBJECTS) --oformat elf32-i386 -o build/fos.elf
i686-elf-objcopy --only-keep-debug build/fos.elf build/fos.sym
# Build the boot strap stuff.
$(BOOT_OBJECT): boot/bootloader.asm boot/fos.ld
nasm -g -f elf -o $(BOOT_OBJECT) boot/bootloader.asm
# Build test disks.
build/disk2.img: boot/disk2.dmg
hdiutil convert boot/disk2.dmg -format RdWr -o build/disk2.img
.PHONY: tests
tests:
$(MAKE) -C tests
.PHONY: kernel
kernel:
$(MAKE) -C kernel
.PHONY: clean
clean:
rm $(KERNEL_OBJECTS) $(BOOT_OBJECT)