home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.orig.lzh
/
input
/
Makefile
< prev
next >
Wrap
Makefile
|
1989-06-27
|
4KB
|
141 lines
# You get your choice of rnews.immed or rnews.batch; rnews.immed tries
# to start processing immediately, while rnews.batch waits for somebody
# else (cron) to do it. Running rnews.immed might, perhaps, be reasonable
# if your news load is light and you are wildly impatient about processing
# incoming news. Otherwise, leave this alone.
RNEWS = rnews.batch
DEFINES =
COPTS = -O
CFLAGS = $(COPTS) $(DEFINES) -I../include
LINTFLAGS = $(DEFINES) -I../include -ha
LDFLAGS = $(CFLAGS)
LIBS= ../libcnews.a
BATCH = ../batch
THEMBIN = newsrun newsrunning c7decode bdecode recenews recpnews rnews
THEM = newsspool $(THEMBIN)
RBIN = /bin
# =()<NEWSARTS = @<NEWSARTS>@>()=
NEWSARTS = /usr/spool/news
# =()<NEWSBIN = @<NEWSBIN>@>()=
NEWSBIN = /usr/lib/newsbin
# workaround for System V make bug
SHELL = /bin/sh
DTR = README Makefile newsrun newsrunning newsspool.c c7decode.c rnews.batch \
rnews.8 bdecode.c recenews recpnews
all: $(THEM) rnews
bininstall: all
chmod +x $(THEM) rnews
-if test ! -d $(NEWSBIN)/input ; then mkdir $(NEWSBIN)/input ; fi
cp $(THEM) $(NEWSBIN)/input
cp rnews $(RBIN)/rnews
cp rnews $(RBIN)/cunbatch
: "and newsspool needs to be made setuid-news"
newsinstall:
: nothing
newsspool: newsspool.o $(LIBS)
$(CC) $(LDFLAGS) newsspool.o $(LIBS) -o $@
c7decode: c7decode.o $(LIBS)
$(CC) $(LDFLAGS) c7decode.o $(LIBS) -o $@
bdecode: bdecode.o $(BATCH)/crctab.o $(LIBS)
$(CC) $(LDFLAGS) bdecode.o $(BATCH)/crctab.o $(LIBS) -o $@
$(BATCH)/crctab.o: $(BATCH)/crctab.c
( cd $(BATCH) ; make crctab.o )
bdecode.o: bdecode.c $(BATCH)/coder.h
$(CC) -c -I$(BATCH) $(CFLAGS) bdecode.c
lint: newsspool.c
lint $(LINTFLAGS) newsspool.c 2>&1 | tee lint
test.1:
echo '#! rnews' >$@
echo 'here is a phony first batch' >>$@
test.2:
echo '#! cunbatch' >$@
echo '#! rnews' >>$@
echo 'here is a phony second batch' >>$@
test.3p:
echo '#! rnews' >$@
echo 'here is a phony third batch' >>$@
test.3: test.3c
( echo '#! cunbatch' ; cat test.3c ) >$@
test.3c: test.3p
: compress tends to return silly exit status for tiny inputs
-compress -b12 <test.3p >$@
test.out:
echo '#! rnews' >$@
echo 'here is a phony first batch' >>$@
echo '#! rnews' >>$@
echo 'here is a phony second batch' >>$@
echo '#! rnews' >>$@
echo 'here is a phony third batch' >>$@
rnews.immed: rnews.batch
sed '/qqq/s/newsspool/& -i/' rnews.batch >$@
rnews: rnews.batch rnews.immed
cp $(RNEWS) rnews
chmod +x rnews
setup: all
chmod +x rnews.batch rnews.immed
rm -rf bin
mkdir bin
cp $(THEM) bin
rm -f tmp.1
here=`pwd` ; echo "cat >>$$here/tmp.1" >bin/relaynews
echo "echo 1" >bin/spacefor
echo 'ln $$*' >bin/newslock
echo 'echo 10' >bin/sizeof
chmod +x bin/*
rm -rf in.coming
mkdir in.coming
r: all test.1 test.2 test.3 test.3c test.out setup
chmod +x $(THEM)
NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.1
cmp in.coming/* test.1
NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.2
sed 1d test.2 >tmp.2
cmp `ls -t in.coming | sed -n '1s;^;in.coming/;p'` tmp.2
rm tmp.2
NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.3
cmp `ls -t in.coming | sed -n '1s;^;in.coming/;p'` test.3c
NEWSARTS=`pwd` NEWSCTL=`pwd` ./newsrunning off
test -r in.coming/stop
NEWSARTS=`pwd` NEWSCTL=`pwd` ./newsrunning on
test ! -r in.coming/stop
mkdir in.coming/bad
NEWSARTS=`pwd` NEWSCTL=`pwd` ./newsrun
cmp tmp.1 test.out
test " `echo in.coming/*`" = ' in.coming/bad'
rm tmp.1
NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.1
NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.2
NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.immed <test.3
cmp tmp.1 test.out
test " `echo in.coming/*`" = ' in.coming/bad'
rm tmp.1
rm -r bin in.coming
clean:
rm -f *.o newsspool c7decode tmp.? test.* dtr lint rnews rnews.immed
rm -f bdecode
rm -rf in.coming bin
dtr: $(DTR)
makedtr $(DTR) >dtr