OUTPUT=kernel.bin all : $(OUTPUT) #PREFIX=i686-pc-linux-gnu- PREFIX= NEWLIBPATH=/usr/lib/newlib/i686-linux-gnu CC=$(PREFIX)gcc CXX=$(PREFIX)g++ LD=$(PREFIX)ld CFLAGS=-m32 -fno-builtin -nostdlib -I../include/common -I../include/kernel -I$(NEWLIBPATH)/include -Os -std=c99 ASFLAGS=-m32 CXXFLAGS:=$(CFLAGS) -fno-rtti -fno-exceptions #LIBGCC:=/usr/lib/gcc/x86_64-linux-gnu/4.6/32/libgcc.a #LDFLAGS:=-L/usr/lib/newlib/i686-linux-gnu/lib $(NEWLIBPATH)/lib/crt0.o $(NEWLIBPATH)/lib/crt1.o $(NEWLIBPATH)/lib/libc.a $(NEWLIBPATH)/lib/libm.a $(LIBGCC) # cnstdlib.o stuff.o # cnstdlib.o # $(LD) -m elf_i386 -T link.ld --oformat elf32-i386 -o $@ $^ $(LDFLAGS) # loader.o #loader.o kernel.elf : loader.o main.o $(LD) -static -nostdlib --nmagic -m elf_i386 -T linker.ld -o $@ $^ $(LDFLAGS) $(OUTPUT) : kernel.elf objcopy -O binary kernel.elf kernel.bin dd if=/dev/zero bs=512 count=128 >> kernel.bin clean : rm -rf *~ *.o $(OUTPUT) kernel.elf