view cos/Makefile @ 14:a58904747019

Added asm interrupt handler things, not yet working
author windel
date Mon, 14 Nov 2011 22:45:55 +0100
parents fcdae30b2782
children 6129643f5c34
line wrap: on
line source

# vim: set noexpandtab:

all: bootdisk.img Makefile

bootdisk.img: lcfosc.elf grub/menu.lst Makefile
	objcopy -O binary lcfosc.elf lcfosc.bin
	cp grub/emptybootdisk.img bootdisk.img
	mcopy -D o -i bootdisk.img lcfosc.bin ::
	mcopy -D o -i bootdisk.img grub/menu.lst ::/grub
	mdir -i bootdisk.img

CRT0 = kernel/goto64.o

CFLAGS = -m64 \
			-nostdinc \
			-nostdlib \
			-nostartfiles \
			-fno-builtin \
			-mcmodel=large \
			-Iinclude

OBJECTS = \
	kernel/video.o \
	kernel/snprintf.o \
	kernel/kernel.o \
	kernel/asmcode.o \
	kernel/handlers.o


lcfosc.elf: $(CRT0) $(OBJECTS) linker.ld
	ld -T linker.ld -o lcfosc.elf $(CRT0) $(OBJECTS)

%.o : %.asm Makefile
	nasm -f elf64 -o $@ $<

%.o : %.c Makefile
	gcc $(CFLAGS) -o $@ -c $< -Wall -Wextra -Werror

clean:
	rm $(OBJECTS) $(CRT0) lcfosc.bin lcfosc.elf