# makefile for talk
#
# date:    Tue Sep 18 21:41:54 1990
# version: 1.0
#
# $Id: makefile.,v 2.0 1991/09/14 15:52:28 rosenkra Exp $
#
# $Log: makefile.,v $
# Revision 2.0  1991/09/14  15:52:28  rosenkra
# makefile for GNU ported version. similar to alcyon version (relatively
# minor mods).
#
# Revision 1.0  1991/09/14  01:51:22  rosenkra
# Initial revision
#
# configuration (see DEFINES):
#
# define SEARCH_PATH	to use the which() function (in talk.c) to search path
# define INLINE_ASM	to use GNU C __asm__() for c_speak call (untested)
# define DEBUG		to debug
# define NEED_DELAY	for short delay after line spoken
# define HAS_ACCESS	if library has POSIX access() (GNU C does)
#
CC		= gcc -Ig:\gcc\include
LD		= gcc -Lg:\gcc\lib
SECT		= 1
SUBSECT		=
TARGET		= talk.ttp
MANPAGE		= talk.$(SECT)$(SUBSECT)
CATPAGE		= talk.cat
MANSRC		= talk.man
ARCFILE		= talk.arc
SHARFILE	= talk.shr
UUEFILE		= talk.uue
HEADERS		=
SRCS		= $(HEADERS) talk.c c_speak.s
OTHERS		= readme makefile $(MANSRC)
DISTFILES	= $(OTHERS) $(SRCS)
OBJS		= talk.o c_speak.o
DEFINES		= -UDEBUG -DHAS_ACCESS -DSEARCH_PATH -UINLINE_ASM -DNEED_DELAY
CFLAGS		= -z -v -Wall -mshort $(DEFINES)
LDFLAGS		= -z -v -Wall -mshort
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)
		$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)



# manpage (use built-in .man.cat rule)...
#
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 $(CATPAGE)

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...
#
c_speak.o:	c_speak.s
talk.o:		talk.c


