diff options
author | Marvin Borner | 2019-09-22 01:48:01 +0200 |
---|---|---|
committer | Marvin Borner | 2019-09-22 01:48:01 +0200 |
commit | 5bc3e8c3553b749d848169de7177b238f4396f9b (patch) | |
tree | 4f57ad76a2e75191f928c3004780ba705124de4b /build.sh | |
parent | d9324456b4dd4b3a520534fa7a2996358d3484f0 (diff) |
Moved shell files into Makefile
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/build.sh b/build.sh deleted file mode 100755 index f09a705..0000000 --- a/build.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env sh -# Builds the operating system image - -# Install and source cross compiler if not already installed -. ./cross.sh - -# Create build directories -rm -rf ./build/ ./iso/ -mkdir ./build/ - -# Assemble ASM files -nasm -f elf ./src/kernel/boot.asm -o ./build/boot.o || exit - -# Make all C files -files="" -find ./src/kernel/ -name \*.c >./build/tmp -while read -r line; do - stripped=$(echo "${line}" | sed -r 's/\//_/g') - stripped=${stripped#??????} - stripped=${stripped%%?}o - i686-elf-gcc -c ./"${line}" -o ./build/"${stripped}" -std=gnu99 -ffreestanding -O2 -Wall -Wextra || exit - files="${files} ./build/${stripped}" -done <./build/tmp -rm ./build/tmp - -# shellcheck disable=SC2086 -# Shellcheck suppression is needed because gcc would think that $files is one file -i686-elf-gcc -T ./src/kernel/linker.ld -o ./build/melvix.bin -ffreestanding -O2 -nostdlib ./build/boot.o $files -lgcc || exit - -# Testing -if grub-file --is-x86-multiboot ./build/melvix.bin; then - echo Multiboot confirmed -else - echo Melvix has errors and won\'t be able to multi boot! - exit -fi - -# Create ISO -mkdir -p ./iso/boot/grub -cp ./build/melvix.bin ./iso/boot/ -cp ./src/kernel/grub.cfg ./iso/boot/grub/ -grub-mkrescue -o ./build/melvix.iso ./iso/ - -# Run ISO -qemu-system-x86_64 -soundhw pcspk -enable-kvm -cdrom ./build/melvix.iso |