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