chuqui@nsc.UUCP (06/10/84)
#! /bin/sh
# The rest of this file is a shell script which will extract:
# Makefile
echo x - Makefile
cat >Makefile <<'!!ChuquiCo!!Software!!'
# %W% %G%
#
# This Makefile will recreate the netnews software version 2.10.1.
# It has been significantly revamped from the distributed version to
# make development and maintenance easier. Changes to this from the
# distributed version include the addition of items for lint and sccs
# and the addition of the Peter Gross batching software and the new
# C based postnews (called pn by this program, which also supports the
# shell version as postnews). Note that the distributed version of
# batching has disappeared from the Makefile because the Gross version
# is vastly superior. These are the entry points for this makefile:
#
# all: will compile the entire news system.
# each command can also be used as a make option to compile it alone.
#
# install: This will install the news system.
# each command can be installed individually by use of the
# 'install<program>" command except for the small utilties
# supported under 'misc' (see below) and the batching commands
# (also see below).
#
# lint: lints the system. 'lint<program>' works as with install.
#
# clean: removes .o, binaries and other drek. 'clean<program>' works.
#
# get: gets the files you need from SCCS (or RCS) if supported.
# 'get<program>' works.
#
# clobber: does a clean and then removes all of the sccsed files that
# aren't checked out.
#
# There are two special cases in this makefile, 'misc' and 'batch'.
# Misc is used and a catchall for the small utilities that live in
# the lib directory (normally /usr/lib/news). These are the commands
# defined in MPROGS below. 'batch' is the Peter Gross batching system
# and are defined as BATCHPROGS. Both can be considers meta-programs--
# lintmisc and installbatch both work, for example.
#
# This Makefile written by Chuq Von Rospach (nsc!chuqui) because the
# old one simply didn't do things it should have, such as lint (the
# lint output proves why it should have). The format is set up
# strangely because I am planning on splitting news up into
# subdirectories and this makes it easy to set up separate Makefiles
# that can be called from a central location. Comments and suggestions
# are always welcome.
#
# This section defines the locations of everything. the first
# set is for debugging, the second set is where production stuff goes.
SPOOLDIR = ../spool
LIBDIR = ../lib
BINDIR = .
#SPOOLDIR = /usr/spool/news
#LIBDIR = /usr/lib/news
#BINDIR = /usr/bin
NETPATHS = /usr/lib/uucp/alpath
# username and group of the news directory. First entries are for debugging
NEWSUSR = chuqui
NEWSGRP = mesa
#NEWSUSR = netnews
#NEWSGRP = netnews
HOMENAME =
# section defines everything we need to run the various programs on this
# stuff to get it usable.
DEBUG = # -DDEBUG # -pg
FLAGS = ${DEBUG} -DDBM \
-DNETPATHS=\"$(NETPATHS)\" \
-DSPOOLDIR=\"$(SPOOLDIR)\" \
-DLIBDIR=\"$(LIBDIR)\" \
-DNEWSUSR=\"$(NEWSUSR)\" \
-DNEWSGRP=\"$(NEWSGRP)\" \
$(HOMENAME)
CFLAGS = -O $(FLAGS)
LINTFLAGS = -hx $(FLAGS) -DNOSCCS
LDFLAGS = -s
# LIBCMDS live in LIBDIR, BINCMDS live in BINDIR, COMMANDS is everything
BATCHPROGS = batchnews bnproc bnuuxqt unbatch
MPROGS = uurec recnews sendnews caesar recmail
BINCMDS = inews readnews vnews postnews checknews pn
LIBCMDS = expire $(MPROGS)
COMMANDS = $(LIBCMDS) $(BINCMDS) $(BATCHPROGS)
# if you use RCS, change these definitions to fit. If you don't use
# anything simply comment them out.
GET = -sccs get
CLEAN = sccs clean
LINT = lint
# this is for make depend and get
SOURCES = caesar.c header.c recmail.c cextern.c iextern.c recnews.c\
checknews.c ifuncs.c rextern.c control.c inews.c rfuncs.c digest.c\
logdir.c rfuncs2.c expire.c pathinit.c sendnews.c ftime.c process.c\
uname.c fullname.c readdir.c uurec.c funcs.c readnews.c virtterm.c\
readr.c visual.c pn.c batchnews.c bnproc.c bnuuxqt.c unbatch.c
HEADERS = defs.h iparams.h params.h header.h ndir.h rparams.h
OTHERS = Makefile README README_BATCH follow getdate.y help makeactive.sh \
news postnews reply rmgrp vnews.help moderators distributions
all: $(COMMANDS)
# this section installs everything
install: installinews installreadnews installvnews installpostnews \
installchecknews installexpire installmisc
# This section cleans everything up.
clean: cleaninews cleanreadnews cleanvnews cleanchecknews cleanexpire \
cleanmisc
# This section gets stuff out of sccs
get: getinews getreadnews getvnews getchecknews getexpire getmisc
# this lints everything
lint: lintinews lintreadnews lintvnews lintchecknews lintexpire lintmisc
# This section will do everything neccessary to take care of inews
IOBJECTS = inews.o ifuncs.o iextern.o control.o fullname.o ipathinit.o \
funcs.o getdate.o uname.o header.o
ISRCS = inews.c ifuncs.c iextern.c control.c fullname.c pathinit.c \
funcs.c uname.c header.c
IOTHERS = getdate.y
IPATH = -DINEW
inews: getinews $(IOBJECTS)
$(CC) $(LDFLAGS) $(IOBJECTS) -o inews -ldbm
lintinews: getinews getdate.c
$(LINT) $(LINTFLAGS) $(IPATH) $(ISRCS)
cleaninews:
rm -f $(IOBJECTS) inews getdate.c
installinews: inews
cp inews $(BINDIR)
-cd $(BINDIR) ; /etc/chown $(NEWSUSR) inews ; /etc/chgrp $(NEWSGRP) inews
chmod 6755 $(BINDIR)/inews
-rm -f $(BINDIR)/rnews
ln $(BINDIR)/inews $(BINDIR)/rnews
getinews: $(ISRCS) $(IOTHERS)
ipathinit.o:
$(CC) $(CFLAGS) $(IPATH) -c pathinit.c
mv pathinit.o ipathinit.o
# end of inews section
# This section takes care of everything we need for readnews
ROBJECTS = readnews.o rfuncs.o rfuncs2.o rextern.o readr.o process.o \
rpathinit.o digest.o funcs.o getdate.o uname.o header.o
RSRCS = readnews.c rfuncs.c rfuncs2.c rextern.c readr.c process.c \
pathinit.c digest.c funcs.c uname.c header.c
ROTHERS = getdate.y help
RPATH = -DREAD
readnews: getreadnews $(ROBJECTS)
$(CC) $(LDFLAGS) $(ROBJECTS) -o readnews -ldbm
lintreadnews: getreadnews getdate.c
$(LINT) $(LINTFLAGS) $(RPATH) $(RSRCS)
cleanreadnews:
rm -f $(ROBJECTS) readnews getdate.c
installreadnews: readnews
cp readnews $(BINDIR)
/etc/chown $(NEWSUSR) $(BINDIR)/readnews
chmod 755 $(BINDIR)/readnews
cp help $(LIBDIR)
/etc/chown $(NEWSUSR) $(LIBDIR)/help
chmod 644 $(LIBDIR)/help
getreadnews: $(RSRCS) $(ROTHERS)
rpathinit.o:
$(CC) $(CFLAGS) $(RPATH) -c pathinit.c
mv pathinit.o rpathinit.o
# end of readnews section
# This section does everything we need to get vnews going.
VOBJECTS = visual.o virtterm.o readnews.o rfuncs.o rfuncs2.o \
rextern.o process.o rpathinit.o funcs.o getdate.o uname.o header.o
VSRCS = visual.c virtterm.c readnews.c rfuncs.c rfuncs2.c \
rextern.c process.c pathinit.c funcs.c uname.c header.c
VOTHERS = getdate.y follow reply vnews.help
vnews: getvnews $(VOBJECTS)
$(CC) $(LDFLAGS) $(VOBJECTS) -ltermcap -ldbm -o vnews
lintvnews: getvnews getdate.c
$(LINT) $(LINTFLAGS) $(RPATH) $(VSRCS)
cleanvnews:
rm -f $(VOBJECTS) vnews getdate.c
installvnews: vnews
cp vnews $(BINDIR)
/etc/chown $(NEWSUSR) $(BINDIR)/vnews
chmod 755 $(BINDIR)/vnews
cp vnews.help follow reply $(LIBDIR)
/etc/chown ($NEWSUSR) $(LIBDIR)/vnews.help $(LIBDIR)/follow $(LIBDIR)/reply
chmod 755 $(LIBDIR)/follow $(LIBDIR)/reply
chmod 644 $(LIBDIR)/vnews.help
getvnews: $(VSRCS) $(VOTHERS)
# end of vnews section
# this section installs the shell script for postnews
installpostnews:
cp postnews $(BINDIR)/postnews
/etc/chown $(NEWSUSR) $(BINDIR)/postnews
chmod 755 $(BINDIR)/postnews
# end of postnews section
# this section handles everything for pn, the C version of postnews
POBJECTS = pn.o rextern.o rpathinit.o uname.o
PSRCS = pn.c rextern.c pathinit.c uname.c
POTHERS = distributions moderators
PPATH =
pn: getpn $(POBJECTS)
$(CC) $(LDFLAGS) $(POBJECTS) -o pn
lintpn: getpn
$(LINT) $(LINTFLAGS) $(PPATH) $(PSRCS)
cleanpn:
rm -f $(POBJECTS) pn
installpn: pn
cp pn $(BINDIR)/pn
/etc/chown $(NEWSUSR) $(BINDIR)/pn
chmod 755 $(BINDIR)/pn
cp $(POTHERS) $(LIBDIR)
cd $(LIBDIR) ; /etc/chown $(NEWSUSR) $(POTHERS)
cd $(LIBDIR) ; chmod 644 $(POTHERS)
getpn: $(PSRCS) $(POTHERS)
# This section handles everything for checknews
COBJECTS = checknews.o process.o cpathinit.o
CSRCS = checknews.c process.c pathinit.c
COTHERS =
CPATH = -DCHKN
checknews: getchecknews $(COBJECTS)
$(CC) $(LDFLAGS) $(COBJECTS) -o checknews
lintchecknews: getchecknews
$(LINT) $(LINTFLAGS) $(CPATH) $(CSRCS)
cleanchecknews:
rm -f $(COBJECTS) checknews
installchecknews: checknews
cp checknews $(BINDIR)/checknews
/etc/chown $(NEWSUSR) $(BINDIR)/checknews
chmod 775 $(BINDIR)/checknews
getchecknews: $(CSRCS)
cpathinit.o:
$(CC) $(CFLAGS) $(CPATH) -c pathinit.c
mv pathinit.o cpathinit.o
#end of checknews section
# This section does all of the building for expire
EOBJECTS = expire.o uname.o header.o funcs.o getdate.o rextern.o epathinit.o
ESRCS = expire.c uname.c header.c funcs.c rextern.c pathinit.c
EOTHERS = getdate.y
EPATH = -DEXP
expire: getexpire $(EOBJECTS)
$(CC) $(LDFLAGS) $(EOBJECTS) -o expire -ldbm
lintexpire: getexpire getdate.c
$(LINT) $(LINTFLAGS) $(EPATH) $(ESRCS)
cleanexpire:
rm -f $(EOBJECTS) expire getdate.c
installexpire: expire
cp expire $(LIBDIR)/expire
/etc/chown $(NEWSUSR) $(LIBDIR)/expire
chmod 700 $(LIBDIR)/expire
getexpire: $(ESRCS) $(EOTHERS)
epathinit.o:
$(CC) $(CFLAGS) $(EPATH) -c pathinit.c
mv pathinit.o epathinit.o
# end of the expire section
# This section creates all of the smaller support routines
MOBJECTS = uurec.o recnews.o sendnews.o uname.o caesar.o recmail.o
MSRCS = uurec.c recnews.c sendnews.c uname.c caesar.c recmail.c
MOTHERS =
misc: getmisc $(MPROGS)
installmisc: misc
cp $(MPROGS) $(LIBDIR)
cd $(LIBDIR) ; /etc/chown $(NEWSUSR) $(MPROGS)
cd $(LIBDIR) ; chmod 755 $(MPROGS)
lintmisc: getmisc
for i in $(MSRCS); do ($(LINT) $(LINTFLAGS) $$i); done
cleanmisc:
rm -f $(MOBJECTS) $(MPROGS)
getmisc: $(MSRCS)
uurec: uurec.o
$(CC) $(CFLAGS) uurec.o -o uurec
recnews: recnews.o
$(CC) $(CFLAGS) recnews.o -o recnews
sendnews: sendnews.o uname.o
$(CC) $(LDFLAGS) sendnews.o uname.o -o sendnews
caesar: caesar.o
$(CC) $(CFLAGS) caesar.o -o caesar -lm
recmail: recmail.o
$(CC) $(CFLAGS) recmail.o -o recmail
# end of misc section for utilities
# This section takes care of the batching stuff by peter gross
BOBJECTS = batchnews.o bnproc.o unbatch.o # bnuuxqt.o
BSRCS = batchnews.c bnproc.c unbatch.c # bnuuxqt.c (not working on 4.2 yet)
BOTHERS =
batch: getbatch $(BATCHPROGS)
# note: this has two versions - the commented out one uses bnuuxqt, the
# executed one does not.
installbatch: batch
cp batchnews unbatch $(LIBDIR)
/etc/chown $(NEWSUSR) $(LIBDIR)/batchnews $(LIBDIR)/unbatch
chmod 755 $(LIBDIR)/batchnews $(LIBDIR)/unbatch
#use this line if you don't use bnuuxqt
cp bnproc $(BINDIR)/bnproc
# use these lines if you use bnuuxqt
# cp bnproc $(LIBDIR)/bndaemon
# /etc/chown $(NEWSUSR) $(LIBDIR)/bndaemon
# chmod 755 $(LIBDIR)/bndaemon
# cp bnuuxqt $(BINDIR)/bnproc
# use these lines for both kinds
/etc/chown $(NEWSUSR) $(BINDIR)/bnproc
chmod 755 $(BINDIR)/bnproc
lintbatch: getbatch
for i in $(BSRCS); do ($(LINT) $(LINTFLAGS) $$i)); done
cleanbatch:
rm -f $(BOBJECTS) $(BATCHPROGS)
getbatch: $(BSRCS)
batchnews: batchnews.o
$(CC) $(LDFLAGS) batchnews.o -o batchnews
unbatch: unbatch.o
$(CC) $(LDFLAGS) unbatch.o -o unbatch
bnproc: bnproc.o
$(CC) $(LDFLAGS) bnproc.o -o bnproc
#bnuuxqt: bnuuxqt.o
# $(CC) $(LDFLAGS) bnuuxqt.o -o bnuuxqt
#end of batch section
#miscellaneous dependencies and rules
getdate.c: getdate.y
@echo expect 6 shift/reduct conflicts
yacc getdate.y
mv y.tab.c getdate.c
getdate.o: getdate.c
$(CC) $(CFLAGS) -c getdate.c
# This section clobbers everything, including sccs sources.
# if you don't support sccs or rcs, comment it out.
clobber: clean
$(CLEAN)
# This will get what you need from sccs
# if you don't support sccs or rcs, comment it out.
$(SOURCES) $(HEADERS) $(OTHERS):
$(GET) $@
# Recreate dependencies: (written by nsc!glenn (Glenn Skinner))
#
# We assume there are no files involved that begin with `..'
# except for `..' itself.
# The rule works by sequentially producing the dependencies for each
# source file. It builds each such list by using the C preprocessor to
# collect all files required by the current source file. Grep then
# collects line directive lines, and awk and sed strip out unwanted
# fields and punctuation. The final awk formats the dependencies into
# a compact form.
#
# This version of the rule throws away dependencies on system include
# files; to keep them, remove the grep -v command from the pipeline.
depend: get
rm -f makedep eddep
for i in ${SOURCES}; do \
${CC} -E ${CFLAGS} $$i | \
grep '^#' | \
awk '{ print $$3 }' | \
grep -v '"/' | \
sed -e 's|/[^/]*/\.\.||g' -e 's|\([^.]\)\./|\1|' \
-e 's|"||g' | \
sort -u | \
awk "BEGIN { of = \"`basename $$i .c`\" \".o: \"; rec = of }\
{ if (length(rec \$$0) > 78) { print rec; rec = of \$$0 }\
else rec = rec \" \" \$$0 } \
END { print rec }" >> makedep ; \
done
echo '$$r makedep' >>eddep
echo '/^# DO NOT DELETE THIS LINE -- make depend/+1,$$d' >>eddep
echo '$$r makedep' >>eddep
echo 'w' >>eddep
cp Makefile Makefile.bak
ed - Makefile < eddep
rm eddep makedep
# end of miscellaneous section
# DO NOT DELETE THIS LINE -- make depend uses it
caesar.o: caesar.c
header.o: defs.h header.c header.h
recmail.o: recmail.c
cextern.o: cextern.c defs.h header.h iparams.h params.h
iextern.o: defs.h header.h iextern.c iparams.h params.h
recnews.o: defs.h recnews.c
checknews.o: checknews.c defs.h header.h
ifuncs.o: defs.h header.h ifuncs.c iparams.h params.h
rextern.o: defs.h header.h params.h rextern.c rparams.h
control.o: control.c defs.h header.h iparams.h params.h
inews.o: defs.h header.h inews.c iparams.h params.h
rfuncs.o: defs.h header.h params.h rfuncs.c rparams.h
digest.o: defs.h digest.c header.h params.h rparams.h
logdir.o: logdir.c
rfuncs2.o: defs.h header.h params.h rfuncs2.c rparams.h
expire.o: defs.h expire.c header.h params.h
pathinit.o: pathinit.c
sendnews.o: sendnews.c
ftime.o: ftime.c
process.o: defs.h header.h params.h process.c rparams.h
uname.o: defs.h header.h params.h uname.c
fullname.o: defs.h fullname.c
readdir.o: ndir.h readdir.c
uurec.o: defs.h uurec.c
funcs.o: defs.h funcs.c header.h params.h
readnews.o: defs.h header.h params.h readnews.c rparams.h
virtterm.o: virtterm.c
readr.o: defs.h header.h params.h readr.c rparams.h
visual.o: defs.h header.h params.h rparams.h visual.c
pn.o: defs.h pn.c
batchnews.o: batchnews.c
bnproc.o: bnproc.c
bnuuxqt.o: bnuuxqt.c
unbatch.o: unbatch.c
!!ChuquiCo!!Software!!
--
>From the ledge of the seventh cornice: Chuq Von Rospach
{amd70,fortune,hplabs,ihnp4}!nsc!chuqui (408) 733-2600 x242
If you let a smile be your umbrella you will get rain up your nose.