#
# Makefile for vfax. (c) Uwe C. Schroeder, Germany
#
#
# (c) 1992 Uwe C. Schroeder, Anwendungssysteme , Augsburg, Germany
#
# 
# Permission to use, copy, and modify this software and its
# documentation for non comercial  purpose is hereby granted 
# without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Uwe C. Schroeder not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission.  Uwe Schroeder makes no representations
# about the suitability of this software for any purpose.  It is provided
# "as is" without express or implied warranty.
# This software may not be sold or distributed with commercial products
# ( this includes distribution "for users convenience" ) without prior
# written permission by the author.
#
# UWE SCHROEDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL UWE SCHROEDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
#
# This is a alpha release, which means, that there are still several
# known bugs.
#
# Please report bugs to:
#
#                     usys@phoenix.abg.sub.org
#

# directories
BINDIR = /usr/local/bin

# programs
CC=gcc
CFLAGS= -O -g -DSYSV -DLinux #-DTEST 
LDFLAGS= -lbsd
INSTALL = cp

ADMINS = CAVEAT COPYING PORTING REQUIREMENTS FASPATCH 

HEADERS= vfax.h version.h patchlevel.h

SRCS= debug.c dial.c dir.c fax.c init.c mail.c play.c process.c queue.c \
	rcv.c read.c recmsg.c record.c response.c send.c signal.c snd.c \
	spooler.c tty.c ttyio.c write.c 

OBJS= debug.o dial.o dir.o fax.o init.o mail.o play.o process.o queue.o \
	rcv.o read.o recmsg.o record.o response.o signal.o snd.o \
	tty.o ttyio.o write.o 

SHAR1 = $(ADMINS) Makefile

SHAR2 = $(HEADERS) debug.c dial.c dir.c fax.c init.c mail.c play.c \
	process.c queue.c rcv.c read.c 

SHAR3 = recmsg.c record.c response.c send.c signal.c snd.c \
        spooler.c tty.c ttyio.c write.c

all: vfs vfax

vfs: $(OBJS) spooler.o
	$(CC) -o vfs spooler.o $(OBJS) $(LDFLAGS) 

vfax: $(OBJS) $(SRCS) send.o 
	$(CC) -o vfax send.o queue.o $(OBJS) $(LIBS) $(LDFLAGS) 

# testline program 
tl: tl.c tl.o $(OBJS)
	$(CC) $(LDFLAGS) -o tl tl.o $(OBJS)

shar: $(SHAR1) $(SHAR2) $(SHAR3)
	shar $(SHAR1) > vfax1o3v1.0.sh
	shar $(SHAR2) > vfax2o3v1.0.sh
	shar $(SHAR3) > vfax3o3v1.0.sh

install: all
	strip vfax
	strip vfs
	$(INSTALL) vfax $(BINDIR)
	$(INSTALL) vfs $(BINDIR)

clean:
	rm -f *~ core *.o vfs vfax

depend: $(SRCS) $(HEADERS)
	makedepend $(SRCS)

# DO NOT DELETE THIS LINE -- make depend depends on it.

debug.o: vfax.h version.h
dial.o:  vfax.h version.h
dir.o:  vfax.h version.h
fax.o:  vfax.h version.h
init.o: vfax.h version.h
mail.o: vfax.h version.h
play.o: vfax.h version.h
process.o: vfax.h version.h
queue.o:  vfax.h version.h
rcv.o: vfax.h version.h
read.o: vfax.h version.h
recmsg.o:  vfax.h version.h
record.o:  vfax.h version.h
response.o: vfax.h version.h
send.o: vfax.h version.h
signal.o: vfax.h version.h
snd.o: vfax.h version.h
spooler.o: vfax.h version.h patchlevel.h
tty.o: vfax.h version.h
ttyio.o: vfax.h version.h
write.o: vfax.h version.h
