9
|
1 # vim: set noexpandtab:
|
|
2
|
12
|
3 all: bootdisk.img Makefile
|
9
|
4
|
12
|
5 bootdisk.img: lcfosc.elf grub/menu.lst Makefile
|
9
|
6 objcopy -O binary lcfosc.elf lcfosc.bin
|
|
7 cp grub/emptybootdisk.img bootdisk.img
|
|
8 mcopy -D o -i bootdisk.img lcfosc.bin ::
|
|
9 mcopy -D o -i bootdisk.img grub/menu.lst ::/grub
|
|
10 mdir -i bootdisk.img
|
|
11
|
|
12 CRT0 = kernel/goto64.o
|
|
13
|
|
14 CFLAGS = -m64 \
|
|
15 -nostdinc \
|
|
16 -nostdlib \
|
|
17 -nostartfiles \
|
|
18 -fno-builtin \
|
12
|
19 -mcmodel=large \
|
9
|
20 -Iinclude
|
|
21
|
|
22 OBJECTS = \
|
|
23 kernel/video.o \
|
|
24 kernel/snprintf.o \
|
14
|
25 kernel/kernel.o \
|
|
26 kernel/asmcode.o \
|
|
27 kernel/handlers.o
|
|
28
|
9
|
29
|
|
30 lcfosc.elf: $(CRT0) $(OBJECTS) linker.ld
|
|
31 ld -T linker.ld -o lcfosc.elf $(CRT0) $(OBJECTS)
|
|
32
|
12
|
33 %.o : %.asm Makefile
|
9
|
34 nasm -f elf64 -o $@ $<
|
|
35
|
12
|
36 %.o : %.c Makefile
|
9
|
37 gcc $(CFLAGS) -o $@ -c $< -Wall -Wextra -Werror
|
|
38
|
|
39 clean:
|
|
40 rm $(OBJECTS) $(CRT0) lcfosc.bin lcfosc.elf
|
|
41
|