mgl@1965: # Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu) mgl@1965: # mgl@1965: # Note: Before run please make sure to have your toolchain available in your path. mgl@1965: # mgl@1965: # Copyright 2010 DoréDevelopment mgl@1965: # mgl@1965: # Author: Martin Lund mgl@1965: # mgl@1965: # This program is free software; you can redistribute it and/or modify it mgl@1965: # under the terms of the GNU General Public License as published by the mgl@1965: # Free Software Foundation; either version 2 of the License, or (at your mgl@1965: # option) any later version. mgl@1965: # mgl@1965: mgl@1965: # Internal directory configuration mgl@1965: TOPDIR=${shell pwd} mgl@1965: TMPDIR=${TOPDIR}/tmp mgl@1965: mgl@1965: # Include default configuration mgl@1965: include default.cfg mgl@1965: mgl@1965: # Add toolchain to path mgl@1965: PATH:=${DG_TOOLCHAIN_DIR}:${PATH} mgl@1965: mgl@1965: # Select test set mgl@1965: ifeq (${DG_TOOLNAME},gcc) mgl@1965: DG_TESTS=$(DG_C_TESTS) mgl@1965: endif mgl@1965: ifeq (${DG_TOOLNAME},g++) mgl@1965: DG_TESTS=$(DG_CPP_TESTS) mgl@1965: endif mgl@1965: mgl@1965: # Check that we have 'runtest' installed mgl@1965: RUNTEST=$(shell which runtest) mgl@1965: ifeq "${RUNTEST}" "" mgl@1965: $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)") mgl@1965: endif mgl@1965: mgl@1965: # Targets mgl@1965: all: test mgl@1965: mgl@1965: gcc-testsuite-${DG_GCC_VERSION}.tar.gz: mgl@1965: # wget -nc ${DG_GCC_URL} mgl@1965: mgl@1965: gcc-${DG_GCC_VERSION}: gcc-testsuite-${DG_GCC_VERSION}.tar.gz mgl@1965: # tar xzf gcc-testsuite-${DG_GCC_VERSION}.tar.gz mgl@1965: mgl@1965: config: mgl@1965: @mkdir -p ${TMPDIR} mgl@1965: @{ echo 'lappend boards_dir "."'; \ mgl@1965: echo "set target_alias ${DG_TARGET}"; } > ${TMPDIR}/site.exp mgl@1965: @{ echo -e "load_generic_config \"unix\""; \ mgl@1965: echo -e "process_multilib_options \"\"" ; \ mgl@1965: echo "set_board_info bmk,use_alarm 1" ; \ mgl@1965: echo "set_board_info rsh_prog ssh" ; \ mgl@1965: echo "set_board_info rcp_prog scp" ; \ mgl@1965: echo "set_board_info hostname ${DG_TARGET_HOSTNAME}"; \ mgl@1965: echo "set_board_info username ${DG_TARGET_USERNAME}"; } > ${TMPDIR}/board.exp mgl@1965: mgl@1965: test: gcc-${DG_GCC_VERSION} config mgl@1965: cd ${TMPDIR} && \ mgl@1965: runtest --tool ${DG_TOOLNAME} \ mgl@1965: --srcdir ${DG_SRC_DIR} \ mgl@1965: --all \ mgl@1965: --target ${DG_TARGET} \ mgl@1965: --target_board board \ mgl@1965: ${DG_TESTS} \ mgl@1965: GXX_UNDER_TEST=${DG_TARGET}-g++ ; \ mgl@1965: mv ${TMPDIR}/*.log ${TOPDIR} ; \ mgl@1965: mv ${TMPDIR}/*.sum ${TOPDIR} mgl@1965: mgl@1965: clean: mgl@1965: rm -rf gcc-testsuite-${DG_GCC_VERSION}.tar.gz gcc-${DG_GCC_VERSION} ${TMPDIR} *.log *.sum mgl@1965: mgl@1965: .PHONY: config test clean