File: Makefile

package info (click to toggle)
newsgate 1.6-10
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 332 kB
  • ctags: 310
  • sloc: ansic: 2,682; yacc: 499; sh: 278; lex: 183; perl: 151; makefile: 113
file content (151 lines) | stat: -rw-r--r-- 4,004 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
##
##  Makefile for mail/news gateway programs.
##  $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/Makefile,v 1.18 91/07/22 10:26:34 rsalz Exp Locker: rsalz $
##
SHELL	= /bin/sh

##  The header-reader in rfc822 needs a date parser.  You have three choices:
##  1.  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.  This routine came with B
##	News.
##  2.  If you want to use the C News getabsdate routine, comment out the
##	NEWSSRC and GETDATE lines; edit DATELIB to point to your C News
##	library (make sure your linker knows the difference between
##	Split and split!)and add -DUSE_GETABSDATE to DATEDEF.
##  3.  If you want to use the INN getdate routine, comment out the
##	NEWSSRC and GETDATE lines; edit DATELIB to point to your INN library
##	and add -DUSE_PARSEDATE to DATEDEF.
#NEWSSRC		= ../news2.11/src
#GETDATE		= getdate.o
#DATELIB		= ../../cnews/cnews-cr.7/libcnews.a
#DATEDEF		= -DUSE_GETABSDATE
#DATELIB		= /usr/local/src/inn/libinn.a
#DATEDEF		= -DUSE_PARSEDATE
DATELIB		= -linn
DATEDEF		= -DUSE_PARSEDATE

##  Edit appropriately.  See gate.h before you touch UUCP_INET.
#UUCP_INET	= /var/lib/news/gate/uucp-2-inet
#DESTDIR		= /usr/uucp/bin
#OPT		= -g
OPT		= -O2 -g
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 signoff # tags lint

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

clean clobber:
	rm -f mail2news news2mail gag mkmailpost hdrtest signoff *.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) $(DATELIB)
	@rm -f mail2news
	$(CC) $(CFLAGS) $(LINKFLAGS) -o mail2news $(M_OBJS) $(DATELIB)

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) $(DATELIB)
	@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
	@touch Part0?
	@-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)