#############################################################################
# Author:	Rhett "Jonzy" Jones
#		jonzy@cc.utah.edu
#
# Date:		February 17, 1993
#
# Copyright:	Copyright 1993, University of Utah Computer Center.
#		This source may be freely distributed as long as this copyright
# 		notice remains intact, and is in no way used for any monetary
# 		gain, by any institution, business, person, or persons.
#############################################################################

# The C compiler to use.
CC	= /bin/cc

# The flags to set.
CFLAGS	=

# The objects requred to create jughead.
OBJS	= jughead.o search.o sockets.o tree.o utils.o

# This is where the executable goes.
DESTDIR = /usr/local/bin

# This is where the man page goes.
DESTMAN = /usr/man/man

# The manual suffix.
MANSUFF = 1

# List of files to have tar'ed and compressed.
TARFILES= jughead.c search.c sockets.c tree.c utils.c	\
	  tree.h utils.h				\
	  Makefile jughead.1

# The name of the tar'ed and compressed file.
TARNAME	= jughead.tar.Z

all: jughead

jughead:$(OBJS)
	$(CC) $(CFLAGS) -o jughead $(OBJS)

jughead.o:	jughead.c tree.h utils.h
search.o:	search.c tree.h utils.h
sockets.o:	sockets.c utils.h
tree.o:		tree.c tree.h
utils.o:	utils.c

install:jughead
	cp jughead $(DESTDIR)/jughead
	chown root $(DESTDIR)/jughead
	chmod 4755 $(DESTDIR)/jughead
	cp jughead.1 $(DESTMAN)$(MANSUFF)/jughead.$(MANSUFF)
	chown root $(DESTMAN)$(MANSUFF)/jughead.$(MANSUFF)
	chmod 4755 $(DESTMAN)$(MANSUFF)/jughead.$(MANSUFF)

realclean:clean
	rm -f $(DESTDIR)/jughead
	rm -f $(DESTMAN)$(MANSUFF)/jughead.$(MANSUFF)

clean:semiclean
	rm -f jughead

semiclean:
	rm -f *.o

tar:
	/bin/tar -cvf - $(TARFILES) | compress -c > $(TARNAME)

viewman:
	nroff -man jughead.1 | more
