Add COPS dissector (with a few fixes for compiling on Win32).
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.203 2000/06/07 22:57:43 gram 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-arp.c   \
39         packet-ascend.c\
40         packet-atalk.c \
41         packet-atm.c   \
42         packet-auto_rp.c   \
43         packet-bgp.c   \
44         packet-bootp.c \
45         packet-bootparams.c \
46         packet-bpdu.c  \
47         packet-cdp.c   \
48         packet-cgmp.c  \
49         packet-clip.c  \
50         packet-clnp.c  \
51         packet-cops.c  \
52         packet-data.c  \
53         packet-ddtp.c  \
54         packet-dns.c   \
55         packet-eigrp.c \
56         packet-esis.c  \
57         packet-eth.c   \
58         packet-ethertype.c   \
59         packet-fddi.c  \
60         packet-ftp.c   \
61         packet-giop.c  \
62         packet-gre.c   \
63         packet-h1.c    \
64         packet-hsrp.c  \
65         packet-http.c  \
66         packet-icmpv6.c\
67         packet-icp.c   \
68         packet-icq.c   \
69         packet-imap.c   \
70         packet-ip.c    \
71         packet-ipp.c   \
72         packet-ipsec.c \
73         packet-ipv6.c  \
74         packet-ipx.c   \
75         packet-irc.c   \
76         packet-isakmp.c\
77         packet-isis.c  \
78         packet-isis-clv.c \
79         packet-isis-hello.c \
80         packet-isis-lsp.c \
81         packet-isis-snp.c \
82         packet-isl.c   \
83         packet-l2tp.c  \
84         packet-lapb.c  \
85         packet-lapd.c  \
86         packet-ldap.c  \
87         packet-llc.c   \
88         packet-lpd.c   \
89         packet-mapi.c  \
90         packet-mip.c  \
91         packet-mount.c \
92         packet-mpls.c \
93         packet-msproxy.c \
94         packet-nbipx.c \
95         packet-nbns.c  \
96         packet-ncp.c   \
97         packet-netbios.c \
98         packet-nfs.c   \
99         packet-nlm.c   \
100         packet-nntp.c  \
101         packet-ntp.c  \
102         packet-null.c  \
103         packet-osi.c   \
104         packet-osi-options.c \
105         packet-ospf.c  \
106         packet-pim.c   \
107         packet-pop.c   \
108         packet-portmap.c   \
109         packet-ppp.c   \
110         packet-pppoe.c \
111         packet-pptp.c  \
112         packet-q2931.c \
113         packet-q931.c  \
114         packet-radius.c\
115         packet-raw.c   \
116         packet-rip.c   \
117         packet-ripng.c \
118         packet-rlogin.c \
119         packet-rpc.c   \
120         packet-rsvp.c  \
121         packet-rtcp.c  \
122         packet-rtp.c   \
123         packet-rtsp.c  \
124         packet-rx.c  \
125         packet-sap.c   \
126         packet-sdp.c   \
127         packet-smb.c   \
128         packet-smb-browse.c \
129         packet-smb-common.c \
130         packet-smb-logon.c \
131         packet-smb-mailslot.c \
132         packet-smb-pipe.c \
133         packet-sna.c   \
134         packet-snmp.c   \
135         packet-socks.c \
136         packet-srvloc.c \
137         packet-sscop.c \
138         packet-stat.c   \
139         packet-tacacs.c \
140         packet-tcp.c   \
141         packet-telnet.c\
142         packet-tftp.c  \
143         packet-time.c  \
144         packet-tns.c \
145         packet-tr.c    \
146         packet-trmac.c \
147         packet-udp.c   \
148         packet-v120.c \
149         packet-vines.c \
150         packet-vlan.c \
151         packet-vrrp.c \
152         packet-vtp.c  \
153         packet-wccp.c \
154         packet-who.c  \
155         packet-x25.c   \
156         packet-yhoo.c  \
157         packet-ypbind.c \
158         packet-ypserv.c \
159         packet-ypxfr.c
160
161 noinst_HEADERS = \
162         packet-afs.h   \
163         packet-arp.h   \
164         packet-ascend.h\
165         packet-atalk.h \
166         packet-atm.h   \
167         packet-bgp.h   \
168         packet-bootparams.h \
169         packet-bpdu.h  \
170         packet-cdp.h   \
171         packet-cgmp.h  \
172         packet-clip.h  \
173         packet-clnp.h  \
174         packet-ddtp.h  \
175         packet-dns.h   \
176         packet-esis.h  \
177         packet-eth.h   \
178         packet-fddi.h  \
179         packet-http.h  \
180         packet-ip.h    \
181         packet-ipp.h   \
182         packet-ipsec.h \
183         packet-ipv6.h  \
184         packet-ipx.h   \
185         packet-isis.h  \
186         packet-isis-clv.h \
187         packet-isis-hello.h \
188         packet-isis-lsp.h \
189         packet-isis-snp.h \
190         packet-isl.h   \
191         packet-lapb.h  \
192         packet-lapd.h  \
193         packet-ldap.h  \
194         packet-llc.h   \
195         packet-mount.h \
196         packet-nbipx.h \
197         packet-netbios.h \
198         packet-nfs.h   \
199         packet-nlm.h   \
200         packet-ntp.h  \
201         packet-null.h  \
202         packet-osi.h   \
203         packet-osi-options.h \
204         packet-ospf.h  \
205         packet-portmap.h   \
206         packet-ppp.h   \
207         packet-q2931.h \
208         packet-q931.h  \
209         packet-raw.h   \
210         packet-rip.h   \
211         packet-ripng.h \
212         packet-rpc.h   \
213         packet-rtcp.h  \
214         packet-rtp.h   \
215         packet-rx.h  \
216         packet-sdp.h   \
217         packet-smb.h   \
218         packet-smb-common.h \
219         packet-sna.h   \
220         packet-snmp.h   \
221         packet-sscop.h \
222         packet-stat.h   \
223         packet-tcp.h   \
224         packet-tftp.h  \
225         packet-tns.h \
226         packet-tr.h    \
227         packet-trmac.h \
228         packet-udp.h   \
229         packet-v120.h \
230         packet-vines.h \
231         packet-vlan.h \
232         packet-vtp.h  \
233         packet-x25.h   \
234         packet-yhoo.h  \
235         packet-ypbind.h \
236         packet-ypserv.h \
237         packet-ypxfr.h 
238
239 ETHEREAL_COMMON_SOURCES = \
240         alignment.h    \
241         asn1.c         \
242         asn1.h         \
243         column.c       \
244         column.h       \
245         conversation.c \
246         conversation.h \
247         dfilter-int.h  \
248         dfilter-grammar.y \
249         dfilter-scanner.l \
250         dfilter.c      \
251         dfilter.h      \
252         etypes.h       \
253         except.c        \
254         except.h        \
255         exceptions.h    \
256         follow.c       \
257         follow.h       \
258         inet_v6defs.h  \
259         ipproto.c      \
260         ipv4.c         \
261         ipv4.h         \
262         llcsaps.h      \
263         nlpid.h        \
264         oui.h          \
265         packet.c       \
266         packet.h       \
267         plugins.c      \
268         plugins.h      \
269         ppptypes.h     \
270         prefs.c        \
271         prefs.h        \
272         print.c        \
273         print.h        \
274         proto.c        \
275         proto.h        \
276         ps.c           \
277         ps.h           \
278         register.c     \
279         register.h     \
280         resolv.c       \
281         resolv.h       \
282         smb.h          \
283         timestamp.h    \
284         tvbuff.c        \
285         tvbuff.h        \
286         util.c         \
287         util.h         \
288         xdlc.c         \
289         xdlc.h
290
291 ethereal_SOURCES = \
292         $(DISSECTOR_SOURCES) \
293         $(ETHEREAL_COMMON_SOURCES) \
294         capture.c      \
295         capture.h      \
296         file.c         \
297         file.h         \
298         globals.h      \
299         menu.h         \
300         simple_dialog.h \
301         summary.c      \
302         summary.h      \
303         ui_util.h
304
305 ethereal_static_SOURCES = \
306         $(ethereal_SOURCES)
307
308 EXTRA_ethereal_SOURCES = \
309         dfilter-grammar.c \
310         dfilter-grammar.h \
311         dfilter-scanner.c \
312         snprintf.c      \
313         snprintf.h      \
314         snprintf-imp.h  \
315         strerror.c      \
316         strerror.h      \
317         strncasecmp.c   \
318         mkstemp.c       \
319         mkstemp.h       \
320         inet_aton.c     \
321         inet_pton.c     \
322         inet_ntop.c
323
324 # Optional objects that I know how to build. These will be
325 # linked into the ethereal executable.
326 # They will also be linked into the tethereal executable; if this
327 # list ever grows to include something that can't be linked with
328 # tethereal, or if tethereal needs something that ethereal doesn't,
329 # we should probably split this into stuff needed both
330 # by ethereal and tethereal and stuff needed only by one or the
331 # other.
332 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
333         @STRNCASECMP_O@ @MKSTEMP_O@ \
334         @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ 
335
336 # Additional libs that I know how to build. These will be
337 # linked into the ethereal executable.
338 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a
339
340 # This is the automake dependency variable for the executable
341 ethereal_DEPENDENCIES = \
342         $(ethereal_optional_objects)    \
343         $(ethereal_additional_libs)     \
344         plugins/gryphon/gryphon.la
345
346 ethereal_static_DEPENDENCIES = \
347         $(ethereal_optional_objects)    \
348         $(ethereal_additional_libs)
349
350 # This automake variable adds to the link-line for the executable.
351 #
352 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
353 # they are included in @GTK_LIBS@, and doesn't have to be linked with
354 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
355 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
356 # applications are X applications).
357 ethereal_LDADD = \
358         $(ethereal_optional_objects)    \
359         $(ethereal_additional_libs)     \
360         @SNMP_LIBS@                     \
361         "-dlopen" self  \
362         "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@
363
364 ethereal_static_LDADD = \
365         $(ethereal_optional_objects)    \
366         $(ethereal_additional_libs) \
367         @SNMP_LIBS@                     \
368         @PCAP_LIBS@ @GTK_LIBS@
369
370 ethereal_LDFLAGS = -export-dynamic
371 ethereal_static_LDFLAGS = -Wl,-static
372
373 tethereal_SOURCES = \
374         $(DISSECTOR_SOURCES) \
375         $(ETHEREAL_COMMON_SOURCES) \
376         tethereal.c
377
378 # Additional libs that I know how to build. These will be
379 # linked into the tethereal executable.
380 tethereal_additional_libs = wiretap/libwiretap.a
381
382 # This is the automake dependency variable for the executable
383 tethereal_DEPENDENCIES = \
384         $(ethereal_optional_objects)    \
385         $(tethereal_additional_libs)    \
386         plugins/gryphon/gryphon.la
387
388 # This automake variable adds to the link-line for the executable
389 tethereal_LDADD = wiretap/libwiretap.a  \
390         $(ethereal_optional_objects)    \
391         $(tethereal_additional_libs)    \
392         @SNMP_LIBS@                     \
393         "-dlopen" self  \
394         "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
395         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
396
397 tethereal_LDFLAGS = -export-dynamic
398
399 editcap_SOURCES = editcap.c
400
401 # This is the automake dependency variable for the executable
402 editcap_DEPENDENCIES = wiretap/libwiretap.a
403
404 # This automake variable adds to the link-line for the executable
405 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
406
407 #
408 # Build "register.c", which contains a function "register_all_protocols()"
409 # that calls the register routines for all protocols.
410 #
411 # We do this by grepping through sources.  If that turns out to be too slow,
412 # maybe we could just require every .o file to have an register routine
413 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
414 #
415 # Formatting conventions:  The name of the proto_register_* routines must
416 # start in column zero, or must be preceded only by "void " starting in
417 # column zero, and must not be inside #if.
418 #
419 # We assume that all dissector routines are in "packet-XXX.c" files,
420 # or in "packet.c".
421 #
422 # For some unknown reason, having a big "for" loop in the Makefile
423 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
424 # they seem to pass only the first few names in the list to the shell,
425 # for some reason.
426 #
427 # Therefore, we have a script to generate the "register.c" file.
428 #
429 # The first argument is the directory in which the source files live.
430 # All subsequent arguments are the files to scan.
431 #
432 register.c: packet.c $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
433         @echo Making register.c
434         @$(srcdir)/make-reg-dotc $(srcdir) packet.c $(DISSECTOR_SOURCES)
435
436 ps.c: print.ps rdps
437         ./rdps $(srcdir)/print.ps ps.c
438
439 rdps: rdps.c
440         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
441
442 randpkt.o: randpkt.c
443         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
444
445 randpkt: randpkt.o wiretap/libwiretap.a
446         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
447
448 tvbtest: tvbtest.o tvbuff.o except.o
449
450 DISTCLEANFILES =        \
451         register.c      \
452         rdps            \
453         ps.c            \
454         *~
455
456 EXTRA_DIST = \
457         config.h.win32          \
458         config.nmake            \
459         debian/README.debian    \
460         debian/changelog        \
461         debian/control          \
462         debian/copyright        \
463         debian/dirs             \
464         debian/docs             \
465         debian/menu             \
466         debian/postinst         \
467         debian/prerm            \
468         debian/rules            \
469         doc/README.developer    \
470         doc/Makefile.in         \
471         doc/Makefile.am         \
472         doc/README.regression   \
473         doc/README.tvbuff       \
474         doc/dfilter2pod.in      \
475         doc/editcap.pod         \
476         doc/ethereal.pod.template \
477         doc/randpkt.txt         \
478         doc/tethereal.pod.template \
479         editcap.c               \
480         ethereal.spec.in         \
481         getopt.c                \
482         getopt.h                \
483         ieee-float.h            \
484         image/editcap.rc        \
485         image/ethereal48x48-trans.png  \
486         image/ethereal48x48.png \
487         image/ethereal.ico      \
488         image/ethereal.rc       \
489         image/icon-excl.xpm     \
490         image/icon-ethereal.xpm \
491         image/tethereal.rc      \
492         INSTALL.configure       \
493         Makefile.nmake          \
494         make-reg-dotc           \
495         manuf                   \
496         print.ps                \
497         README.aix              \
498         README.bsd              \
499         README.hpux             \
500         README.irix             \
501         README.linux            \
502         README.tru64            \
503         README.vmware           \
504         README.win32            \
505         randpkt.c               \
506         rdps.c                  \
507         tvbtest.c               \
508         TODO
509
510 if SETUID_INSTALL
511 install-exec-hook:
512         -chmod +s $(DESTDIR)$(bindir)/ethereal
513         -chmod +s $(DESTDIR)$(bindir)/tethereal
514         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
515 else
516 install-exec-hook:
517 endif
518
519 #
520 # Currently register.c can be included in the distribution because
521 # we always build all protocol dissectors. We used to have to check
522 # whether or not to build the snmp dissector. If we again need to
523 # variably build something, making register.c non-portable, uncomment
524 # the dist-hook line below.
525 #
526 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
527 # its contents depend on the configuration, and therefore we want it
528 # to be built when the first "make" is done; however, Automake insists
529 # on putting *all* source into the distribution.
530 #
531 # We work around this by having a "dist-hook" rule that deletes
532 # "register.c", so that "dist" won't pick it up.
533 #
534 #dist-hook:
535 #       @rm -f $(distdir)/register.c
536
537 SUBDIRS = wiretap gtk plugins @ethereal_SUBDIRS@
538
539 ethereal.1: ethereal doc/ethereal.pod.template
540         (cd doc ; \
541         $(MAKE) ../ethereal.1 )
542
543 tethereal.1: tethereal doc/tethereal.pod.template
544         (cd doc ; \
545         $(MAKE) ../tethereal.1 )
546
547 editcap.1: doc/editcap.pod
548         (cd doc ; \
549         $(MAKE) ../editcap.1 )
550
551 dfilter-scanner.c : dfilter-scanner.l
552         $(LEX) -Pdfilter_ -odfilter-scanner.c $(srcdir)/dfilter-scanner.l
553
554 libtool: $(LIBTOOL_DEPS)
555         $(SHELL) ./config.status --recheck