#
# Copyright (c) 1987, 1989 University of Maryland
# Department of Computer Science.  All rights reserved.
# Permission to copy for any purpose is hereby granted
# so long as this copyright notice remains intact.
#
# Makefile for ctex/lib (C-TeX library routines)
#
# $Header: /usr/src/local/tex/local/mctex/lib/RCS/Makefile,v 3.2 89/10/17 09:27:30 chris Exp $
#
CFLAGS=	-x c++ -I../h -O

%.o:	%.c
	gcc -c -x c++ -I../h -O $<

DESTDIR=

CC=gcc
# SysV sites should set RANLIB=:
RANLIB=	ranlib
#RANLIB=:

# This will be overridden by ../Makefile, but just in case...
FONTDESC=/usr/local/lib/tex/fonts/fontdesc

# 4.1BSD Vax:
#ASSRC=	vaxbcopy.s vaxbzero.s
#ASOBJ=	vaxbcopy.o vaxbzero.o
#MISCC=	getopt.c
#MISCO=	getopt.o

# 4.2BSD Vax:
#ASSRC=
#ASOBJ=
#MISCC=	getopt.c
#MISCO=	getopt.o

# 4.2BSD Sun:
#ASSRC=
#ASOBJ=
#MISCC=
#MISCO=

# 4.2BSD Pyramid:
#ASSRC=
#ASOBJ=
#MISCC=	getopt.c
#MISCO=	getopt.o

# 4.3BSD Vax, and many others
ASSRC=
ASOBJ=
MISCC=
MISCO=

# machines without any of bcopy,bzero,getopt
#ASSRC=
#ASOBJ=
#MISCC=	bcopy.c bzero.c getopt.c
#MISCO=	bcopy.o bzero.o getopt.o

MISCO= getopt.o
# all machines
# regular library routines
CSRC=	conv.c dviclass.c dvistate.c error.c findpost.c fio.c font.c \
	font_subr.c gfclass.c gripes0.c gripes1.c magfactor.c rotate.c \
	scaletfm.c scanpost.c sdecode.c search.c seek.c skip.c split.c \
	strsave.c tempfile.c tfm.c ${MISCC}
COBJ=	conv.o dviclass.o dvistate.o error.o findpost.o fio.o font.o \
	font_subr.o gfclass.o gripes0.o gripes1.o magfactor.o rotate.o \
	scaletfm.o scanpost.o sdecode.o search.o seek.o skip.o split.o \
	strsave.o tempfile.o tfm.o ${MISCO}
# font routines
FSRC=	gffont.c pkfont.c pxlfont.c tfmfont.c
FOBJ=	gffont.o pkfont.o pxlfont.o tfmfont.o

OBJS=	${COBJ} ${ASOBJ} ${FOBJ}

all: lib.a

lib.a: ${OBJS}
	ar cr lib.a ${OBJS}
	${RANLIB} lib.a


# no installation is necessary; this entry is just for standardisation
install:

clean:
	rm -f *.o lib.a

cleandir: clean
	rm -f .depend

depend: ${CSRC} ${FSRC}
	mkdep ${CFLAGS} ${CSRC} ${FSRC}

# XXX should be able to check these
lint:

# font.o needs to know where to find the font description file
font.o:
	${CC} ${CFLAGS} -DFONTDESC=\"${FONTDESC}\" -c font.c
