#-----------------------------------------------------------------------------
#		Makefile for libgnu.a (GNU/960 object).
#
# $Id: Makefile,v 1.1 89/12/05 11:32:06 chrisb Exp $
#
# This library provides those routines for which calls are generated by the
# gcc960 compiler.
#-----------------------------------------------------------------------------

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

.s.o:
	${AS} ${ASFLAGS} -o $*.o $*.s

CC	= gcc960
CFLAGS	= -O2 -g ${ARCH}
AS	= gas960
ASFLAGS	= ${ARCH}
AR	= gar960
ARFLAGS	= rs

ARCH	= -AKA

OBJS	= ver960.o

libgnu.a:	${OBJS}
	${AR} ${ARFLAGS} libgnu.a ${OBJS}

#-----------------------------------------------------------------------------
#		'STANDARD' GNU/960 TARGETS BELOW THIS POINT
#
# 'VERSION' file must be present and contain a string of the form "x.y"
#-----------------------------------------------------------------------------

ver960.c: FORCE
	rm -f ver960.c
	echo "char libgnu_ver[]= \"libgnu `cat VERSION`, `date`\";" > ver960.c


# This target should be invoked before building a new release.
# 'VERSION' file must be present and contain a string of the form "x.y"
#
roll:
	@V=`cat VERSION`		; \
	MAJ=`sed 's/\..*//' VERSION`	; \
	MIN=`sed 's/.*\.//' VERSION`	; \
	V=$$MAJ.`expr $$MIN + 1`	; \
	rm -f VERSION			; \
	echo $$V >VERSION		; \
	echo Version $$V

# Dummy target to force execution of dependent targets.
#
FORCE:

# 'G960BASE' should be defined at invocation

install_gnu:	libgnu.a
	mv -f libgnu.a ${G960BASE}/lib/libgnu.a 

# The following kludge builds the GNU version even if the Intel version
# is requested.  This necessary because this library does not follow the naming
# convention of "libX.a for Intel, libXg.a for GNU/960".  But 'mkmake', which
# generates the top-level makefile, does not know that, and will generate
# a "libgnug" target for GNU and "libgnu" for Intel.
#
install_intel: install_gnu
	@echo No Intel format version of this library

install: install_gnu

clean:
	rm -f *.o *.a
