From 746291dc676c0fe0e7e974fcdad5df436aa880f8 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sun, 11 Jul 2021 15:45:50 -0700 Subject: [PATCH] [scripts] Remove old build templates The old bonnibel 2.x's jinja templates didn't get removed when switching to the new bonnibel 3.x. --- scripts/templates/build.ninja.j2 | 214 ---------------------------- scripts/templates/exe.boot.j2 | 14 -- scripts/templates/exe.default.j2 | 8 -- scripts/templates/exe.kernel.j2 | 13 -- scripts/templates/exe.makerd.j2 | 10 -- scripts/templates/exe.tests.j2 | 10 -- scripts/templates/lib.default.j2 | 4 - scripts/templates/module.base.j2 | 45 ------ scripts/templates/target.boot.j2 | 38 ----- scripts/templates/target.default.j2 | 31 ---- scripts/templates/target.host.j2 | 44 ------ scripts/templates/target.native.j2 | 15 -- scripts/templates/target.user.j2 | 45 ------ 13 files changed, 491 deletions(-) delete mode 100644 scripts/templates/build.ninja.j2 delete mode 100644 scripts/templates/exe.boot.j2 delete mode 100644 scripts/templates/exe.default.j2 delete mode 100644 scripts/templates/exe.kernel.j2 delete mode 100644 scripts/templates/exe.makerd.j2 delete mode 100644 scripts/templates/exe.tests.j2 delete mode 100644 scripts/templates/lib.default.j2 delete mode 100644 scripts/templates/module.base.j2 delete mode 100644 scripts/templates/target.boot.j2 delete mode 100644 scripts/templates/target.default.j2 delete mode 100644 scripts/templates/target.host.j2 delete mode 100644 scripts/templates/target.native.j2 delete mode 100644 scripts/templates/target.user.j2 diff --git a/scripts/templates/build.ninja.j2 b/scripts/templates/build.ninja.j2 deleted file mode 100644 index 8ab68b7..0000000 --- a/scripts/templates/build.ninja.j2 +++ /dev/null @@ -1,214 +0,0 @@ -ninja_required_version = 1.3 -builddir = {{ buildroot }} -srcroot = {{ srcroot }} -modulefile = {{ modulefile }} - -{%- for var, value in vars %} -{{ var }} = {{ value }} -{%- endfor %} - -warnflags = $ - -Wformat=2 $ - -Winit-self $ - -Wfloat-equal $ - -Winline $ - -Wmissing-format-attribute $ - -Wmissing-include-dirs $ - -Wswitch $ - -Wundef $ - -Wdisabled-optimization $ - -Wpointer-arith $ - -Wno-attributes $ - -Wno-sign-compare $ - -Wno-multichar $ - -Wno-div-by-zero $ - -Wno-endif-labels $ - -Wno-pragmas $ - -Wno-format-extra-args $ - -Wno-unused-result $ - -Wno-deprecated-declarations $ - -Wno-unused-function $ - -Wno-address-of-packed-member $ - -Werror - -ccflags = $ - -I${srcroot}/src/include $ - -I${srcroot}/src/include/x86_64 $ - -fcolor-diagnostics $ - -DVERSION_MAJOR={{ version_major }} $ - -DVERSION_MINOR={{ version_minor }} $ - -DVERSION_PATCH={{ version_patch }} $ - -DVERSION_GITSHA=0x0{{ version_sha }} $ - -DGIT_VERSION=\"{{ version }}\" $ - -DGIT_VERSION_WIDE=L\"{{ version }}\" $ - $warnflags - -asflags = $ - -DVERSION_MAJOR={{ version_major }} $ - -DVERSION_MINOR={{ version_minor }} $ - -DVERSION_PATCH={{ version_patch }} $ - -DVERSION_GITSHA=0x{{ version_sha }} $ - -I${srcroot}/src/include - -cflags = -std=c11 -cxxflags = -std=c++17 -libs = - -rule c - deps = gcc - depfile = $out.d - description = Compiling $name - command = $cc -MMD -MF $out.d $ccflags $cflags -o $out -c $in - -rule dump_c_defs - description = Dumping C defines for $target - command = echo "" | $cc $ccflags $cflags -dM -E - > $out - -rule dump_c_run - description = Dumping C arguments for $target - command = $ - echo "#!/bin/bash" > $out; $ - echo '$cc $ccflags $cflags $$*' >> $out; $ - chmod a+x $out - -rule cpp - deps = gcc - depfile = $out.d - description = Compiling $name - command = $cxx -MMD -MF $out.d $cxxflags $ccflags -o $out -c $in - -rule dump_cpp_defs - description = Dumping C++ defines for $target - command = echo "" | $cxx -x c++ $cxxflags $ccflags -dM -E - > $out - -rule dump_cpp_run - description = Dumping C++ arguments for $target - command = $ - echo "#!/bin/bash" > $out; $ - echo '$cc $cxxflags $ccflags $$*' >> $out; $ - chmod a+x $out - -rule s - deps = gcc - depfile = $out.d - description = Assembling $name - command = $nasm -o $out -felf64 -MD $out.d $asflags $in - -rule exe - description = Linking $name - command = $ld $ldflags -o $out $in $libs - -rule lib - description = Archiving $name - command = $ar qcs $out $in - -rule regen - generator = true - description = Regenrating build files - command = $ - {{ generator }} $ - --file $modulefile $ - --dir $builddir $ - generate - -rule cp - description = Copying $name - command = cp $in $out - -rule dump - description = Dumping decompiled $name - command = objdump -DSC -M intel $in > $out - -rule makest - description = Making symbol table - command = nm $in | ${srcroot}/scripts/build_symbol_table.py $out - -rule makeefi - description = Converting $name - command = objcopy $ - -j .text $ - -j .sdata $ - -j .data $ - -j .dynamic $ - -j .dynsym $ - -j .rel $ - -j .rela $ - -j .reloc $ - --target=efi-app-x86_64 $ - $in $out - -rule makefat - description = Creating $name - command = $ - cp $srcroot/assets/diskbase.img $out; $ - mcopy -s -D o -i $out@@1M $builddir/fatroot/* ::/ - -rule strip - description = Stripping $name - command = $ - cp $in $out; $ - objcopy --only-keep-debug $out $out.debug; $ - strip -g $out; $ - objcopy --add-gnu-debuglink=$out.debug $out - -{% for target in targets %} -subninja {{ target }}/target.ninja -{% endfor %} - -build $ - {%- for buildfile in buildfiles %} - {{ buildfile }} $ - {%- endfor %} - : regen | $ - {%- for template in templates %} - {{ template }} $ - {%- endfor %} - $modulefile $ - {{ generator }} - -build $builddir/ovmf_vars.fd : cp $srcroot/assets/ovmf/x64/ovmf_vars.fd - name = ovmf_vars.fd - -build $builddir/ovmf_vars_d.fd : cp $srcroot/assets/ovmf/x64/ovmf_vars_d.fd - name = ovmf_vars_d.fd - -build $builddir/jsix.elf | $builddir/jsix.elf.debug : strip $builddir/host/jsix.elf - name = kernel - -build $builddir/jsix.dump : dump $builddir/host/jsix.elf - name = kernel - -build $builddir/jsix.elf-gdb.py : cp ${srcroot}/assets/debugging/jsix.elf-gdb.py - name = kernel debug python scripts - -build $builddir/fatroot/jsix.elf : cp $builddir/jsix.elf - name = kernel to FAT image - -build $builddir/fatroot/efi/boot/bootx64.efi : cp $builddir/boot/boot.efi - name = bootloader to FAT image - -build $builddir/fatroot/nulldrv.elf : cp $builddir/user/nulldrv.elf - name = null driver to FAT image - -build $builddir/fatroot/fb.elf : cp $builddir/user/fb.elf - name = fb driver to FAT image - -build ${builddir}/fatroot/symbol_table.dat : makest ${builddir}/jsix.elf - -build $builddir/jsix.img : makefat | $ - $builddir/fatroot/symbol_table.dat $ - $builddir/fatroot/nulldrv.elf $ - $builddir/fatroot/fb.elf $ - $builddir/fatroot/jsix.elf $ - $builddir/fatroot/efi/boot/bootx64.efi - name = jsix.img - -default $ - $builddir/ovmf_vars.fd $ - $builddir/ovmf_vars_d.fd $ - $builddir/jsix.dump $ - $builddir/jsix.elf-gdb.py $ - $builddir/jsix.img - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/exe.boot.j2 b/scripts/templates/exe.boot.j2 deleted file mode 100644 index c4be386..0000000 --- a/scripts/templates/exe.boot.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "exe.default.j2" %} -{% block variables %} -{{ super() }} - -ccflags = $ccflags $ - -g3 $ - -DKERNEL_FILENAME=L\"jsix.elf\" $ - -I${srcroot}/external/include $ - -I${srcroot}/external/include/X64 - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/exe.default.j2 b/scripts/templates/exe.default.j2 deleted file mode 100644 index 90c7395..0000000 --- a/scripts/templates/exe.default.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "module.base.j2" %} -{% block variables %} -{{ super() }} - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/exe.kernel.j2 b/scripts/templates/exe.kernel.j2 deleted file mode 100644 index 174deed..0000000 --- a/scripts/templates/exe.kernel.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "exe.default.j2" %} -{% block variables %} -{{ super() }} - -asflags = $asflags -I${srcroot}/src/kernel/ -libs = $libs -ldflags = $ldflags -T ${srcroot}/src/arch/x86_64/kernel.ld -ccflags = $ccflags -I${srcroot}/external - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/exe.makerd.j2 b/scripts/templates/exe.makerd.j2 deleted file mode 100644 index 1a8e4ba..0000000 --- a/scripts/templates/exe.makerd.j2 +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "exe.default.j2" %} -{% block variables %} -{{ super() }} - -ccflags = $ccflags -I${srcroot}/external/cpptoml - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/exe.tests.j2 b/scripts/templates/exe.tests.j2 deleted file mode 100644 index 53aced0..0000000 --- a/scripts/templates/exe.tests.j2 +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "exe.default.j2" %} -{% block variables %} -{{ super() }} - -ccflags = $ccflags -ggdb -I${srcroot}/external/catch - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/lib.default.j2 b/scripts/templates/lib.default.j2 deleted file mode 100644 index ccc74b7..0000000 --- a/scripts/templates/lib.default.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "module.base.j2" %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/module.base.j2 b/scripts/templates/module.base.j2 deleted file mode 100644 index d5fcd0c..0000000 --- a/scripts/templates/module.base.j2 +++ /dev/null @@ -1,45 +0,0 @@ -moddir = ${builddir}/{{ name }}.dir - -{% block variables %} -ccflags = $ccflags $ - {%- for dep in depmods %} - {%- for inc in dep.includes %} - -I${srcroot}/{{ inc }} $ - {%- endfor %} - {%- endfor %} - {%- for inc in module.includes %} - -I${srcroot}/{{ inc }} $ - {%- endfor %} - {%- for define in module.defines %} - -D{{ define }} $ - {%- endfor %} -{% endblock %} - -{% for source in module.source %} -build ${moddir}/{{ source.output }} : {{ source.action }} ${srcroot}/{{ source.input }} || {{ buildfile }} - name = {{ source.name }} -{% endfor %} - -build ${builddir}/{{ module.output }} : {{ module.kind }} $ -{%- for source in module.source %} - ${moddir}/{{ source.output }} $ -{%- endfor -%} -{%- for dep in deplibs %} - ${builddir}/{{ dep.output }} $ -{%- endfor %} - | $ -{%- for dep in depexes %} - ${builddir}/{{ dep.output }} $ -{%- endfor %} - {{ buildfile }} - name = {{ name }} - -{% if module.default %} -default ${builddir}/{{ module.output }} -{% endif %} - -{% block extra %} -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/target.boot.j2 b/scripts/templates/target.boot.j2 deleted file mode 100644 index b72bc13..0000000 --- a/scripts/templates/target.boot.j2 +++ /dev/null @@ -1,38 +0,0 @@ -{% extends "target.default.j2" %} - -{% block binaries %} -cc = clang -cxx = clang++ -ld = clang++ -ar = ar -nasm = nasm -objcopy = objcopy -{% endblock %} - -{% block variables %} - -ccflags = $ccflags $ - -I $srcroot/external $ - --target=x86_64-unknown-windows $ - -ffreestanding $ - -mno-red-zone $ - -fshort-wchar $ - -fno-omit-frame-pointer $ - -ggdb - -cxxflags = $cxxflags $ - -fno-rtti $ - -fno-exceptions - -ldflags = $ldflags $ - --target=x86_64-unknown-windows $ - -nostdlib $ - -Wl,-entry:efi_main $ - -Wl,-subsystem:efi_application $ - -fuse-ld=lld-link $ - -g - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/target.default.j2 b/scripts/templates/target.default.j2 deleted file mode 100644 index 62e6597..0000000 --- a/scripts/templates/target.default.j2 +++ /dev/null @@ -1,31 +0,0 @@ -builddir = $builddir/{{ target }} -target = {{ target }} - -{% block variables %} -{% endblock %} - -{% block binaries %} -cc = clang -cxx = clang++ -ld = ld -ar = ar -nasm = nasm -objcopy = objcopy -{% endblock %} - -{% for module in modules %} -subninja {{ module }}.ninja -{% endfor %} - -build ${builddir}/c.defs : dump_c_defs | {{ buildfile }} -build ${builddir}/cpp.defs : dump_cpp_defs | {{ buildfile }} -build ${builddir}/c.run : dump_c_run | {{ buildfile }} -build ${builddir}/cpp.run : dump_cpp_run | {{ buildfile }} - -default ${builddir}/c.defs -default ${builddir}/cpp.defs -default ${builddir}/c.run -default ${builddir}/cpp.run - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/target.host.j2 b/scripts/templates/target.host.j2 deleted file mode 100644 index c8a6db4..0000000 --- a/scripts/templates/target.host.j2 +++ /dev/null @@ -1,44 +0,0 @@ -{% extends "target.default.j2" %} - -{% block binaries %} -cc = ${srcroot}/sysroot/bin/clang -cxx = ${srcroot}/sysroot/bin/clang++ -ld = ${srcroot}/sysroot/bin/ld.lld -ar = ${srcroot}/sysroot/bin/ar -nasm = nasm -objcopy = ${srcroot}/sysroot/bin/objcopy -{% endblock %} - -{% block variables %} - -ccflags = $ccflags $ - -nostdlib $ - -ffreestanding $ - -nodefaultlibs $ - -fno-builtin $ - -mno-sse $ - -fno-omit-frame-pointer $ - -mno-red-zone $ - -g $ - -mcmodel=large $ - -D__ELF__ $ - -D__JSIX__ $ - -isystem${srcroot}/sysroot/include $ - -isystem${srcroot}/src/libraries/libc/include $ - --sysroot="${srcroot}/sysroot" - -cxxflags = $cxxflags $ - -fno-exceptions $ - -fno-rtti $ - -isystem${srcroot}/sysroot/include/c++/v1 - -ldflags = $ldflags $ - -g $ - -nostdlib $ - -Bsymbolic $ - -Bstatic - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/target.native.j2 b/scripts/templates/target.native.j2 deleted file mode 100644 index 8127cc5..0000000 --- a/scripts/templates/target.native.j2 +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "target.default.j2" %} - -{% block binaries %} -{{ super() }} -ld = clang++ -{% endblock %} - -{% block variables %} - -ccflags = $ccflags -g -ggdb - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 - diff --git a/scripts/templates/target.user.j2 b/scripts/templates/target.user.j2 deleted file mode 100644 index 28ca47e..0000000 --- a/scripts/templates/target.user.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{% extends "target.default.j2" %} - -{% block binaries %} -cc = ${srcroot}/sysroot/bin/clang -cxx = ${srcroot}/sysroot/bin/clang++ -ld = ${srcroot}/sysroot/bin/ld.lld -ar = ${srcroot}/sysroot/bin/ar -nasm = nasm -objcopy = ${srcroot}/sysroot/bin/objcopy -{% endblock %} - -{% block variables %} - -ccflags = $ccflags $ - -nostdlib $ - -nodefaultlibs $ - -fno-builtin $ - -mno-sse $ - -fno-omit-frame-pointer $ - -mno-red-zone $ - -g $ - -mcmodel=large $ - -D__ELF__ $ - -D__JSIX__ $ - -isystem${srcroot}/sysroot/include $ - -isystem${srcroot}/src/libraries/libc/include $ - --sysroot="${srcroot}/sysroot" - -cxxflags = $cxxflags $ - -fno-exceptions $ - -fno-rtti $ - -isystem${srcroot}/sysroot/include/c++/v1 - -ldflags = $ldflags $ - -g $ - -nostdlib $ - -Bsymbolic $ - -Bstatic $ - --sysroot="${srcroot}/sysroot" $ - -L "${srcroot}/sysroot/lib" $ - -{% endblock %} - -# vim: ft=ninja et ts=4 sts=4 sw=4 -