#
#  Makefile for abcd, an automatic backup copy daemon.
#
#  @(#)Makefile 1.4 89/04/10
#
#  Copyright (c) Rich Burridge.
#                Sun Microsystems Australia - All rights reserved.
#
#  Permission is given to distribute these sources, as long as the
#  copyright messages are not removed, and no monies are exchanged.
#
#  No responsibility is taken for any errors inherent either in the comments
#  or the code of this program, but if reported to me then an attempt will
#  be made to fix them.
#
#-----------------------------------------------------------------------
#  Abcd has been written to work in both BSD and System V environments.
#  If you are running on a BSD4.[23] machine or under SunOS, then OSTYPE
#  should be commented out. If you are running under SysV, V7 or BSD4.1,
#  then OSTYPE should be set to -DSYSV (uncommented).
# 
#OSTYPE          = -DSYSV 
#-----------------------------------------------------------------------
#  If you are running abcd under SCO Xenix 286, then you should have
#  uncommented the OSTYPE declaration above. You also need to uncomment
#  the following two lines.
#
#X_CFLAGS        = -M21 -K
#X_LIBS          = -lx
#-----------------------------------------------------------------------

BINARIES        = abcd
BINDIR          = /usr/local/bin
MANDIR          = /usr/man/man$(MANSECT)
MANSECT         = l
CFLAGS          = $(X_CFLAGS) -g $(OSTYPE) -DCP=\"$(CP)\" -DRCP=\"$(RCP)\"
OBJS            = abcd.o
SRCS            = abcd.c ndir.c
HDRS            = abcd.h ndir.h patchlevel.h
LIBS            = $(X_LIBS)
OTHERS          = Makefile README abcd.1

#  Full pathnames for the cp and rcp commands.
CP              = /bin/cp
RCP             = /usr/ucb/rcp

all:            $(BINARIES)

abcd:           $(OBJS)
		cc -o abcd $(CFLAGS) $(OBJS) $(LIBS)

install:        $(BINARIES)
		install -s -m 751 abcd $(BINDIR)
		install -c -m 644 abcd.1 $(MANDIR)/abcd.$(MANSECT)

backup:;        cp $(SRCS) $(HDRS) $(OTHERS) backdir

shar:;          shar.script $(SRCS) $(HDRS) $(OTHERS) > archive

clean:;		rm -f abcd *.o core

lint:;		lint abcd.c $(LIBS)

create:         SCCS
		-sccs create $(SRCS) $(HDRS) $(OTHERS)

SCCS:
		mkdir SCCS
		chmod 755 SCCS

abcd.o:         abcd.c $(HDRS)
