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