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