# makefile for mgif
#
# date:    Wed Jun 19 00:47:02 1991
# version: 3.5
#
# there is a .s file in the source for line A bindings.
#
# some makes (like mine) have trouble with .l files that are not lex. so
# redefine SUFFIXES...
.SUFFIXES:
.SUFFIXES:	.o .c .s .ttp

SECT		= l
SUBSECT		=
TARGET		= mgif.ttp
MANPAGE		= mgif.$(SECT)$(SUBSECT)
MANSRC		= mgif.man
ARCFILE		= mgif.arc
SHARFILE	= mgif.shr
UUEFILE		= mgif.uue
HEADERS		= mgif.h
SRCS		= mgif.c file.c low.c process.c readgif.c readpi.c flicker.c linea.s
OBJS		= mgif.o file.o low.o process.o readgif.o readpi.o flicker.o \
linea.o
OTHERS		= readme makefile $(MANSRC)
DISTFILES	= $(OTHERS) $(SRCS)

CFLAGS		=
LDFLAGS		= -s -nf
LIBS		= 
BINDIR		= c:\bin
MANDIR		= c:\man\man$(SECT)
RUNPARM		=
RUNOUT		=



# directions...
#
directions:
		@echo type "make all" to built $(TARGET)
		@echo type "make install" to built/install $(TARGET)
		@echo type "make test" to test $(TARGET)
		@echo type "make clean" to remove objects
		@echo type "make clobber" to remove objects and $(TARGET)
		@echo type "make arc" to make source archive $(ARCFILE)
		@echo type "make shar" to make source shar file $(SHARFILE)
		@echo type "make uue" to make uuencoded $(TARGET) $(UUEFILE)


# main target...
#
all:		$(TARGET)

$(TARGET):	$(OBJS)
		$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)


showfl:		showfl.ttp showfl.$(SECT)

showfl.ttp:	showfl.c
		$(CC) -nf -s -o showfl.ttp showfl.c

showfl.$(SECT):	showfl.man
		nroff -T -manx -rO1 showfl.man >showfl.$(SECT)


# manpage (this may be very different on your system)...
#
manpage:	$(MANPAGE)

$(MANPAGE):	$(MANSRC)
		nroff -T -manx -rO1 $(MANSRC) >$(MANPAGE)


# to run it...
#
test:		$(TARGET)
		$(TARGET) $(RUNPARM) $(RUNOUT)


# to install it...
#
install:	install_bin install_man

install_bin:	$(TARGET)
		cp $(TARGET) $(BINDIR)$(TARGET)

install_man:	$(MANPAGE)
		cp $(MANPAGE) $(MANDIR)$(MANPAGE)


# others...
#
clean:
		rm $(OBJS) errs

clobber:	clean
		rm $(TARGET) $(MANPAGE)

arc:
		$(ARC) a $(ARCFILE) $(DISTFILES)
		@echo done making $(ARCFILE)

uue:
		$(UUENCODE) $(TARGET)
		@echo done making $(UUEFILE)

shar:
		$(SHAR) $(DISTFILES) >$(SHARFILE)
		@echo done making $(SHARFILE)


# dependencies...
#
mgif.o:		mgif.c mgif.h
file.o:		file.c mgif.h
low.o:		low.c mgif.h
process.o:	process.c mgif.h
readgif.o:	readgif.c mgif.h
readpi.o:	readpi.c mgif.h
flicker.o:	flicker.c

linea.o:	linea.s

