#============================================================================
# bandwidth, a benchmark to estimate memory transfer bandwidth.
# Copyright (C) 2005-2019 by Zack T Smith.
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
# The author may be reached at veritas@comcast.net.
#============================================================================

CFLAGS= -g -Wno-conditional-type-mismatch
CC=gcc -Wall -I.
SRC=main.c timing.c
OBJ=main.o timing.o
LIB= 
AS=nasm
ARM_AS=as
ARM_CC=gcc

bandwidth32: CPUCharacteristics.c Testing.c ${SRC} routines-arm-rpi-32bit.asm OOC32
	${ARM_AS} -march=armv7 -mfpu=neon routines-arm-rpi-32bit.asm -mcpu=xscale -o routines-arm-rpi-32bit.o
	${ARM_CC} ${CFLAGS} -c -I ./OOC Testing.c
	${ARM_CC} ${CFLAGS} -c -I ./OOC CPUCharacteristics.c
	${ARM_CC} routines-arm-rpi-32bit.o CPUCharacteristics.o Testing.o ${SRC} ${CFLAGS} ${OOCLIB32} -lm -o bandwidth32

bandwidth-arm32:  CPUCharacteristics.c Testing.c ${SRC} routines-arm-32bit.asm OOC32
	${ARM_AS} routines-arm-generic-32bit.asm -mcpu=xscale -o routines-arm-generic-32bit.o
	${ARM_CC} ${CFLAGS} -c -I ./OOC Testing.c
	${ARM_CC} ${CFLAGS} -c -I ./OOC CPUCharacteristics.c
	${ARM_CC} ${CFLAGS} routines-arm-generic-32bit.o CPUCharacteristics.o Testing.o ${SRC} ${CFLAGS} ${OOCLIB32} -lm -o bandwidth-arm32

