#
# Makefile for NNTP intstallation
# $Header: /home/gazette/sob/src/hold/nntp/RCS/Makefile,v 1.3 90/08/04 20:31:45 sob Exp Locker: sob $
# The program that knows how to deal with makefiles. [Uncomment if needed.]
# MAKE=make
# set CFLAGS to be -Ipath/to/special/includes if needed
CFLAGS= -O2 -s -I../../cnews-cr.g/libdbz
# set LIBS to be -lneededlibrary if needed
#LIBS	= -ldbz
LIBS	= ../../cnews-cr.g/libdbz/dbz.o ../../cnews-cr.g/libdbz/dbzdbm.o
#LIBS	= -ldbm

DISTFILES = Makefile README CHANGES

DISTDIRS = doc server support xfer xmit

DIST = $(DISTFILES) $(DISTDIRS)

SHELL=/bin/sh

TYPE = server

all: make_$(TYPE)

make_server: /nowhere
	cd server; $(MAKE) $(MFLAGS) "LIBS=${LIBS}" "CFLAGS=${CFLAGS}"
#	cd support; $(MAKE) $(MFLAGS) "LIBS=${LIBS}" "CFLAGS=${CFLAGS}"
	cd doc; $(MAKE) $(MFLAGS) "LIBS=${LIBS}" "CFLAGS=${CFLAGS}"
	cd xmit; $(MAKE) $(MFLAGS) "LIBS=${LIBS}" "CFLAGS=${CFLAGS}"
#	cd xfer; $(MAKE) $(MFLAGS) "LIBS=${LIBS}" "CFLAGS=${CFLAGS}"

server: make_server

make_client: /nowhere
	@ echo "There is no client software in this release.  Get the"
	@ echo "NNTP client kit version 1.6 or greater."

client: make_client

install: install_$(TYPE)

install_server:
	cd server; make install
	cd support; make install
	cd doc; make install

clean:
	rm  -f .[a-z]* ; for i in $(DISTDIRS); do cd $$i; $(MAKE) $(MFLAGS) clean; cd ..; done

check:
	for i in $(DISTDIRS); do cd $$i; $(MAKE) $(MFLAGS) check; cd ..; done

distrib: check
	mkdir ../nntp.dist
	cp -rp $(DIST) ../nntp.dist
	cd ../nntp.dist; for i in $(DISTDIRS); do cd $$i; $(MAKE) $(MFLAGS) distrib; cd ..; done

rpt: /nowhere
	tar cf rrnpatches.tar rrnpatches; compress rrnpatches.tar

server: /nowhere

/nowhere: ;
