view Makefile @ 12:b045d733207e

README and bootstrap minor change
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Fri, 31 Aug 2012 07:05:44 +0900
parents 26b76ada8c13
children 812852f41fc0
line wrap: on
line source

HOME		= /Users/taira
prefix		= $(HOME)/cross/COMMON_INSTALL/bin
CBC			= $(prefix)/elf-cbc-gcc-4.6.0
LD			= $(prefix)/x86_64-elf-ld

CBCFLAGS	= -ffreestanding \
			  -fno-common \
			  -fno-builtin \
			  -fomit-frame-pointer \
			  -g \
			  -Wall \
			  -O2 \
			  -c \
			  -o

LDFLAGS64		= -melf_x86_64 \
			  -nostdlib \
			  -Ttext 0x100000 \
			  --oformat elf64-x86-64 \
			  -o 

LDFLAGS32		= -melf_i386 \
				  -nostdlib \
				  -Ttext 0x100000 \
				  --oformat elf32-i386 \
				  -o

LDFLAGS = $(LDFLAGS32)

TARGET=cbc_os.elf

all: $(TARGET)

kernel.o: kernel.cbc 
	$(CBC) -m32 $(CBCFLAGS) $@ $^ 

bootstrap.o: bootstrap.S 
	$(CBC) -m32 $(CBCFLAGS) $@ $^

$(TARGET): bootstrap.o kernel.o 
	$(LD) $(LDFLAGS) $@ $^

clean:
	rm -rf *.o *.elf