comparison cos/Makefile @ 12:fcdae30b2782

Fixup of variable argument things
author windel
date Mon, 14 Nov 2011 21:31:27 +0100
parents 607898120eb1
children a58904747019
comparison
equal deleted inserted replaced
11:607898120eb1 12:fcdae30b2782
1 # vim: set noexpandtab: 1 # vim: set noexpandtab:
2 2
3 all: lcfosc.elf 3 all: bootdisk.img Makefile
4 4
5 bootdisk.img: lcfosc.elf grub/menu.lst 5 bootdisk.img: lcfosc.elf grub/menu.lst Makefile
6 objcopy -O binary lcfosc.elf lcfosc.bin 6 objcopy -O binary lcfosc.elf lcfosc.bin
7 cp grub/emptybootdisk.img bootdisk.img 7 cp grub/emptybootdisk.img bootdisk.img
8 mcopy -D o -i bootdisk.img lcfosc.bin :: 8 mcopy -D o -i bootdisk.img lcfosc.bin ::
9 mcopy -D o -i bootdisk.img grub/menu.lst ::/grub 9 mcopy -D o -i bootdisk.img grub/menu.lst ::/grub
10 mdir -i bootdisk.img 10 mdir -i bootdisk.img
14 CFLAGS = -m64 \ 14 CFLAGS = -m64 \
15 -nostdinc \ 15 -nostdinc \
16 -nostdlib \ 16 -nostdlib \
17 -nostartfiles \ 17 -nostartfiles \
18 -fno-builtin \ 18 -fno-builtin \
19 -mcmodel=large \
19 -Iinclude 20 -Iinclude
20 21
21 OBJECTS = \ 22 OBJECTS = \
22 kernel/video.o \ 23 kernel/video.o \
23 kernel/snprintf.o \ 24 kernel/snprintf.o \
24 kernel/kernel.o 25 kernel/kernel.o
25 26
26 lcfosc.elf: $(CRT0) $(OBJECTS) linker.ld 27 lcfosc.elf: $(CRT0) $(OBJECTS) linker.ld
27 ld -T linker.ld -o lcfosc.elf $(CRT0) $(OBJECTS) 28 ld -T linker.ld -o lcfosc.elf $(CRT0) $(OBJECTS)
28 29
29 %.o : %.asm 30 %.o : %.asm Makefile
30 nasm -f elf64 -o $@ $< 31 nasm -f elf64 -o $@ $<
31 32
32 %.o : %.c 33 %.o : %.c Makefile
33 gcc $(CFLAGS) -o $@ -c $< -Wall -Wextra -Werror 34 gcc $(CFLAGS) -o $@ -c $< -Wall -Wextra -Werror
34 35
35 clean: 36 clean:
36 rm $(OBJECTS) $(CRT0) lcfosc.bin lcfosc.elf 37 rm $(OBJECTS) $(CRT0) lcfosc.bin lcfosc.elf
37 38