diff withGRUB2Kernel/Makefile @ 14:acdc2c21996a

chage directory structure
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Wed, 05 Sep 2012 11:49:15 +0900
parents
children e7ab5a0911d4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/withGRUB2Kernel/Makefile	Wed Sep 05 11:49:15 2012 +0900
@@ -0,0 +1,47 @@
+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 \
+			  -nodefaultlibs \
+			  -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)
+BITFLAG = -m32
+
+TARGET=cbc_os.elf
+
+all: $(TARGET)
+
+kernel.o: kernel.cbc 
+	$(CBC) $(BITFLAG) $(CBCFLAGS) $@ $^ 
+
+bootstrap.o: bootstrap.S 
+	$(CBC) $(BITFLAG) $(CBCFLAGS) $@ $^
+
+$(TARGET): bootstrap.o kernel.o 
+	$(LD) $(LDFLAGS) $@ $^
+
+clean:
+	rm -rf *.o *.elf