1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/contrib/gcc-test-suite/Makefile Wed May 19 17:53:04 2010 +0200
1.3 @@ -0,0 +1,75 @@
1.4 +# Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
1.5 +#
1.6 +# Note: Before run please make sure to have your toolchain available in your path.
1.7 +#
1.8 +# Copyright 2010 DoréDevelopment
1.9 +#
1.10 +# Author: Martin Lund <mgl@doredevelopment.dk>
1.11 +#
1.12 +# This program is free software; you can redistribute it and/or modify it
1.13 +# under the terms of the GNU General Public License as published by the
1.14 +# Free Software Foundation; either version 2 of the License, or (at your
1.15 +# option) any later version.
1.16 +#
1.17 +
1.18 +# Internal directory configuration
1.19 +TOPDIR=${shell pwd}
1.20 +TMPDIR=${TOPDIR}/tmp
1.21 +
1.22 +# Include default configuration
1.23 +include default.cfg
1.24 +
1.25 +# Add toolchain to path
1.26 +PATH:=${DG_TOOLCHAIN_DIR}:${PATH}
1.27 +
1.28 +# Select test set
1.29 +ifeq (${DG_TOOLNAME},gcc)
1.30 + DG_TESTS=$(DG_C_TESTS)
1.31 +endif
1.32 +ifeq (${DG_TOOLNAME},g++)
1.33 + DG_TESTS=$(DG_CPP_TESTS)
1.34 +endif
1.35 +
1.36 +# Check that we have 'runtest' installed
1.37 +RUNTEST=$(shell which runtest)
1.38 +ifeq "${RUNTEST}" ""
1.39 + $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)")
1.40 +endif
1.41 +
1.42 +# Targets
1.43 +all: test
1.44 +
1.45 +gcc-testsuite-${DG_GCC_VERSION}.tar.gz:
1.46 +# wget -nc ${DG_GCC_URL}
1.47 +
1.48 +gcc-${DG_GCC_VERSION}: gcc-testsuite-${DG_GCC_VERSION}.tar.gz
1.49 +# tar xzf gcc-testsuite-${DG_GCC_VERSION}.tar.gz
1.50 +
1.51 +config:
1.52 + @mkdir -p ${TMPDIR}
1.53 + @{ echo 'lappend boards_dir "."'; \
1.54 + echo "set target_alias ${DG_TARGET}"; } > ${TMPDIR}/site.exp
1.55 + @{ echo -e "load_generic_config \"unix\""; \
1.56 + echo -e "process_multilib_options \"\"" ; \
1.57 + echo "set_board_info bmk,use_alarm 1" ; \
1.58 + echo "set_board_info rsh_prog ssh" ; \
1.59 + echo "set_board_info rcp_prog scp" ; \
1.60 + echo "set_board_info hostname ${DG_TARGET_HOSTNAME}"; \
1.61 + echo "set_board_info username ${DG_TARGET_USERNAME}"; } > ${TMPDIR}/board.exp
1.62 +
1.63 +test: gcc-${DG_GCC_VERSION} config
1.64 + cd ${TMPDIR} && \
1.65 + runtest --tool ${DG_TOOLNAME} \
1.66 + --srcdir ${DG_SRC_DIR} \
1.67 + --all \
1.68 + --target ${DG_TARGET} \
1.69 + --target_board board \
1.70 + ${DG_TESTS} \
1.71 + GXX_UNDER_TEST=${DG_TARGET}-g++ ; \
1.72 + mv ${TMPDIR}/*.log ${TOPDIR} ; \
1.73 + mv ${TMPDIR}/*.sum ${TOPDIR}
1.74 +
1.75 +clean:
1.76 + rm -rf gcc-testsuite-${DG_GCC_VERSION}.tar.gz gcc-${DG_GCC_VERSION} ${TMPDIR} *.log *.sum
1.77 +
1.78 +.PHONY: config test clean