# -*- makefile -*-
#/******************************************************************************
# *
# * Copyright (c) 2003 Intel Corporation.  All rights reserved.
# *
# * Intel hereby grants you permission to copy, modify, and distribute this
# * software and its documentation.  Intel grants this permission provided
# * that the above copyright notice appears in all copies and that both the
# * copyright notice and this permission notice appear in supporting
# * documentation.  In addition, Intel grants this permission provided that
# * you prominently mark as not part of the original any modifications made
# * to this software or documentation, and that the name of Intel
# * Corporation not be used in advertising or publicity pertaining to the
# * software or the documentation without specific, written prior
# * permission.
# *
# * Intel provides this AS IS, WITHOUT ANY WARRANTY, INCLUDING THE WARRANTY
# * OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, and makes no
# * guarantee or representations regarding the use of, or the results of the
# * use of, the software and documentation in terms of correctness,
# * accuracy, reliability, currentness, or otherwise, and you rely on the
# * software, documentation, and results solely at your own risk.
# *
# **************************************************************************/
#/*                                                                        */
#/* History:                                                               */
#/*  27Feb03  DDM  Initial Release                                         */
#/*                                                                        */
#/**************************************************************************/
#

CC=xscale-elf-gcc
# Use this for MAKE_MODE=unix or make --unix
DEL=rm -f
# Use this for MAKE_MODE=win32 or make --win32
# DEL=del
SPECS=--specs=redboot.specs

CFLAGS=${SPECS} -g -O4
LDFLAGS=${SPECS} -O4

OBJS=memset_coalesce.o memcpy_caching.o pld_test.o \
memaccess_scattered.o memset_allocate.o \
memset_cache_coalesce.o iop321.o

BINS=memset_coalesce.elf memcpy_caching.elf pld_test.elf \
memaccess_scattered.elf memset_allocate.elf \
memset_cache_coalesce.elf

all: ${BINS}

%.elf : %.o iop321.o
	${CC} ${LDFLAGS} -o $@ $^

%.o : %.c
	${CC} -c ${CFLAGS} -o $@ $<

clean:
	${DEL} ${BINS} ${OBJS}
	${DEL} *~ .*~ #*

#
# Dependencies
#
memset_coalesce.elf: memset_coalesce.o iop321.o
memcpy_caching.elf: memcpy_caching.o iop321.o
pld_test.elf: pld_test.o iop321.o
memaccess_scattered.elf: memaccess_scattered.o iop321.o
memset_allocate.elf: memset_allocate.o iop321.o
memset_cache_coalesce.elf: memset_cache_coalesce.o iop321.o

iop321.o: iop321.c iop321.h
memaccess_scattered.o: memaccess_scattered.c iop321.h
memcpy_caching.o: memcpy_caching.c iop321.h
memset_allocate.o: memset_allocate.c iop321.h
memset_cache_coalesce.o: memset_cache_coalesce.c
memset_coalesce.o: memset_coalesce.c iop321.h
pld_test.o: pld_test.c iop321.h
