M2-Planet/test/test25/hello-x86.sh

57 lines
1.7 KiB
Bash
Raw Normal View History

2018-10-17 21:08:04 +01:00
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## M2-Planet is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
2018-10-17 21:08:04 +01:00
set -x
# Build the test
2019-02-24 01:18:53 +00:00
./bin/M2-Planet --architecture x86 -f test/common_x86/functions/exit.c \
2019-03-01 01:52:01 +00:00
-f test/common_x86/functions/file.c \
2018-10-17 21:08:04 +01:00
-f functions/file_print.c \
2019-02-24 22:46:05 +00:00
-f test/common_x86/functions/malloc.c \
2018-10-17 21:08:04 +01:00
-f functions/calloc.c \
-f functions/match.c \
-f functions/in_set.c \
2018-10-17 21:08:04 +01:00
-f functions/numerate_number.c \
2019-03-30 13:25:52 +00:00
-f test/common_x86/functions/fork.c \
-f test/common_x86/functions/execve.c \
2018-10-17 21:08:04 +01:00
-f test/test25/kaem.c \
--debug \
-o test/test25/kaem.M1 || exit 1
# Build debug footer
blood-elf -f test/test25/kaem.M1 \
-o test/test25/kaem-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_x86/x86_defs.M1 \
-f test/common_x86/libc-core.M1 \
2018-10-17 21:08:04 +01:00
-f test/test25/kaem.M1 \
-f test/test25/kaem-footer.M1 \
--LittleEndian \
--architecture x86 \
2018-10-17 21:08:04 +01:00
-o test/test25/kaem.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_x86/ELF-i386-debug.hex2 \
-f test/test25/kaem.hex2 \
--LittleEndian \
--architecture x86 \
2018-10-17 21:08:04 +01:00
--BaseAddress 0x8048000 \
-o test/results/test25-binary \
--exec_enable || exit 4
exit 0