Ninja-based buildsystem now building a running kernel!

This commit is contained in:
Justin C. Miller
2019-02-02 21:35:39 -08:00
parent acdca19f59
commit bc01a37452
8 changed files with 75 additions and 24 deletions

View File

@@ -31,15 +31,16 @@ ccflags = $
-DVERSION_MAJOR={{ version.major }} $
-DVERSION_MINOR={{ version.minor }} $
-DVERSION_PATCH={{ version.patch }} $
-DVERSION_GITSHA=\"{{ version.sha }}\" $
-DVERSION_GITSHA=0x{% if version.dirty %}1{% else %}0{% endif %}{{ version.sha }} $
-DGIT_VERSION=\"{{ version.major }}.{{ version.minor }}.{{ version.patch }}-{{ version.sha }}\" $
-DGIT_VERSION_WIDE=L\"{{ version.major }}.{{ version.minor }}.{{ version.patch }}-{{ version.sha }}\" $
$warnflags
asflags = $
-DVERSION_MAJOR={{ version.major }} $
-DVERSION_MINOR={{ version.minor }} $
-DVERSION_PATCH={{ version.patch }} $
-DVERSION_GITSHA=\"{{ version.sha }}\"
-DVERSION_GITSHA=0x{% if version.dirty %}1{% else %}0{% endif %}{{ version.sha }}
cflags = -std=c11
cxxflags = -std=c++14
@@ -121,9 +122,6 @@ build $
build $builddir/flash.img : cp $srcroot/assets/ovmf/x64/OVMF.fd
name = flash.img
build $builddir/popcorn.fat : cp $srcroot/assets/ovmf/x64/OVMF.fd
name = flash.img
build $builddir/fatroot/popcorn.elf : cp $builddir/host/popcorn.elf
name = kernel to FAT image

View File

@@ -11,30 +11,32 @@ objcopy = ${srcroot}/sysroot/bin/x86_64-elf-objcopy
{% block variables %}
ccflags = $ccflags $
-D__ELF__ $
-D__POPCORN__ $
-nodefaultlibs $
-nostdinc $
-nostdlib $
-ffreestanding $
-nodefaultlibs $
-fno-builtin $
-mno-sse $
-fno-omit-frame-pointer $
-mno-red-zone $
-g $
-mcmodel=large $
-D__ELF__ $
-D__POPCORN__ $
-isystem${srcroot}/sysroot/include $
--sysroot="${srcroot}/sysroot"
cxxflags = $cxxflags $
-nostdlibinc $
-isystem${srcroot}/sysroot/include/c++/v1 $
-fno-exceptions $
-fno-rtti
-fno-rtti $
-isystem${srcroot}/sysroot/include/c++/v1
ldflags = $ldflags $
-g $
-nostdlib $
-nostartfiles $
-znocombreloc $
-nostartfiles
-Bsymbolic $
-nostartfiles $
-Bstatic
{% endblock %}
# vim: et ts=4 sts=4 sw=4