#
# Makefile for memtester by Charles Cazabon.
#
# Copyright (C) 1999 Simon Kirby.
# Copyright (C) 1999-2005 Charles Cazabon.
# Licensed under the GNU General Public License version 2.  See the file
# COPYING for details.
#

#CC			= $(shell head -n 1 conf-cc)
#LD			= $(shell head -n 1 conf-ld)
CC=arc-linux-uclibc-gcc
LD=arc-linux-uclibc-ld

SOURCES		= memtester.c tests.c
OBJECTS		= $(SOURCES:.c=.o)
HEADERS		= memtester.h
TARGETS     = *.o  load find-systype make-compile make-load systype extra-libs

#
# Targets
#
all: memtester




load: \
make-load warn-auto.sh systype
	( cat warn-auto.sh; ./make-load "`cat systype`" ) > load
	chmod 755 load

clean:
	rm -f memtester $(TARGETS) $(OBJECTS) core

memtester: \
$(OBJECTS) memtester.c tests.h tests.c tests.h  Makefile 
	./load memtester tests.o `cat extra-libs`

memtester.o: memtester.c tests.h Makefile tests.o
	$(CC) -static -O2 -o memtester memtester.c tests.o

tests.o: tests.c tests.h  Makefile
	$(CC) -O2 -c tests.c
