stage0-uefi/amd64/mescc-tools-full-kaem.kaem

160 lines
4.5 KiB
Bash

#! /usr/bin/env bash
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
############################################
# Phase-11 Build M2-Planet from M2-Planet #
############################################
./${ARCH_DIR}/artifact/M2.efi --architecture ${ARCH} \
-f ./M2libc/sys/types.h \
-f ./M2libc/stddef.h \
-f ./M2libc/uefi/uefi.c \
-f ./M2libc/string.c \
-f ./M2libc/uefi/fcntl.c \
-f ./M2libc/fcntl.c \
-f ./M2libc/stdio.h \
-f ./M2libc/stdio.c \
-f ./M2libc/sys/utsname.h \
-f ./M2libc/uefi/unistd.c \
-f ./M2libc/uefi/sys/stat.c \
-f ./M2libc/stdlib.c \
-f ./M2libc/ctype.c \
-f ./M2libc/bootstrappable.c \
-f ./M2-Planet/cc.h \
-f ./M2-Planet/cc_globals.c \
-f ./M2-Planet/cc_reader.c \
-f ./M2-Planet/cc_strings.c \
-f ./M2-Planet/cc_types.c \
-f ./M2-Planet/cc_core.c \
-f ./M2-Planet/cc_macro.c \
-f ./M2-Planet/cc.c \
-o ./${ARCH_DIR}/artifact/M2-1.M1
./${ARCH_DIR}/bin/M1.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ./M2libc/${ARCH}/${ARCH}_defs.M1 \
-f ./M2libc/${ARCH}/uefi/libc-full.M1 \
-f ./${ARCH_DIR}/artifact/M2-1.M1 \
-o ./${ARCH_DIR}/artifact/M2-1.hex2
./${ARCH_DIR}/bin/hex2.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ./M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \
-f ./${ARCH_DIR}/artifact/M2-1.hex2 \
-o ./${ARCH_DIR}/bin/M2-Planet.efi
cd ${ARCH_DIR}
###############################################
# Phase-12 Build M2-Mesoplanet from M2-Planet #
###############################################
./bin/M2-Planet.efi --architecture ${ARCH} \
-f ../M2libc/sys/types.h \
-f ../M2libc/stddef.h \
-f ../M2libc/uefi/uefi.c \
-f ../M2libc/string.c \
-f ../M2libc/uefi/fcntl.c \
-f ../M2libc/fcntl.c \
-f ../M2libc/stdio.h \
-f ../M2libc/stdio.c \
-f ../M2libc/sys/utsname.h \
-f ../M2libc/uefi/unistd.c \
-f ../M2libc/uefi/sys/stat.c \
-f ../M2libc/stdlib.c \
-f ../M2libc/ctype.c \
-f ../M2libc/bootstrappable.c \
-f ../M2-Mesoplanet/cc.h \
-f ../M2-Mesoplanet/cc_globals.c \
-f ../M2-Mesoplanet/cc_env.c \
-f ../M2-Mesoplanet/cc_reader.c \
-f ../M2-Mesoplanet/cc_spawn.c \
-f ../M2-Mesoplanet/cc_core.c \
-f ../M2-Mesoplanet/cc_macro.c \
-f ../M2-Mesoplanet/cc.c \
-o ./artifact/M2-Mesoplanet-1.M1
./bin/M1.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/${ARCH}_defs.M1 \
-f ../M2libc/${ARCH}/uefi/libc-full.M1 \
-f ./artifact/M2-Mesoplanet-1.M1 \
-o ./artifact/M2-Mesoplanet-1.hex2
./bin/hex2.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \
-f ./artifact/M2-Mesoplanet-1.hex2 \
-o ./bin/M2-Mesoplanet.efi
#############################################
# Phase-13 Build get_machine from C sources #
#############################################
./bin/M2-Planet.efi --architecture ${ARCH} \
-f ../M2libc/sys/types.h \
-f ../M2libc/stddef.h \
-f ../M2libc/uefi/uefi.c \
-f ../M2libc/string.c \
-f ../M2libc/uefi/fcntl.c \
-f ../M2libc/fcntl.c \
-f ../M2libc/stdio.h \
-f ../M2libc/stdio.c \
-f ../M2libc/sys/utsname.h \
-f ../M2libc/uefi/unistd.c \
-f ../M2libc/stdlib.c \
-f ../M2libc/ctype.c \
-f ../M2libc/bootstrappable.c \
-f ../mescc-tools/get_machine.c \
-o artifact/get_machine.M1
./bin/M1.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/${ARCH}_defs.M1 \
-f ../M2libc/${ARCH}/uefi/libc-full.M1 \
-f ./artifact/get_machine.M1 \
-o ./artifact/get_machine.hex2
./bin/hex2.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \
-f ./artifact/get_machine.hex2 \
-o ./bin/get_machine.efi
#############################################
# Phase-14 Build blood_elf from C sources #
#############################################
./bin/M2-Planet.efi --architecture ${ARCH} \
-f ../M2libc/sys/types.h \
-f ../M2libc/stddef.h \
-f ../M2libc/uefi/uefi.c \
-f ../M2libc/string.c \
-f ../M2libc/uefi/fcntl.c \
-f ../M2libc/fcntl.c \
-f ../M2libc/stdio.h \
-f ../M2libc/stdio.c \
-f ../M2libc/sys/utsname.h \
-f ../M2libc/uefi/unistd.c \
-f ../M2libc/stdlib.c \
-f ../M2libc/ctype.c \
-f ../M2libc/bootstrappable.c \
-f ../mescc-tools/stringify.c \
-f ../mescc-tools/blood-elf.c \
-o artifact/blood-elf.M1
./bin/M1.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/${ARCH}_defs.M1 \
-f ../M2libc/${ARCH}/uefi/libc-full.M1 \
-f ./artifact/blood-elf.M1 \
-o ./artifact/blood-elf.hex2
./bin/hex2.efi --architecture ${ARCH} \
${ENDIAN_FLAG} \
-f ../M2libc/${ARCH}/uefi/PE32-${ARCH}.hex2 \
-f ./artifact/blood-elf.hex2 \
-o ./bin/blood-elf.efi