# Makefile for nntplink
#
CC = cc

# If you intend to use DBZ with LOOKUP_ARTICLE then you need dbz.o from the
# C News distribution
#
#DBZ=dbz.o

#DEFS=-DDEBUG_MAL

INCLUDES=-I.

#
#CFLAGS= -g $(DEFS) $(INCLUDES)
CFLAGS= -O $(DEFS) $(INCLUDES)

#
#LINTFLAGS= -p        			# For SysV
LINTFLAGS= -a -b -c -h  -x 		# For BSD

#
#
# If compiling with DKHOST support built in, add "-ldk" to LIBS
# If compilng on a SB2 with WIN/TCP add "-lnet -lnsl_s" to LIBS
#LIBS=libmalloc_d.a



# Where do you want the manual page put and under what extension?
#
MANDIR=/usr/manl
MANEXT=8

# Where do you want the nntplink binary put?
#
DESTDIR=/usr/lib/newsbin/local

# Do you want nntplink to be setuid news?
#
#PGM_INSTALL= install -g staff -o news -m 755
#
# Use this on systems where the -o option of install is used to
# specify the owner of the file to be installed
PGM_INSTALL= install -g staff -o news -m 4711
#
# Use this on systems (i.e. SysV) where the -u option of install 
# is used to  specify the owner of the file to be installed
#PGM_INSTALL= install -g news -u news -m 4711

# For parallel makes
#P=&

SRC= article.c batchfile.c \
	datafile.c entry.c fsyslog.c \
	history.c ihave.c logstats.c \
	misc.c nntplink.c parseargs.c \
	readline.c remote.c \
	sendnews.c setupproc.c \
	sig.c sleep.c strfuns.c \
	tcpconn.c xmitauth.c

OBJ= article.o batchfile.o \
	datafile.o entry.o fsyslog.o \
	history.o ihave.o logstats.o \
	misc.o nntplink.o parseargs.o \
	readline.o remote.o \
	sendnews.o setupproc.o \
	sig.o sleep.o strfuns.o \
	tcpconn.o xmitauth.o

all: nntplink

nntplink: $(P) $(OBJ)
	$(CC) $(DEFS) -o $@ $(OBJ) $(DBZ) $(LIBS)
	@ls -las $@

.c.o:
	$(CC) $(CFLAGS) -c $*.c

install: nntplink
	$(PGM_INSTALL) nntplink $(DESTDIR)

install.man:
	cp nntplink.8 $(MANDIR)/nntplink.$(MANEXT)

lint:
	lint $(LINTFLAGS) $(DEFS) $(SRC)

clean:
	rm -f nntplink core $(OBJ)

article.o:	conf.h fsyslog.h nntplink.h readline.h
batchfile.o:	conf.h fsyslog.h nntplink.h readline.h strfuns.h
datafile.o:	conf.h fsyslog.h nntplink.h readline.h
entry.o:	conf.h nntplink.h readline.h
fyslog.o:	conf.h fsyslog.h strfuns.h
history.o:	conf.h fsyslog.h nntplink.h readline.h strfuns.h
ihave.o:	conf.h fsyslog.h nntp.h nntplink.h readline.h strfuns.h
logstats.o:	conf.h fsyslog.h nntplink.h readline.h
misc.o:		conf.h fsyslog.h nntplink.h readline.h
nntplink.o:	conf.h fsyslog.h nntplink.h readline.h
parseargs.o:	conf.h fsyslog.h nntplink.h readline.h strfuns.h
readline.o:	conf.h readline.h
remote.o:	conf.h fsyslog.h nntp.h nntplink.h readline.h strfuns.h
sendnews.o:	conf.h fsyslog.h nntp.h nntplink.h readline.h strfuns.h
setupproc.o:	conf.h fsyslog.h nntplink.h readline.h
sig.o:		conf.h fsyslog.h nntplink.h readline.h
sleep.o:	conf.h fsyslog.h nntplink.h readline.h
strfuns.o:	conf.h strfuns.h
tcpconn.o:	conf.h fsyslog.h nntplink.h readline.h
xmitauth.o:	conf.h fsyslog.h nntp.h nntplink.h readline.h strfuns.h
