chiark / gitweb /
Merge branch 'master' of login.chiark.greenend.org.uk:public-git/inn-innduct
[inn-innduct.git] / innfeed / Makefile
1 ##  $Id: Makefile 7727 2008-04-06 07:59:46Z iulius $
2
3 include ../Makefile.global
4
5 top             = ..
6 CFLAGS          = $(GCFLAGS) $(SASLINC)
7
8 ALL             = innfeed procbatch startinnfeed imapfeed
9
10 SOURCES         = article.c buffer.c config_l.c config_y.c \
11                   endpoint.c host.c innlistener.c main.c misc.c \
12                   startinnfeed.c tape.c version.c
13
14 INCLUDES        = article.h buffer.h configfile.h config_y.h connection.h \
15                   endpoint.h host.h innfeed.h innlistener.h misc.h tape.h
16
17 # The objects linked into innfeed.  All SOURCES except startinnfeed.
18 OBJECTS         = article.o buffer.o config_l.o config_y.o \
19                   endpoint.o host.o innlistener.o main.o misc.o tape.o \
20                   version.o
21
22 all: $(ALL)
23
24 warnings:
25         $(MAKE) COPT='$(WARNINGS)' all
26
27 install: all
28         $(LI_XPRI) innfeed $D$(PATHBIN)/innfeed
29         $(LI_XPRI) imapfeed $D$(PATHBIN)/imapfeed
30         $(CP_XPRI) procbatch $D$(PATHBIN)/procbatch
31         @ME=`$(WHOAMI)` ; \
32         if [ x"$$ME" = xroot ] ; then \
33             echo $(LI_SPRI) startinnfeed $D$(PATHBIN)/startinnfeed ; \
34             $(LI_SPRI) startinnfeed $D$(PATHBIN)/startinnfeed ; \
35         else \
36             echo $(LI_XPRI) startinnfeed $D$(PATHBIN)/startinnfeed ; \
37             $(LI_XPRI) startinnfeed $D$(PATHBIN)/startinnfeed ; \
38             echo '' ; \
39             echo '========================' ; \
40             echo 'NOTE NOTE NOTE NOTE NOTE' ; \
41             ls -l $D$(PATHBIN)/startinnfeed ; \
42             echo '$D$(PATHBIN)/startinnfeed needs to be installed setuid root' ; \
43             echo '' ; echo ; \
44         fi
45
46
47 clean:
48         rm -f *.o $(ALL) version.c innfeed-convcfg
49         rm -f profiled innfeedp
50         rm -rf .libs
51
52 clobber distclean: clean 
53         rm -f tags y.tab.c y.tab.h lex.yy.c config_y.c config_y.h
54
55 tags: $(SOURCES) $(INCLUDES)
56         $(CTAGS) $(SOURCES) $(INCLUDES)
57
58 $(FIXSCRIPT):
59         @echo Run configure before running make.  See INSTALL for details.
60         @exit 1
61
62
63 ##  Compilation rules.
64
65 INNFEEDLIBS     = $(LIBSTORAGE) $(LIBHIST) $(LIBINN) $(EXTSTORAGELIBS) \
66                   $(SASLLIB) $(LIBS)
67
68 config_y.c config_y.h: configfile.y
69         $(YACC) -d $?
70         mv y.tab.h config_y.h
71         mv y.tab.c config_y.c
72
73 config_l.c: configfile.l
74         $(LEX) $?
75         mv lex.yy.c config_l.c
76
77 version.c: Makefile ../Makefile.global
78         version=`echo '$(VERSION) ($(VERSION_EXTRA))' | sed 's/ ()//'` ; \
79         echo 'const char *versionInfo = "innfeed' "$$version\" ;" > $@
80
81 innfeed: $(OBJECTS) connection.o $(LIBSTORAGE) $(LIBINN)
82         $(LIBLD) $(LDFLAGS) -o $@ $(OBJECTS) connection.o $(INNFEEDLIBS)
83
84 imapfeed: $(OBJECTS) imap_connection.o $(LIBSTORAGE) $(LIBINN)
85         $(LIBLD) $(LDFLAGS) -o $@ $(OBJECTS) imap_connection.o $(INNFEEDLIBS)
86
87 procbatch: procbatch.in $(FIXSCRIPT)
88         $(FIXSCRIPT) procbatch.in
89
90 startinnfeed: startinnfeed.o $(LIBINN)
91         $(LIBLD) $(LDFLAGS) -o $@ startinnfeed.o $(LIBINN) $(LIBS)
92
93 # Not normally built.
94 innfeed-convcfg: innfeed-convcfg.in $(FIXSCRIPT)
95         $(FIXSCRIPT) -i innfeed-convcfg.in
96
97 tst: config_y.c config_l.c
98         gcc -DWANT_MAIN -o tst -g -Wall config_y.c config_l.c -ly -ll
99
100
101 ##  Profiling.  These rules have not been checked for a while and may need
102 ##  some work.
103
104 profiled:       innfeedp
105         date >$@
106
107 innfeedp:       $(SOURCES)
108         rm -f $(OBJECTS)
109         $(MAKEPROFILING) innfeed
110         mv innfeed innfeedp
111         rm -f $(OBJECTS)
112
113
114 ##  Dependencies.  Default list, below, is probably good enough.
115
116 depend: Makefile $(SOURCES)
117         $(MAKEDEPEND) '$(CFLAGS)' $(SOURCES)
118
119 # DO NOT DELETE THIS LINE -- make depend depends on it.
120 article.o: article.c innfeed.h ../include/inn/timer.h \
121   ../include/inn/defines.h ../include/inn/system.h ../include/config.h \
122   ../include/inn/defines.h ../include/clibrary.h ../include/config.h \
123   ../include/portable/mmap.h ../include/config.h \
124   ../include/inn/messages.h ../include/libinn.h ../include/storage.h \
125   article.h misc.h buffer.h endpoint.h
126 buffer.o: buffer.c innfeed.h ../include/inn/timer.h \
127   ../include/inn/defines.h ../include/inn/system.h ../include/config.h \
128   ../include/inn/defines.h ../include/clibrary.h ../include/config.h \
129   ../include/inn/messages.h ../include/libinn.h buffer.h misc.h
130 config_l.o: config_l.c innfeed.h ../include/inn/timer.h \
131   ../include/inn/defines.h ../include/inn/system.h ../include/libinn.h \
132   ../include/inn/defines.h ../include/config.h configfile.h config_y.h \
133   misc.h ../include/config.h
134 config_y.o: config_y.c innfeed.h ../include/inn/timer.h \
135   ../include/inn/defines.h ../include/inn/system.h ../include/config.h \
136   ../include/inn/defines.h ../include/clibrary.h ../include/config.h \
137   ../include/inn/messages.h ../include/libinn.h configfile.h misc.h
138 endpoint.o: endpoint.c innfeed.h ../include/inn/timer.h \
139   ../include/inn/defines.h ../include/inn/system.h ../include/config.h \
140   ../include/inn/defines.h ../include/clibrary.h ../include/config.h \
141   ../include/portable/socket.h ../include/config.h \
142   ../include/portable/time.h ../include/inn/innconf.h \
143   ../include/inn/messages.h ../include/libinn.h buffer.h misc.h \
144   configfile.h endpoint.h host.h
145 host.o: host.c innfeed.h ../include/inn/timer.h ../include/inn/defines.h \
146   ../include/inn/system.h ../include/config.h ../include/inn/defines.h \
147   ../include/clibrary.h ../include/config.h ../include/portable/socket.h \
148   ../include/config.h ../include/inn/innconf.h ../include/inn/messages.h \
149   ../include/libinn.h article.h misc.h buffer.h configfile.h connection.h \
150   endpoint.h host.h innlistener.h tape.h
151 innlistener.o: innlistener.c innfeed.h ../include/inn/timer.h \
152   ../include/inn/defines.h ../include/inn/system.h ../include/config.h \
153   ../include/inn/defines.h ../include/clibrary.h ../include/config.h \
154   ../include/inn/messages.h ../include/libinn.h article.h misc.h buffer.h \
155   configfile.h endpoint.h host.h innlistener.h ../include/nntp.h tape.h
156 main.o: main.c innfeed.h ../include/inn/timer.h ../include/inn/defines.h \
157   ../include/inn/system.h ../include/config.h ../include/inn/defines.h \
158   ../include/clibrary.h ../include/config.h ../include/portable/socket.h \
159   ../include/config.h ../include/portable/time.h ../include/inn/innconf.h \
160   ../include/inn/messages.h ../include/libinn.h ../include/storage.h \
161   article.h misc.h buffer.h configfile.h connection.h endpoint.h host.h \
162   innlistener.h tape.h
163 misc.o: misc.c innfeed.h ../include/inn/timer.h ../include/inn/defines.h \
164   ../include/inn/system.h ../include/config.h ../include/inn/defines.h \
165   ../include/clibrary.h ../include/config.h ../include/inn/messages.h \
166   ../include/libinn.h endpoint.h misc.h tape.h
167 startinnfeed.o: startinnfeed.c ../include/config.h \
168   ../include/inn/defines.h ../include/inn/system.h ../include/clibrary.h \
169   ../include/config.h ../include/inn/innconf.h ../include/inn/defines.h \
170   ../include/inn/messages.h ../include/libinn.h
171 tape.o: tape.c innfeed.h ../include/inn/timer.h ../include/inn/defines.h \
172   ../include/inn/system.h ../include/config.h ../include/inn/defines.h \
173   ../include/clibrary.h ../include/config.h ../include/inn/innconf.h \
174   ../include/inn/messages.h ../include/libinn.h article.h misc.h \
175   configfile.h endpoint.h tape.h
176 version.o: version.c