Note that capture filters don't work on Linux loopback devices with the
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.160 2000/01/30 16:57:20 nneul Exp $
5 #
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@zing.org>
8 # Copyright 1998 Gerald Combs
9 #
10
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24
25 EXTRA_PROGRAMS = ethereal_static
26 bin_PROGRAMS = ethereal editcap tethereal
27
28 man_MANS = ethereal.1 editcap.1 tethereal.1
29
30 sysconf_DATA = manuf
31
32 # Any POSIX-compatible YACC should honor the -p flag
33 YFLAGS=-d -p dfilter_
34
35 DISSECTOR_SOURCES = \
36         packet-aarp.c  \
37         packet-afs.c   \
38         packet-afs.h   \
39         packet-arp.c   \
40         packet-arp.h   \
41         packet-ascend.c\
42         packet-atalk.c \
43         packet-atalk.h \
44         packet-atm.c   \
45         packet-auto_rp.c   \
46         packet-bgp.c   \
47         packet-bgp.h   \
48         packet-bootp.c \
49         packet-bootparams.c \
50         packet-bootparams.h \
51         packet-bpdu.c  \
52         packet-cdp.c   \
53         packet-clip.c  \
54         packet-data.c  \
55         packet-dns.c   \
56         packet-dns.h   \
57         packet-eth.c   \
58         packet-fddi.c  \
59         packet-ftp.c   \
60         packet-giop.c  \
61         packet-gre.c   \
62         packet-hsrp.c  \
63         packet-http.c  \
64         packet-icmpv6.c\
65         packet-icp.c   \
66         packet-icq.c   \
67         packet-imap.c   \
68         packet-ip.c    \
69         packet-ip.h    \
70         packet-ipp.c   \
71         packet-ipsec.c \
72         packet-ipv6.c  \
73         packet-ipv6.h  \
74         packet-ipx.c   \
75         packet-ipx.h   \
76         packet-irc.c   \
77         packet-isakmp.c\
78         packet-isis.h  \
79         packet-isis.c  \
80         packet-isis-clv.h \
81         packet-isis-clv.c \
82         packet-isis-hello.h \
83         packet-isis-hello.c \
84         packet-isis-lsp.h \
85         packet-isis-lsp.c \
86         packet-isis-snp.h \
87         packet-isis-snp.c \
88         packet-isl.c   \
89         packet-l2tp.c  \
90         packet-lapb.c  \
91         packet-lapd.c  \
92         packet-ldap.c  \
93         packet-llc.c   \
94         packet-lpd.c   \
95         packet-mapi.c  \
96         packet-mount.c \
97         packet-mount.h \
98         packet-nbipx.c \
99         packet-nbns.c  \
100         packet-ncp.c   \
101         packet-ncp.h   \
102         packet-netbios.c \
103         packet-netbios.h \
104         packet-nfs.c   \
105         packet-nfs.h   \
106         packet-nlm.c   \
107         packet-nlm.h   \
108         packet-nntp.c  \
109         packet-ntp.c  \
110         packet-ntp.h  \
111         packet-null.c  \
112         packet-osi.c   \
113         packet-ospf.c  \
114         packet-ospf.h  \
115         packet-pim.c   \
116         packet-pop.c   \
117         packet-portmap.c   \
118         packet-portmap.h   \
119         packet-ppp.c   \
120         packet-pppoe.c \
121         packet-pptp.c  \
122         packet-q2931.c \
123         packet-q931.c  \
124         packet-q931.h  \
125         packet-radius.c\
126         packet-raw.c   \
127         packet-rip.c   \
128         packet-rip.h   \
129         packet-ripng.c \
130         packet-ripng.h \
131         packet-rpc.c   \
132         packet-rpc.h   \
133         packet-rsvp.c  \
134         packet-rsvp.h  \
135         packet-rtsp.c  \
136         packet-rx.c  \
137         packet-rx.h  \
138         packet-sap.c   \
139         packet-sdp.c   \
140         packet-smb.c   \
141         packet-sna.c   \
142         packet-sna.h   \
143         packet-snmp.c   \
144         packet-snmp.h   \
145         packet-srvloc.c \
146         packet-sscop.c \
147         packet-stat.c   \
148         packet-stat.h   \
149         packet-tacacs.c \
150         packet-tcp.c   \
151         packet-telnet.c\
152         packet-tftp.c  \
153         packet-tns.c \
154         packet-tns.h \
155         packet-tr.c    \
156         packet-trmac.c \
157         packet-udp.c   \
158         packet-v120.c \
159         packet-vines.c \
160         packet-vines.h \
161         packet-vlan.c \
162         packet-vrrp.c \
163         packet-wccp.c\
164         packet-who.c\
165         packet-x25.c   \
166         packet-yhoo.c  \
167         packet-yhoo.h  \
168         packet-ypbind.c \
169         packet-ypbind.h \
170         packet-ypserv.c \
171         packet-ypserv.h \
172         packet-ypxfr.c \
173         packet-ypxfr.h 
174
175 ETHEREAL_COMMON_SOURCES = \
176         alignment.h    \
177         asn1.c         \
178         asn1.h         \
179         column.c       \
180         column.h       \
181         conversation.c \
182         conversation.h \
183         dfilter-int.h  \
184         dfilter-grammar.y \
185         dfilter-scanner.l \
186         dfilter.c      \
187         dfilter.h      \
188         ethertype.c    \
189         etypes.h       \
190         follow.c       \
191         follow.h       \
192         inet_v6defs.h  \
193         ipproto.c      \
194         ipv4.c         \
195         ipv4.h         \
196         nlpid.h        \
197         oui.h          \
198         packet.c       \
199         packet.h       \
200         plugins.c      \
201         plugins.h      \
202         prefs.c        \
203         prefs.h        \
204         print.c        \
205         print.h        \
206         proto.c        \
207         proto.h        \
208         ps.c           \
209         ps.h           \
210         register.c     \
211         register.h     \
212         resolv.c       \
213         resolv.h       \
214         smb.h          \
215         timestamp.h    \
216         util.c         \
217         util.h         \
218         xdlc.c         \
219         xdlc.h
220
221 ethereal_SOURCES = \
222         $(DISSECTOR_SOURCES) \
223         $(ETHEREAL_COMMON_SOURCES) \
224         capture.c      \
225         capture.h      \
226         colors.c       \
227         colors.h       \
228         file.c         \
229         file.h         \
230         globals.h      \
231         menu.h         \
232         simple_dialog.h \
233         summary.c      \
234         summary.h      \
235         ui_util.h
236
237 ethereal_static_SOURCES = \
238         $(ethereal_SOURCES)
239
240 EXTRA_ethereal_SOURCES = \
241         dfilter-grammar.c \
242         dfilter-grammar.h \
243         dfilter-scanner.c \
244         snprintf.c      \
245         snprintf.h      \
246         snprintf-imp.h  \
247         strerror.c      \
248         strerror.h      \
249         strncasecmp.c   \
250         mkstemp.c       \
251         mkstemp.h       \
252         inet_aton.c     \
253         inet_pton.c     \
254         inet_ntop.c
255
256 # Optional objects that I know how to build. These will be
257 # linked into the ethereal executable.
258 # They will also be linked into the tethereal executable; if this
259 # list ever grows to include something that can't be linked with
260 # tethereal, or if tethereal needs something that ethereal doesn't,
261 # we should probably split this into stuff needed both
262 # by ethereal and tethereal and stuff needed only by one or the
263 # other.
264 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
265         @STRNCASECMP_O@ @MKSTEMP_O@ \
266         @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ 
267
268 # Additional libs that I know how to build. These will be
269 # linked into the ethereal executable.
270 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a
271
272 # This is the automake dependency variable for the executable
273 ethereal_DEPENDENCIES = \
274         $(ethereal_optional_objects)    \
275         $(ethereal_additional_libs)     \
276         plugins/gryphon/gryphon.la
277
278 ethereal_static_DEPENDENCIES = \
279         $(ethereal_optional_objects)    \
280         $(ethereal_additional_libs)
281
282 # This automake variable adds to the link-line for the executable.
283 #
284 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
285 # they are included in @GTK_LIBS@, and doesn't have to be linked with
286 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
287 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
288 # applications are X applications).
289 ethereal_LDADD = \
290         $(ethereal_optional_objects)    \
291         $(ethereal_additional_libs)     \
292         @SNMP_LIBS@                     \
293         "-dlopen" self  \
294         "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@
295
296 ethereal_static_LDADD = \
297         $(ethereal_optional_objects)    \
298         $(ethereal_additional_libs) \
299         @SNMP_LIBS@                     \
300         @PCAP_LIBS@ @GTK_LIBS@
301
302 ethereal_LDFLAGS = -export-dynamic
303 ethereal_static_LDFLAGS = -Wl,-static
304
305 tethereal_SOURCES = \
306         $(DISSECTOR_SOURCES) \
307         $(ETHEREAL_COMMON_SOURCES) \
308         tethereal.c
309
310 # Additional libs that I know how to build. These will be
311 # linked into the tethereal executable.
312 tethereal_additional_libs = wiretap/libwiretap.a
313
314 # This is the automake dependency variable for the executable
315 tethereal_DEPENDENCIES = \
316         $(ethereal_optional_objects)    \
317         $(tethereal_additional_libs)    \
318         plugins/gryphon/gryphon.la
319
320 # This automake variable adds to the link-line for the executable
321 tethereal_LDADD = wiretap/libwiretap.a  \
322         $(ethereal_optional_objects)    \
323         $(tethereal_additional_libs)    \
324         @SNMP_LIBS@                     \
325         "-dlopen" self  \
326         "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
327         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
328
329 tethereal_LDFLAGS = -export-dynamic
330
331 editcap_SOURCES = editcap.c
332
333 # This is the automake dependency variable for the executable
334 editcap_DEPENDENCIES = wiretap/libwiretap.a
335
336 # This automake variable adds to the link-line for the executable
337 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
338
339 #
340 # Build "register.c", which contains a function "register_all_protocols()"
341 # that calls the register routines for all protocols.
342 #
343 # We do this by grepping through sources.  If that turns out to be too slow,
344 # maybe we could just require every .o file to have an register routine
345 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
346 #
347 # Formatting conventions:  The name of the proto_register_* routines must
348 # start in column zero, or must be preceded only by "void " starting in
349 # column zero, and must not be inside #if.
350 #
351 # We assume that all dissector routines are in "packet-XXX.c" files,
352 # or in "packet.c".
353 #
354 # For some unknown reason, having a big "for" loop in the Makefile
355 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
356 # they seem to pass only the first few names in the list to the shell,
357 # for some reason.
358 #
359 # Therefore, we have a script to generate the "register.c" file.
360 #
361 # The first argument is the directory in which the source files live.
362 # All subsequent arguments are the files to scan.
363 #
364 register.c: packet.c $(DISSECTOR_SOURCES)
365         @echo Making register.c
366         @$(srcdir)/make-reg-dotc $(srcdir) packet.c $(DISSECTOR_SOURCES)
367
368 ps.c: print.ps rdps
369         ./rdps $(srcdir)/print.ps ps.c
370
371 rdps: rdps.c
372         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
373
374 randpkt.o: randpkt.c
375         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
376
377 randpkt: randpkt.o wiretap/libwiretap.a
378         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
379
380 DISTCLEANFILES =        \
381         register.c      \
382         rdps            \
383         ps.c            \
384         *~
385
386 EXTRA_DIST = \
387         config.h.win32          \
388         debian/README.debian    \
389         debian/changelog        \
390         debian/control          \
391         debian/copyright        \
392         debian/dirs             \
393         debian/docs             \
394         debian/menu             \
395         debian/postinst         \
396         debian/prerm            \
397         debian/rules            \
398         doc/Makefile.in         \
399         doc/Makefile.am         \
400         doc/dfilter2pod.in      \
401         doc/editcap.pod         \
402         doc/ethereal.pod.template \
403         doc/proto_tree          \
404         doc/randpkt.txt         \
405         doc/tethereal.pod.template \
406         editcap.c               \
407         ethereal.spec.in         \
408         image/ethereal48x48-trans.png  \
409         image/ethereal48x48.png \
410         image/icon-excl.xpm     \
411         image/icon-ethereal.xpm \
412         INSTALL.configure       \
413         Makefile.nmake          \
414         make-reg-dotc           \
415         manuf                   \
416         print.ps                \
417         README.aix              \
418         README.hpux             \
419         README.irix             \
420         README.linux            \
421         README.tru64            \
422         README.vmware           \
423         README.win32            \
424         randpkt.c               \
425         rdps.c                  \
426         TODO
427
428 #
429 # Currently register.c can be included in the distribution because
430 # we always build all protocol dissectors. We used to have to check
431 # whether or not to build the snmp dissector. If we again need to
432 # variably build something, making register.c non-portable, uncomment
433 # the dist-hook line below.
434 #
435 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
436 # its contents depend on the configuration, and therefore we want it
437 # to be built when the first "make" is done; however, Automake insists
438 # on putting *all* source into the distribution.
439 #
440 # We work around this by having a "dist-hook" rule that deletes
441 # "register.c", so that "dist" won't pick it up.
442 #
443 #dist-hook:
444 #       @rm -f $(distdir)/register.c
445
446 SUBDIRS = wiretap gtk plugins @ethereal_SUBDIRS@
447
448 ethereal.1: ethereal doc/ethereal.pod.template
449         (cd doc ; \
450         $(MAKE) ../ethereal.1 )
451
452 tethereal.1: tethereal doc/tethereal.pod.template
453         (cd doc ; \
454         $(MAKE) ../tethereal.1 )
455
456 editcap.1: doc/editcap.pod
457         (cd doc ; \
458         $(MAKE) ../editcap.1 )
459
460 dfilter-scanner.c : dfilter-scanner.l
461         $(LEX) -Pdfilter_ -t $(srcdir)/dfilter-scanner.l > dfilter-scanner.c
462
463 libtool: $(LIBTOOL_DEPS)
464         $(SHELL) ./config.status --recheck