###############################################################################
# Copyright 2000 Michael Dales
#
# 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# file   Makefile
# author Michael Dales (michael@dcs.gla.ac.uk)
# header n/a
# info   Make file for minimal stdio. Note that all of this is my work and 
#        thus under the GPL with the exception of the vfprintf implementation
#        which I took from NetBSD, and thus this file is under the BSD
#        licence.
#
###############################################################################

ROOT = ..
AR = /usr/local/gnuarm/bin/arm-unknown-coff-ar
CC = /usr/local/gnuarm/bin/arm-unknown-coff-gcc
LD = /usr/local/gnuarm/bin/arm-unknown-coff-ld 
OC = /usr/local/gnuarm/bin/arm-unknown-coff-objcopy
INC = ../include
CFLAGS = -ansi -Wall -O2 -I$(INC)

BASIC = Makefile $(INC)/stdio.h

OBJS = fopen.o fwrite.o fread.o ftell.o fflush.o fclose.o fseek.o \
	rewind.o fputc.o ferror.o clearerr.o fdopen.o init_stdio.o fprintf.o \
	vfprintf.o fileno.o printf.o vprintf.o sprintf.o snprintf.o perror.o

all: $(BASIC) $(OBJS)

clearerr.o: $(BASIC) clearerr.c
	$(CC) $(CFLAGS) -c clearerr.c

fileno.o: $(BASIC) fileno.c
	$(CC) $(CFLAGS) -c fileno.c

fopen.o: $(BASIC) fopen.c
	$(CC) $(CFLAGS) -c fopen.c

fwrite.o: $(BASIC) fwrite.c
	$(CC) $(CFLAGS) -c fwrite.c

fread.o: $(BASIC) fread.c
	$(CC) $(CFLAGS) -c fread.c

ftell.o: $(BASIC) ftell.c
	$(CC) $(CFLAGS) -c ftell.c

fflush.o: $(BASIC) fflush.c
	$(CC) $(CFLAGS) -c fflush.c

fclose.o: $(BASIC) fclose.c
	$(CC) $(CFLAGS) -c fclose.c

fseek.o: $(BASIC) fseek.c
	$(CC) $(CFLAGS) -c fseek.c

rewind.o: $(BASIC) rewind.c
	$(CC) $(CFLAGS) -c rewind.c

fputc.o: $(BASIC) fputc.c
	$(CC) $(CFLAGS) -c fputc.c

ferror.o: $(BASIC) ferror.c
	$(CC) $(CFLAGS) -c ferror.c

fdopen.o: $(BASIC) fdopen.c
	$(CC) $(CFLAGS) -c fdopen.c

init_stdio.o: $(BASIC) init_stdio.c
	$(CC) $(CFLAGS) -c init_stdio.c

fprintf.o: $(BASIC) fprintf.c
	$(CC) $(CFLAGS) -c fprintf.c

perror.p: $(BASIC) perror.c
	$(CC) $(CFLAGS) -c perror.c

printf.o: $(BASIC) printf.c
	$(CC) $(CFLAGS) -c printf.c

sprintf.o: $(BASIC) sprintf.c
	$(CC) $(CFLAGS) -c sprintf.c

snprintf.o: $(BASIC) snprintf.c
	$(CC) $(CFLAGS) -c snprintf.c

vfprintf.o: $(BASIC) vfprintf.c
	$(CC) $(CFLAGS) -c vfprintf.c

vprintf.o: $(BASIC) vprintf.c
	$(CC) $(CFLAGS) -c vprintf.c

clean:
	rm -f *.o 