-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Makefile and removed unecessary files
- Loading branch information
Showing
3 changed files
with
25 additions
and
93 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,40 @@ | ||
###PATH=$PATH:/usr/local/i386elfgcc/bin | ||
###PATH=$PATH:/usr/local/x86_64elfgcc/bin (just incase the path varable isnt setup for this compiler) | ||
## | ||
##CPP_SOURCES = $(wildcard kernel/*.cpp drivers/*.cpp) | ||
##HEADERS = $(wildcard kernel/*.h drivers/*.h) | ||
##OBJS = ${CPP_SOURCES:.cpp=.o} | ||
## | ||
##CPP = i386-elf-gcc | ||
##CPPFLAGS = -ffreestanding -m32 -g | ||
## | ||
## | ||
##all: OS.bin | ||
## $(info ---------- Running OS ----------) | ||
## qemu-system-x86_64 -drive format=raw,file="OS.bin",index=0,if=floppy -m 128M | ||
##setup: | ||
## export PREFIX="/usr/local/i386elfgcc" | ||
## export TARGET=i386-elf | ||
## export PATH="$$PREFIX/bin:$$PATH" | ||
##OS.bin: boot/everything.bin boot/zeros.bin | ||
## $(info ---------- Generating OS binary ----------) | ||
## cat $^ > $@ | ||
##boot/zeros.bin: boot/zeros.asm | ||
## $(info ---------- padding ----------) | ||
## nasm $^ -f bin -o $@ | ||
##boot/everything.bin: boot/boot.bin kernel/full_kernel.bin | ||
## $(info ---------- Generating a a complete binary file ----------) | ||
## cat $^ > $@ | ||
##boot/boot.bin: boot/boot.asm | ||
## $(info ---------- Generating boot file ----------) | ||
## nasm $^ -f bin -o $@ | ||
##kernel/full_kernel.bin: kernel/kernel_entry.o kernel/kernel.o | ||
## $(info ---------- Generating full_kernel.bin ----------) | ||
## i386-elf-ld -o $@ -Ttext 0x100 $^ --oformat binary | ||
##kernel/kernel_entry.o: kernel/kernel_entry.asm | ||
## $(info ---------- Generating kernel.o ----------) | ||
## nasm $^ -f elf -o $@ | ||
##$(OUT): $(OBJFILES) | ||
## $(CPP) $(CPPFLAGS) -o $@ $^ | ||
##%.o: %.cpp ${HEADERS} | ||
## $(info ---------- Generating object files from cpp ----------) | ||
## $(CPP) $(CPPFLAGS) -c $< -o $@ | ||
## @echo $^ | ||
##clean: | ||
## $(info ---------- Cleaning ----------) | ||
## rm -fr *.bin kernel/*.bin drivers/*.bin boot/*.bin | ||
## rm -fr *.o kernel/*.o drivers/*.o boot/*.o | ||
|
||
#PATH=$PATH:/usr/local/i386elfgcc/bin | ||
#PATH=$PATH:/usr/local/x86_64elfgcc/bin (just incase the path varable isnt setup for this compiler) | ||
#PATH=$PATH:/usr/local/x86_64elfgcc/bin | ||
|
||
CPP_SOURCES = $(wildcard kernel/*.cpp drivers/*.cpp) | ||
HEADERS = $(wildcard kernel/*.h drivers/*.h) | ||
LINKERS = $(wildcard kernel/*.ld drivers/*.ld) | ||
OBJS = ${CPP_SOURCES:.cpp=.o} | ||
|
||
CPP = i386-elf-gcc | ||
CPPFLAGS = -ffreestanding -m32 -g | ||
|
||
all: sector_1/bootloader.bin | ||
|
||
all: OS.bin | ||
$(info ---------- Running OS ----------) | ||
qemu-system-x86_64 -drive format=raw,file="sector_1/bootloader.bin",index=0,if=floppy -m 128M | ||
kernel/kernel.bin: kernel/kernel.tmp | ||
objcopy -O binary $^ $@ | ||
kernel/kernel.tmp: kernel/kernel.o sector_2/ExtendedProgram.o | ||
custom-ld -o kernel/kernel.tmp -Ttext $^ | ||
sector_2/ExtendedProgram.o: sector_2/ExtendedProgram.asm | ||
nasm $^ -f elf64 -o $@ | ||
kernel/kernel.o: kernel/kernel.cpp | ||
x86_64-elf-gcc -ffreestanding -mno-red-zone -m64 -c $^ -o $@ | ||
sector_1/bootloader.bin: sector_1/bootloader.asm sector_2/ExtendedProgram.bin | ||
nasm sector_1/bootloader.asm -f bin -o sector_1/bootloader.bin | ||
cat sector_2/ExtendedProgram.bin >> sector_1/bootloader.bin | ||
qemu-system-x86_64 -drive format=raw,file="OS.bin",index=0,if=floppy -m 128M | ||
OS.bin: boot/bootloader.bin | ||
$(info ---------- Generating OS binary ----------) | ||
cat $^ > $@ | ||
boot/bootloader.bin: sector_1/bootloader.asm sector_2/ExtendedProgram.bin | ||
$(info ---------- Generating bootloader ----------) | ||
nasm sector_1/bootloader.asm -f bin -o boot/bootloader.bin | ||
cat sector_2/ExtendedProgram.bin >> boot/bootloader.bin | ||
sector_2/ExtendedProgram.bin: sector_2/ExtendedProgram.asm | ||
nasm $^ -f bin -o $@ | ||
#OS.bin: boot/everything.bin boot/zeros.bin | ||
# $(info ---------- Generating OS binary ----------) | ||
# cat $^ > $@ | ||
#boot/zeros.bin: boot/zeros.asm | ||
# $(info ---------- padding ----------) | ||
# nasm $^ -f bin -o $@ | ||
#boot/everything.bin: boot/boot.bin kernel/full_kernel.bin | ||
# $(info ---------- Generating a a complete binary file ----------) | ||
# cat $^ > $@ | ||
#boot/boot.o: boot/boot.asm | ||
# $(info ---------- Generating boot file ----------) | ||
# nasm $^ -f elf64 -o $@ | ||
boot/boot.bin: boot/bootloader.asm | ||
$(info ---------- Generating boot file ----------) | ||
nasm $^ -f bin -o $@ | ||
#kernel/full_kernel.bin: kernel/kernel_entry.o kernel/kernel.o | ||
# $(info ---------- Generating full_kernel.bin ----------) | ||
# i386-elf-ld -o $@ -Ttext 0x100 $^ --oformat binary | ||
#kernel/kernel_entry.o: kernel/kernel_entry.asm | ||
# $(info ---------- Generating kernel.o ----------) | ||
# nasm $^ -f elf -o $@ | ||
#$(OUT): $(OBJFILES) | ||
# $(CPP) $(CPPFLAGS) -o $@ $^ | ||
#%.o: %.cpp ${HEADERS} | ||
# $(info ---------- Generating object files from cpp ----------) | ||
# $(CPP) $(CPPFLAGS) -c $< -o $@ | ||
# @echo $^ | ||
# i386-elf-ld -o $@ -Ttext 0x100 $^ --oformat binary | ||
$(OUT): $(OBJFILES) | ||
$(CPP) $(CPPFLAGS) -o $@ $^ | ||
%.o: %.cpp ${HEADERS} | ||
$(info ---------- Generating object files from cpp ----------) | ||
$(CPP) $(CPPFLAGS) -c $< -o $@ | ||
@echo $^ | ||
clean: | ||
$(info ---------- Cleaning ----------) | ||
rm -fr *.bin kernel/*.bin drivers/*.bin boot/*.bin sector_1/*.bin sector_2/*.bin | ||
rm -fr *.o kernel/*.o drivers/*.o boot/*.o | ||
rm -fr *.bin kernel/*.bin drivers/*.bin boot/*.bin boot/*.bin sector_1/*.bin sector_2/*.bin | ||
rm -fr *.o kernel/*.o drivers/*.o boot/*.o | ||
rm -fr *.tmp sector_1/*.tmp sector_2/*.tmp |