# Makefile for g3 fax viewer
# Copyright (C) 1990, 1995  Frank D. Cringle.

# This file is part of g3view - an X11 fax viewer
#      
# g3view 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 = 1.8

####### Site-specific definitions #######
# optimisation level, debug etc
OPT = -O2 -Wno-uninitialized
# C compiler and libraries
# vanilla sysv
#CC = cc
#CFLAGS = $(OPT)
#LDFLAGS = $(OPT)
#LIBS = -lsocket
# vanilla BSD
#CC = cc
#CFLAGS = -DBSD $(OPT)
#LDFLAGS = $(OPT)
#LIBS =
# linux 1.0, XFree 2.1.1
#CC=gcc
#CFLAGS = -DBSD -Wall $(OPT)
#LDFLAGS = $(OPT) -s -N
#LIBS =
# sun solaris2 with gcc on supersparc:
CC=gcc
CFLAGS = -Wall $(OPT) -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 = g3view.o g3expand.o

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

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

D = g3view-$(VERS)
FILES = $D/README $D/COPYING $D/ChangeLog $D/Makefile $D/Imakefile \
	$D/g3.h $D/g3expand.c $D/g3view.man $D/g3view.c

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) $(OBJS) *~ core

$(OBJS):	g3.h
