Created
May 13, 2013 02:21
-
-
Save rve/5565820 to your computer and use it in GitHub Desktop.
os6.hd.makefile
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
################################################## | |
# Makefile | |
################################################## | |
ASM = nasm | |
BOOT:=boot.asm | |
BOOT_BIN:=$(subst .asm,.bin,$(BOOT)) | |
objects = loader.bin kernel.bin a.bin b.bin c.bin d.bin | |
IMG:=a.img | |
FLOPPY:=/mnt/floppy/ | |
.PHONY : run generate myos dos clean | |
everything: $(objects) | |
$(objects): %.bin: %.asm | |
$(ASM) $< -o $@ | |
$(BOOT_BIN) : $(BOOT) | |
nasm $< -o $@ | |
run : $(BOOT_BIN) $(everything) | |
make everything | |
dd if=$(BOOT_BIN) of=$(IMG) bs=512 count=1 conv=notrunc | |
@sudo mount -o loop $(IMG) $(FLOPPY) | |
@$(foreach n, $(objects), sudo cp $(n) $(FLOPPY) -v;) | |
sudo umount $(FLOPPY) | |
cp .myos-bochsrc bochsrc | |
bochs -q | |
myos : | |
cp .myos-bochsrc bochsrc | |
bochs -q | |
dos : | |
cp .dos-bochsrc bochsrc | |
bochs -q | |
generate: | |
gzip -cd a.img.gz > a.img | |
gzip -cd FDOS11.img.gz > FDOS11.img | |
clean : | |
-rm *.bin *.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment