head     1.18;
branch   ;
access   ;
symbols  lastpatch:1.10;
locks    rsalz:1.18; strict;
comment  @# @;


1.18
date     91.07.22.10.26.34;  author rsalz;  state Exp;
branches ;
next     1.17;

1.17
date     91.07.18.20.53.55;  author rsalz;  state Exp;
branches ;
next     1.16;

1.16
date     91.07.18.19.40.27;  author rsalz;  state Exp;
branches ;
next     1.15;

1.15
date     91.07.18.18.34.56;  author rsalz;  state Exp;
branches ;
next     1.14;

1.14
date     91.07.18.18.26.37;  author rsalz;  state Exp;
branches ;
next     1.13;

1.13
date     91.07.18.11.07.13;  author rsalz;  state Exp;
branches ;
next     1.12;

1.12
date     91.07.17.16.15.46;  author rsalz;  state Exp;
branches ;
next     1.11;

1.11
date     91.04.08.10.14.26;  author rsalz;  state Exp;
branches ;
next     1.10;

1.10
date     91.02.12.15.10.43;  author rsalz;  state Exp;
branches ;
next     1.9;

1.9
date     91.02.12.15.09.08;  author rsalz;  state Exp;
branches ;
next     1.8;

1.8
date     91.02.12.15.07.01;  author rsalz;  state Exp;
branches ;
next     1.7;

1.7
date     91.02.12.14.42.17;  author rsalz;  state Exp;
branches ;
next     1.6;

1.6
date     89.10.31.17.57.11;  author rsalz;  state Exp;
branches ;
next     1.5;

1.5
date     89.07.10.12.19.02;  author rsalz;  state Exp;
branches ;
next     1.4;

1.4
date     88.11.15.16.12.33;  author rsalz;  state Exp;
branches ;
next     1.3;

1.3
date     87.09.09.17.01.05;  author rsalz;  state Release1;
branches ;
next     1.2;

1.2
date     87.08.26.11.33.00;  author rsalz;  state Exp;
branches ;
next     1.1;

1.1
date     87.08.18.17.49.59;  author rsalz;  state Exp;
branches ;
next     ;


desc
@The Makefile.
@


1.18
log
@Add comments and #ifdef to use C News getabsdate routines.
@
text
@##
##  Makefile for mail/news gateway programs.
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.17 91/07/18 20:53:55 rsalz Exp Locker: rsalz $
##
SHELL	= /bin/sh

##  The header-reader in rfc822 needs a date parser.  If you want to use
##  the getdate.y routine (which has problems with numeric timezones,
##  among others), NEWSSRC to point to the directory where you have a copy
##  of it.  If you want to use the C News getabsdate routine, comment out
##  the NEWSRC and GETDATE lineS and edit DATELIB to point to your C News
##  library.  (Make sure your linker knows the difference between Split
##  and split, however!)
NEWSSRC		= ../innd/lib
GETDATE		= getdate.o
#DATELIB		= ../cnews/libcnews.a
#DATEDEF		= -DUSE_GETABSDATE

##  Edit appropriately.  See gate.h before you touch UUCP_INET.
UUCP_INET	= /usr/lib/news/.admin/uucp-2-inet
DESTDIR		= /usr/uucp/bin
OPT		= -g
#OPT		= -O
DEFS		= $(DATEDEF)
CFLAGS		= $(OPT) $(DEFS)
LINKFLAGS	=
#LINKFLAGS	= -s -Bstatic

##  Get just filenames from a standard manifest.
SEDCOMMANDS = -e 1,2d -e '/(Directory)/d' -e 's/ .*//'

##  Gag, the gateway alias generator.
G_SRCS	= gag.c lex.c misc.c
G_OBJS	= gag.o lex.o misc.o

##  Mail2News, the mail into news part of the gateway.
M_SRCS	= misc.c regex.c hdr.c mail2news.c rfc822.c
M_OBJS	= misc.o regex.o hdr.o mail2news.o rfc822.o $(GETDATE)

##  News2Mail, the news into mail part of the gateway.
N_SRCS	= misc.c news2mail.c
N_OBJS	= misc.o news2mail.o

##  Manpages for the programs.
DOCS	= gag.1 mail2news.1 mkmailpost.1 news2mail.1 signoff.1

all:			mail2news news2mail gag mkmailpost tags lint

install:		all
	@@echo "Install as directed in the README file."
#	@@rm -f $(DESTDIR)/gag $(DESTDIR)/mail2news $(DESTDIR)/news2mail
#	cp gag mail2news news2mail $(DESTDIR)/.
#	cp uucp-2-inet $(UUCP_INET)

clean clobber:
	rm -f mail2news news2mail gag mkmailpost hdrtest *.o
	rm -f tags lint.? core gag.c gag.h lex.c
	rm -f Part0? newsgate.tar.Z


tags:			$(N_SRCS) $(M_SRCS)
	ctags -tw $(N_SRCS) $(M_SRCS) $(G_SRCS) gate.h

lint:			lint.d lint.g lint.m lint.n


##
mail2news:		$(M_OBJS)
	@@rm -f mail2news
	$(CC) $(CFLAGS) $(LINKFLAGS) -o mail2news $(M_OBJS)

news2mail:		$(N_OBJS)
	@@rm -f news2mail
	$(CC) $(CFLAGS) $(LINKFLAGS) -o news2mail $(N_OBJS)

gag:			$(G_OBJS)
	@@rm -f gag
	$(CC) $(CFLAGS) $(LINKFLAGS) -o gag $(G_OBJS)

mkmailpost:		mkmailpost.sh
	@@rm -f mkmailpost
	cp mkmailpost.sh mkmailpost
	chmod 755 mkmailpost

##
$(G_OBJS) $(M_OBJS) $(N_OBJS):	gate.h


##
lint.d:			$(DOCS)
	checknr -c.IR.BI.RI $(DOCS) regex.3 >lint.d
lint.g:			gag
	lint -a    -h $(DEFS) $(G_SRCS) |grep -v yaccpar >lint.g
lint.m:			mail2news
	lint -a -b -h $(DEFS) $(M_SRCS) >lint.m
lint.n:			news2mail
	lint -a -b -h $(DEFS) $(N_SRCS) >lint.n

##
TESTFILES	= hdr.c rfc822.o $(GETDATE)
hdrtest:		$(TESTFILES)
	@@rm -f hdr.o hdrtest
	$(CC) -DTEST $(CFLAGS) $(LINKFLAGS) -o hdrtest $(TESTFILES)
	@@rm -f hdr.o
	./hdrtest <test-addr

##  Keep intermediate files around.
lex.o:			lex.c
gag.o:			gag.c
gag.c:			gag.y
	@@rm -f gag.c gag.h
	yacc -d gag.y
	@@mv y.tab.c gag.c
	@@mv y.tab.h gag.h


##  Distribution kits.
shar:
	@@rm -f Part0?
	makekit -m
	@@rm -f MANIFEST.BAK
	@@-chmod 444 Part0?
tar:
	@@rm -f newsgate.tar.Z
	tar cf newsgate.tar `sed $(SEDCOMMANDS) <MANIFEST`
	compress newsgate.tar


##  Get the date parser from 2.11 news.
getdate.o:
	@@rm -f getdate.o
	cd $(NEWSSRC) ; make getdate.o
	cp $(NEWSSRC)/getdate.o .

##  Saber stuff
.SUFFIXES: .c .o .src .obj
.c.src:
	#load $(CFLAGS) $<
.c.obj:
	#load $(CFLAGS) $<
saber:		$(SABER_SRC)
	#load $(CFLAGS) $(SABER_SRC) $(ROOTDIR)/clib/cronus.a
@


1.17
log
@Remove hdrtest in clean target.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.16 91/07/18 19:40:27 rsalz Exp Locker: rsalz $
d7 12
d24 1
a24 1
DEFS		=
a28 7
##  This package needs getdate.o compiled from the commonly-distributed
##  getdate.y date parser.  If you have a C News library with the routine,
##  edit the LINKFLAGS above, otherwise edit these two lines to point to
##  your source directory.
NEWSSRC		= /nfs/papaya/source/news2.11/src
GETDATE		= getdate.o

d100 5
a104 3
hdrtest:		hdr.c rfc822.o getdate.o
	@@rm -f hdrtest
	$(CC) -DTEST $(CFLAGS) $(LINKFLAGS) -o hdrtest hdr.c rfc822.o getdate.o
@


1.16
log
@Fix minor bugs in address-parsing, and get test suite to work.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.15 91/07/18 18:34:56 rsalz Exp Locker: rsalz $
d51 1
a51 1
	rm -f mail2news news2mail gag mkmailpost *.o
@


1.15
log
@Use "C News" not "c news"
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.14 91/07/18 18:26:37 rsalz Exp Locker: rsalz $
d94 5
@


1.14
log
@Rerun makekit to get part assignments in MANIFEST, use sed to
make the tar file.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.13 91/07/18 11:07:13 rsalz Exp Locker: rsalz $
d18 1
a18 1
##  getdate.y date parser.  If you have a C news library with the routine,
@


1.13
log
@Ran through static Saber-C analysis.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.12 91/07/17 16:15:46 rsalz Exp Locker: rsalz $
a16 2
TARFILE		= newsgate.tar.Z

d24 3
d53 1
a53 1
	rm -f Part0? $(TARFILE)
d55 1
d105 1
a105 1
##
d112 2
a113 2
	@@rm -f $(TARFILE)
	tar cf newsgate.tar `awk 'NR > 2 { print $$1; }' <MANIFEST`
@


1.12
log
@Add WHOAMI #define case.
    Brendan Kehoe <brendan@@cs.widener.edu>
Split didn't make sure final string was terminated.
    Neil Rickert <rickert@@cs.niu.edu>
TrimEnvironment was not quite right.
    Neil Rickert <rickert@@cs.niu.edu>
Handle quoted characters and a lot of other stuff in the
From parser.
Invalid dates weren't caught in the RFC822-parser.
    Neil Rickert <rickert@@cs.niu.edu>
Make Received lines RFC822 conformant in news2mail.
Change Makefile to be more clear about how to get getdate.o
Don't turn foo.trw.com into foo.TRw.COM in Casify.
Add clobber to Makefile.
    Rich $alz <rsalz@@bbn.com>
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/src/RCS/Makefile,v 1.11 91/04/08 10:14:26 rsalz Exp Locker: rsalz $
d31 2
a32 2
M_SRCS	= misc.c regex.c str.c hdr.c mail2news.c rfc822.c
M_OBJS	= misc.o regex.o str.o hdr.o mail2news.o rfc822.o $(GETDATE)
d120 9
@


1.11
log
@patch02:  TrimEnvironment was not quite right.
patch02:	Neil Rickert <rickert@@cs.niu.edu>
patch02:  Invalid dates weren't caught in the RFC822-parser.
patch02:	Neil Rickert <rickert@@cs.niu.edu>
patch02:  Change Makefile to be more clear about how to get getdate.o
patch02:	Rich $alz <rsalz@@bbn.com>
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/src/RCS/Makefile,v 1.10 91/02/12 15:10:43 rsalz Exp Locker: rsalz $
d49 1
a49 1
clean:
@


1.10
log
@Add TARFILE macro.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/src/RCS/Makefile,v 1.9 91/02/12 15:09:08 rsalz Exp Locker: rsalz $
a7 1
2_11		= /nfs/papaya/source/news2.11/src
d19 6
a24 2
##  News files, copied over from $(2_11).
GETDATE	= getdate.o
d116 4
a119 4
$(GETDATE):
	@@rm -f $(GETDATE)
	cd $(2_11) ; make $(GETDATE)
	cp $(2_11)/$(GETDATE) .
@


1.9
log
@Don't be verbose on making tar.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/src/RCS/Makefile,v 1.8 91/02/12 15:07:01 rsalz Exp Locker: rsalz $
d8 9
a16 9
2_11	= /nfs/papaya/source/news2.11/src
UUCP_INET=	/usr/lib/news/.admin/uucp-2-inet
DESTDIR	= /usr/uucp/bin
OPT	= -g
#OPT	= -O
DEFS	=
CFLAGS	= $(OPT) $(DEFS)
LOADF	=
#LOADF	= -s
d18 2
d49 1
a49 1
	rm -f Part0? newsgate.tar.Z
d60 1
a60 1
	$(CC) $(CFLAGS) $(LOADF) -o mail2news $(M_OBJS)
d64 1
a64 1
	$(CC) $(CFLAGS) $(LOADF) -o news2mail $(N_OBJS)
d68 1
a68 1
	$(CC) $(CFLAGS) $(LOADF) -o gag $(G_OBJS)
d107 1
a107 1
	@@rm -f newstar.tar.Z
@


1.8
log
@Add "tar" target to make tarfile.
@
text
@d3 1
a3 1
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/src/RCS/Makefile,v 1.7 91/02/12 14:42:17 rsalz Exp Locker: rsalz $
d105 2
a106 1
	tar vcf newsgate.tar `awk 'NR > 2 { print $$1; }' <MANIFEST`
@


1.7
log
@Add lint.d, remove "exec" hack from lint.
@
text
@d3 1
a3 1
##  $Header: Makefile,v 1.6 89/10/31 17:57:11 rsalz Exp $
d47 1
a47 1
#	rm -f Part0?
d104 3
@


1.6
log
@Add mkmailpost rules.
@
text
@d3 1
a3 1
##  $Header: Makefile,v 1.5 89/07/10 12:19:02 rsalz Locked $
d33 2
d52 1
a52 1
lint:			lint.g lint.m lint.n
d78 2
d81 1
a81 1
	exec lint -a    -h $(DEFS) $(G_SRCS) >lint.g
d83 1
a83 1
	exec lint -a -b -h $(DEFS) $(M_SRCS) >lint.m
d85 1
a85 1
	exec lint -a -b -h $(DEFS) $(N_SRCS) >lint.n
@


1.5
log
@Minor tweaks, bug-fixes from alt.sources posting.
@
text
@d3 1
a3 1
##  $Header: Makefile,v 1.4 88/11/15 16:12:33 rsalz Exp $
d34 1
a34 1
all:			gag mail2news news2mail tags lint
d43 1
a43 1
	rm -f gag mail2news news2mail *.o
d66 4
@


1.4
log
@Add parser program.
@
text
@d3 1
a3 1
##  $Header: Makefile,v 1.3 87/09/09 17:01:05 rsalz Locked $
d5 1
d7 6
a12 2
##  Edit appropriately...
2_11	= ../news/src
d14 3
a16 3
CFLAGS	= -O $(DEFS)
LOADF	=#-s
LINTF	= -abch $(DEFS)
d19 1
a19 2
NEWSOBJ	= rfc822.o llist.o getdate.o
NEWSHDR	= header.h defs.h
d21 9
a29 1
##  News2Mail
a32 3
##  Mail2News
M_SRCS	= misc.c regex.c str.c hdr.c mail2news.c
M_OBJS	= misc.o regex.o str.o hdr.o mail2news.o $(NEWSOBJ)
d34 1
a34 3
##  Alias parser-generator
P_SRCS	= parser.c lex.c
P_OBJS	= parser.o lex.o
a35 3

all:			mail2news news2mail parser tags lint

d38 3
a40 3
#	@@rm -f /usr/uucp/bin/mail2news /usr/uucp/bin/news2mail
#	cp mail2news news2mail /usr/uucp/bin/.
#	cp uucp-2-inet /usr/lib/news/.admin/.
d43 3
a45 2
	rm -f *.o mail2news news2mail $(NEWSHDR)
	rm -f foo core tags lint* a.out Part0?
d48 1
a48 1
	ctags -tw $(N_SRCS) $(M_SRCS)
d50 4
d62 3
a64 3
parser:			$(P_OBJS)
	@@rm -f parser
	$(CC) $(CFLAGS) $(LOADF) -o parser $(P_OBJS)
a65 1
$(M_OBJS) $(N_OBJS):	gate.h
d67 2
a68 1
lint:			lint.m lint.n lint.p
d70 4
d75 1
a75 1
	exec lint $(LINTF) $(M_SRCS) >lint.m
d77 1
a77 3
	exec lint $(LINTF) $(N_SRCS) >lint.n
lint.p:			parser
	exec lint $(LINTF) $(P_SRCS) >lint.p
a78 5
parse.o:	parser.c
parser.c:	parser.y
	yacc -d parser.y
	mv y.tab.c parser.c
	mv y.tab.h parser.h
d80 13
a92 2
##  Rich's shar utilities...
shar Part01 Part02:	MANIFEST Makefile /tmp
d95 1
d97 6
a102 12
##  Dependencies on 2.11 News and NNTP.  Only bring the header files over
##  if they've changed, to avoid recompilation, but always bring the
##  objects over as linking doesn't take very long.  I should rewrite
##  to get rid of the NNTP stuff.  Someday...
hdr.o mail2news.o:	$(NEWSHDR)
$(NEWSOBJ):
	cd $(2_11) ; make $(NEWSOBJ)
	for I in $(NEWSOBJ) ; do cp $(2_11)/$$I $$I ; done
defs.h:		$(2_11)/defs.h
	cp $(2_11)/defs.h .
header.h:	$(2_11)/header.h
	cp $(2_11)/header.h .
@


1.3
log
@Incorporate changes made for bbn.com production environment.

@
text
@d3 1
a3 1
##  $Header: Makefile,v 1.2 87/08/26 11:33:00 rsalz Exp $
d25 3
a28 1
all:			news2mail mail2news tags lint
d30 2
d34 2
a35 2
#	@@rm -f /usr/uucp/bin/news2mail /usr/uucp/bin/mail2news
#	cp news2mail mail2news /usr/uucp/bin/.
d38 3
a40 2
news2mail:		$(N_OBJS)
	$(CC) $(CFLAGS) $(LOADF) -o news2mail $(N_OBJS)
d42 3
d46 1
d49 8
d59 4
a62 1
lint:			lint.n lint.m
d65 2
a66 2
lint.m:			mail2news
	exec lint $(LINTF) $(M_SRCS) >lint.m
d68 5
a72 2
tags:			$(N_SRCS) $(M_SRCS)
	ctags -tw $(N_SRCS) $(M_SRCS)
a73 4
clean:
	rm -f *.o news2mail mail2news $(NEWSHDR)
	rm -f foo core tags lint* a.out Part0?

d79 4
a82 3
##  Dependencies on 2.11 News.  Only bring the header files over if they've
##  changed, to avoid recompilation, but always bring the objects over as
##  linking doesn't take very long.
@


1.2
log
@Checkpoint.
@
text
@d3 1
a3 1
##  $Header: Makefile,v 1.1 87/08/18 17:49:59 rsalz Exp $
d7 1
a7 1
2_11	= /usr/spool/usenet/sources/src
d14 1
a14 1
NEWSOBJ	= rfc822.o getdate.o llist.o
d30 3
d55 1
a55 1
##  Rich $alz's shar utilities
d60 3
a62 1
##  Dependencies on 2.11 News
d64 1
a64 1
$(NEWSOBJ) $(NEWSHDR):
d66 5
a70 1
	for I in $(NEWSHDR) $(NEWSOBJ) ; do cp $(2_11)/$$I $$I ; done
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
##  $Header:$
d6 2
a7 6
##  Some stuff is picked up from the 2.11 distribution...
2_11	= /usr/news/sources
NEWSOBJ	= rfc822.o getdate.o llist.o
NEWSHDR	= header.h defs.h

#LOAD	= -s
d10 1
d13 4
d28 3
d32 1
a32 1
	$(CC) $(CFLAGS) $(LOAD) -o news2mail $(N_OBJS)
d35 1
a35 1
	$(CC) $(CFLAGS) $(LOAD) -o mail2news $(M_OBJS)
d37 4
a40 1
lint:			news2mail mail2news
d42 1
d49 7
a55 1
	rm -f *.o foo core tags lint* a.out news2mail mail2news
@
