diff options
author | iximeow <me@iximeow.net> | 2015-09-28 02:39:24 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2015-09-28 03:36:28 -0700 |
commit | afeac47a0192e0124006e13d6a098668903589fb (patch) | |
tree | 00a5333fae549ff29b5bb740edbf33194bc4f1e7 | |
parent | 766583fff1012b6c9c7eac59d4df002cf253b160 (diff) |
build hacks to support multi-file builds
-rwxr-xr-x | build | 6 | ||||
-rwxr-xr-x | build_helpers/compile.sh | 5 |
2 files changed, 5 insertions, 6 deletions
@@ -2,10 +2,8 @@ set -u set -e -sources=$(find src -type f) -for source in $sources; do - build_helpers/compile.sh "$source" -done +sources=$(find src -type f -name "*.c") +build_helpers/compile.sh "$sources" build_helpers/bootloader.sh build_helpers/splicetobootsect.sh bin/bootloader.bin diff --git a/build_helpers/compile.sh b/build_helpers/compile.sh index 90c2ee2..40cd293 100755 --- a/build_helpers/compile.sh +++ b/build_helpers/compile.sh @@ -5,9 +5,10 @@ set -e INPATH="$1" INBASEPATH="${INPATH%.*}" # mangle such that no two names conflict (a/b/c and a/b.c conflicting would be no fun) -OUTNAME="$(echo "$INBASEPATH" | sed 's/\./../g' | sed 's/\//._/g')" +#OUTNAME="$(echo "$INBASEPATH" | sed 's/\./../g' | sed 's/\//._/g')" +OUTNAME="src._kernel._main" echo -n "[*] Building '$INPATH' to 'tmp/$OUTNAME'... " -gcc -T linker.ld -m32 -Wl,--build-id=none -nostartfiles -nostdlib -ffreestanding "$INPATH" -o "tmp/$OUTNAME".o +gcc -T linker.ld -m32 -Wl,--build-id=none -nostartfiles -nostdlib -ffreestanding $INPATH -o "tmp/$OUTNAME".o echo " OK!" echo -n "[+] Stripping unnecessary sections... " objcopy -R .note.gnu.build-id -R .comment -O binary "tmp/$OUTNAME".o "bin/$OUTNAME".bin |