Commits

prabirshrestha committed 6ba0f57

compile boot0.S

Comments (0)

Files changed (5)

+ARCH=x86
+
+CURRENT_MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+MAKEFILE_DIRECTORY := $(dir $(CURRENT_MAKEFILE))
+
+TOOLPREFIX=i686-pc-elf-
+TOOLPATH=$(MAKEFILE_DIRECTORY)toolchain
+
+CC = $(TOOLPATH)/clang/bin/clang
+CXX = $(TOOLPATH)/clang/bin/clang++
+# CC = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)gcc
+# CXX = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)g++
+CCFLAGS=-Wall -Werror -ffreestanding -fno-builtin -nostdlib -pedantic -O2
+
+AS = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)as
+LD = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)ld
+AR = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)ar
+RANLIB = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)ranlib
+
+OBJCOPY = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)objcopy
+OBJDUMP = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)objdump
+
+include boot/boot.mk
+
+all: boot
+BOOTSRCPATH=boot/
+
+boot: $(BOOTSRCPATH)boot.img
+
+$(BOOTSRCPATH)boot.img: $(BOOTSRCPATH)boot0.bin
+
+$(BOOTSRCPATH)boot0.bin: $(BOOTSRCPATH)boot0.elf
+
+$(BOOTSRCPATH)boot0.elf: $(BOOTSRCPATH)boot0.o
+
+$(BOOTSRCPATH)boot0.o: $(BOOTSRCPATH)boot0.S
+	$(CC) -o $@ -c $^
+# http://www.cs.cmu.edu/~410-s07/p4/p4-boot.pdf
+
+
+
+
Empty file added.

old/Makefile.config

-MAKE	= exec make -$(MAKEFLAGS)
-
-ARCH=x86
-PREFIX=
-
-CURRENT_MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-MAKEFILE_DIRECTORY := $(dir $(CURRENT_MAKEFILE))
-
-TOOLPREFIX=i686-pc-elf-
-TOOLPATH=$(MAKEFILE_DIRECTORY)toolchain
-
-CC = $(TOOLPATH)/clang/bin/clang
-CXX = $(TOOLPATH)/clang/bin/clang
-
-#CC = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)gcc
-
-AS = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)as
-LD = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)ld
-AR = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)ar
-RANLIB = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)ranlib
-
-OBJCOPY = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)objcopy
-OBJDUMP = $(TOOLPATH)/gcc/bin/$(TOOLPREFIX)objdump
-
-CFLAGS = -fno-builtin -nostdinc -fno-stack-protector -Wall
-
-QEMU = qemu-system-i386