# 
# A makefile to create library file "timers.a"
# 
SHELL=/bin/sh
TIMER=../timers.a
TIMER32=../timers32.a
CPP=/lib/cpp
CPPFLAGS=-P
CC=cc
CFLAGS=-O0 -mips4
FC=f77
FFLAGS=-r8 -O0 -mips4
LD=f77
LFLAGS=
LIBS=$(TIMER)
RANLIB=@touch
RM=/bin/rm -f
AR=ar
 
OBJS=timer.o \
     times.o
 
.SUFFIXES:  $(SUFFIXES) .F .c .inc .h

all:	$(TIMER) $(TIMER32)
 
$(TIMER): $(OBJS)
	-$(RM) $(TIMER)
	$(AR) cr $(TIMER) $(OBJS)
	$(RANLIB) $(TIMER)
	$(AR) tv $(TIMER)
 
$(TIMER32):
	cc -c -O0 -mips2 times.c
	f77 -c -O0 -mips2 -r8 timer.f
	-$(RM) $(TIMER32)
	$(AR) cr $(TIMER32) times.o timer.o
	$(AR) tv $(TIMER32)

# rules:
 
.c.o:
	$(CC) -c $(CFLAGS) $<
.F.f:
	$(CPP) $(CPPFLAGS) $< > $*.f
.f.o:
	$(FC) -c $(FFLAGS) $<
 
# dependencies:
 
timer.o: timer.f
timer.f: timer.F timer.inc

times.o: times.c 
 
# utilities:
 
tidy:
	-/bin/rm -f a.out *~
	-/bin/rm -f *.o
 
cleanf:
	-/bin/rm -f *.f
 
clean:
	-/bin/rm -f a.out *~
	-/bin/rm -f *.o
	-/bin/rm -f *.f
	-/bin/rm -f $(TIMER)
