9
|
1 # vim: set noexpandtab:
|
|
2
|
12
|
3 all: bootdisk.img Makefile
|
9
|
4
|
20
|
5 bootdisk.img: lcfosc.bin grub/menu.lst Makefile
|
9
|
6 cp grub/emptybootdisk.img bootdisk.img
|
|
7 mcopy -D o -i bootdisk.img lcfosc.bin ::
|
|
8 mcopy -D o -i bootdisk.img grub/menu.lst ::/grub
|
|
9
|
28
|
10 CRT0 = goto64.o
|
9
|
11
|
28
|
12 CFLAGS = -m64 -nostdinc -nostdlib -nostartfiles -mno-red-zone \
|
|
13 -fno-builtin -mcmodel=large -Wall -Wextra -Werror
|
9
|
14
|
28
|
15 OBJECTS = video.o snprintf.o kernel.o asmcode.o handlers.o keyboard.o \
|
|
16 klib.o malloc.o task.o mm.o timer.o
|
14
|
17
|
28
|
18 lcfosc.bin: $(CRT0) $(OBJECTS) link.ld
|
|
19 ld -T link.ld -s -o lcfosc.bin $(CRT0) $(OBJECTS)
|
9
|
20
|
12
|
21 %.o : %.asm Makefile
|
9
|
22 nasm -f elf64 -o $@ $<
|
|
23
|
12
|
24 %.o : %.c Makefile
|
28
|
25 gcc $(CFLAGS) -o $@ -c $<
|
9
|
26
|
|
27 clean:
|
20
|
28 rm $(OBJECTS) $(CRT0) lcfosc.bin
|
9
|
29
|