aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorMarvin Borner2019-09-14 20:17:46 +0200
committerMarvin Borner2019-09-14 20:17:46 +0200
commit8bb8ed3f9e7d5edb4457a7fade7dbe215bd421d2 (patch)
treedd319a93d2648a7d4578f9cec7d9e13db4fe5758 /build.sh
parentc0069e4bf3492b66808c424ed863898e0a1c1acf (diff)
Abstracted VGA driver
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index e0c6270..d41c54f 100755
--- a/build.sh
+++ b/build.sh
@@ -10,8 +10,17 @@ mkdir ./build/
# Make source files
i686-elf-as ./src/boot.s -o ./build/boot.o
-i686-elf-gcc -c ./src/kernel.c -o ./build/kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
-i686-elf-gcc -T ./src/linker.ld -o ./build/melvix.bin -ffreestanding -O2 -nostdlib ./build/boot.o ./build/kernel.o -lgcc
+
+files=""
+for line in $(find ./src -name \*.c); 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
+ files="${files} ./build/${stripped}"
+done
+
+i686-elf-gcc -T ./src/linker.ld -o ./build/melvix.bin -ffreestanding -O2 -nostdlib ./build/boot.o $files -lgcc
# Testing
if grub-file --is-x86-multiboot ./build/melvix.bin; then