mirror of
https://github.com/xomboverlord/xomb-bare-bones.git
synced 2026-01-11 18:33:15 +01:00
72 lines
2.5 KiB
Plaintext
72 lines
2.5 KiB
Plaintext
name = xomb
|
|
|
|
CC = x86_64-pc-elf-gcc
|
|
CFLAGS = -nostdlib -nodefaultlibs -g -DUSE_ASSERT -mcmodel=kernel
|
|
|
|
[*]
|
|
buildflags=-dc=ldc-xomb
|
|
|
|
[../kernel/core/kmain.d]
|
|
|
|
buildflags=-dc=ldc-xomb -I..
|
|
|
|
# compile the assembly for the target
|
|
|
|
prebuild= \
|
|
\
|
|
\
|
|
echo ; \
|
|
echo Setting up Architecture Dependence: x86_64; \
|
|
echo '--> architecture.d';\
|
|
mkdir -p dsss_imports;\
|
|
cp ../kernel/arch/x86_64/imports/architecture.d dsss_imports/.;\
|
|
echo ; \
|
|
echo Compiling Assembly for target: x86_64 ;\
|
|
echo '--> boot.S';\
|
|
yasm -o dsss_objs/G/kernel.arch.x86_64.boot.boot.o ../kernel/arch/x86_64/boot/boot.s -felf64;\
|
|
echo '--> load.S';\
|
|
yasm -o dsss_objs/G/kernel.arch.x86_64.load.load.o ../kernel/arch/x86_64/boot/load.s -felf64;\
|
|
\
|
|
\
|
|
echo ; \
|
|
echo Compiling Kernel Runtime ; \
|
|
echo '--> kernel/runtime/object.d';\
|
|
ldc -nodefaultlib -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/object.d -ofdsss_objs/G/kernel.runtime.object.o; \
|
|
echo '--> kernel/runtime/invariant.d';\
|
|
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/invariant.d -ofdsss_objs/G/kernel.runtime.invariant.o; \
|
|
echo '--> kernel/runtime/std/typeinfo/*';\
|
|
sh ./compile_typeinfo.sh;\
|
|
echo '--> kernel/runtime/dstubs.d';\
|
|
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/dstubs.d -ofdsss_objs/G/kernel.runtime.dstubs.o ;\
|
|
echo '--> kernel/runtime/util.d';\
|
|
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/util.d -ofdsss_objs/G/kernel.runtime.util.o ;\
|
|
echo '--> kernel/runtime/std/moduleinit.d';\
|
|
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/std/moduleinit.d -ofdsss_objs/G/kernel.runtime.std.moduleinit.o ;\
|
|
\
|
|
echo ; \
|
|
echo Compiling Kernel Proper ;
|
|
|
|
# what the target is
|
|
|
|
target = xomb.iso
|
|
|
|
# we will need some post build foo to link and create the iso
|
|
|
|
postbuild = \
|
|
\
|
|
echo ; \
|
|
echo Creating Kernel Executable; \
|
|
echo '--> xomb';\
|
|
#llvm-ld -native -Xlinker=-nostdlib -Xlinker=-Tlinker.ld -Xlinker="-b elf64-x86-64" `ls dsss_objs/G/*.o` -o iso/boot/xomb ; \
|
|
#llvm-ld -nodefaultlib -g -I.. -I../kernel/runtime/. `ls dsss_objs/G/*.o` ;\
|
|
ld -nostdlib -nodefaultlibs -b elf64-x86-64 -T ../kernel/arch/x86_64/linker.ld -o iso/boot/xomb `ls dsss_objs/G/*.o`;\
|
|
\
|
|
echo ;\
|
|
echo Creating Kernel Dump; \
|
|
echo '--> xomb.dump';\
|
|
rm -f xomb.dump && objdump -d -S -r iso/boot/xomb > xomb.dump;\
|
|
\
|
|
echo ;\
|
|
echo Compiling ISO; \
|
|
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 16 -boot-info-table -input-charset UTF-8 -o xomb.iso ./iso
|