# Makefile for viewfax
# Copyright (C) 1990, 1995  Frank D. Cringle.

# This file is part of viewfax - g3/g4 fax processing software.
#      
# viewfax is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#      
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#      
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

VERS = 2.1

####### Site-specific definitions #######
# need tiff support? - delete next line if you do not
TIFF = -DWITH_TIFF
# optimisation level, debug etc
OPT = -O2 -Wno-uninitialized
# C compiler and libraries
# vanilla sysv
#CC = cc
#CFLAGS = $(OPT) $(TIFF)
#LDFLAGS = $(OPT)
#LIBS = -lsocket
# vanilla BSD
#CC = cc
#CFLAGS = -DBSD $(OPT) $(TIFF)
#LDFLAGS = $(OPT)
#LIBS =
# sun solaris2 with gcc on supersparc:
CC=gcc
CFLAGS = -Wall $(OPT) $(TIFF) -msupersparc -I/usr/openwin/include
LDFLAGS = $(OPT) -L/usr/openwin/lib -R/usr/openwin/lib
LIBS =

# Destination directory and installation program for make install
BINDIR = /usr/local/bin
MANDIR	= /usr/local/man/man1
INSTALL = /usr/ucb/install
RM = rm -f

####### End of configurable definitions #######
OBJS = viewfax.o faxinput.o faxinit.o faxexpand.o

viewfax:	$(OBJS)
	$(CC) $(LDFLAGS) -o viewfax $(OBJS) -lX11 $(LIBS)

install: viewfax
	$(INSTALL) -s -m 755 viewfax $(BINDIR)
	$(INSTALL) -m 644 viewfax.man $(MANDIR)/viewfax.1

D = viewfax-$(VERS)
FILES = $D/README $D/COPYING $D/ChangeLog $D/Imakefile $D/Makefile \
	$D/faxexpand.c $D/faxexpand.h $D/faxinput.c $D/faxinit.c \
	$D/viewfax.c $D/viewfax.man

tar:;	(cd ..; tar cf - $(FILES) | gzip -9 >$D/$D.tar.gz)

shar:;	(cd ..; shar -a -n$D -sfdc@cliwe.ping.de -c -o $D/part -l64 $(FILES))

clean:;	$(RM) *.o *~ core

viewfax.o:	faxexpand.h
faxinput.o:	faxexpand.h
faxinit.o:	faxexpand.h
faxexpand.o:	faxexpand.h
faxcompress.o:	faxexpand.h
