From 68c26a741bd34a20459b6bd8e29445169a62c96e Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Tue, 31 Dec 2013 16:44:04 +0100 Subject: [PATCH] Cleanup make files --- Makefile | 15 ++++++--------- bootloader/Makefile | 17 ++++------------- bootloader/compute_sectors.bash | 9 --------- fill.bash | 6 ------ 4 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 bootloader/compute_sectors.bash delete mode 100644 fill.bash diff --git a/Makefile b/Makefile index c70f4e47..696190b9 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,17 @@ -.PHONY: default clean force_look qemu bochs debug sectors +.PHONY: default clean force_look qemu bochs debug default: thor.flp kernel/kernel.bin: force_look cd kernel; $(MAKE) -filler.bin: kernel/kernel.bin - bash fill.bash +bootloader/stage1.bin: force_look + cd bootloader; $(MAKE) stage1.bin -sectors: force_look filler.bin - cd bootloader; $(MAKE) sectors +bootloader/stage2.bin: force_look + cd bootloader; $(MAKE) stage2.bin -bootloader/bootloader.bin: force_look sectors - cd bootloader; $(MAKE) - -thor.flp: bootloader/bootloader.bin +thor.flp: bootloader/stage1.bin bootloader/stage2.bin kernel/kernel.bin dd if=bootloader/stage1.bin of=hdd.img conv=notrunc dd if=bootloader/stage2.bin of=hdd.img seek=1 conv=notrunc sudo /sbin/losetup -o1048576 /dev/loop0 hdd.img diff --git a/bootloader/Makefile b/bootloader/Makefile index 01152819..04c10afd 100644 --- a/bootloader/Makefile +++ b/bootloader/Makefile @@ -1,23 +1,14 @@ -default: bootloader.bin +default: all -.PHONY: sectors clean - -sectors: - bash compute_sectors.bash +.PHONY: all clean stage1.bin: stage1.asm nasm -w+all -f bin -o stage1.bin stage1.asm -stage2.bin: stage2.asm sectors.asm +stage2.bin: stage2.asm nasm -w+all -f bin -o stage2.bin stage2.asm -#padding.bin: -# dd if=/dev/zero of=padding.bin bs=512 count=34 - -bootloader.bin: stage1.bin stage2.bin - cat stage1.bin > bootloader.bin - cat stage2.bin >> bootloader.bin -# cat padding.bin >> bootloader.bin +all: stage1.bin stage2.bin clean: rm -f stage1.bin diff --git a/bootloader/compute_sectors.bash b/bootloader/compute_sectors.bash deleted file mode 100644 index c2a5d2fe..00000000 --- a/bootloader/compute_sectors.bash +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -size_1=`stat -c%s ../kernel/kernel.bin` -size_2=`stat -c%s ../filler.bin` - -total_size=$(( $size_1 + $size_2 )) -sectors=$(( $total_size / 512 )) - -echo "sectors equ $sectors" > sectors.asm diff --git a/fill.bash b/fill.bash deleted file mode 100644 index c26190d6..00000000 --- a/fill.bash +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -size=`stat -c%s kernel/kernel.bin` -better_size=$(( ($size / 512 + 1) * 512 )) -let filler_size=$better_size-$size -dd if=/dev/zero of=filler.bin bs=1 count=$filler_size