From Frank Singleton: install idl2eth in "/usr/local/bin".
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.365 2001/09/10 22:06:33 guy Exp $
5 #
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@ethereal.com>
8 # Copyright 1998 Gerald Combs
9
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # as published by the Free Software Foundation; either version 2
13 # of the License, or (at your option) any later version.
14
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
24 ACLOCAL_AMFLAGS = `./aclocal-flags`
25
26 #
27 # This is a hideous hack.
28 #
29 # Automake needs to know into which sections to install various man
30 # pages; if the names in "man_MANS" have suffixes, it can infer the
31 # sections from the name (e.g., "hello.1" goes in section 1), but if
32 # they don't have suffixes, it can't tell what sections to put them, and
33 # it just gives up and doesn't create any rules to install them (and it
34 # gives up silently, so you have no clue what's wrong).
35 #
36 # Therefore, we can't just set "man_MANS" to a list of variables to be
37 # filled in by the configure script, as those variables don't have man
38 # page section numbers.
39 #
40 # It turns out (although this is not documented anywhere I could find
41 # in the automake Info file) that if you define, instead, variables with
42 # names like "man{section}_MANS", automake will infer that the names in
43 # those variables are the names of man pages to be installed in section
44 # "{section}".
45 #
46 # So, as all our man pages go in section 1, we define "man1_MANS" to
47 # contain all the man page.
48 #
49 # *However*, if "man_MANS" isn't defined at all, automake concludes that
50 # there are no man pages, the fact that, say, "man1_MANS" is defined
51 # nonwithstanding!  (I suspect this is the result of a mistaken attempt
52 # to get people to fix their automake files not to use "MANS"; if "MANS"
53 # is defined, it prints a warning and sets the exit status, but doesn't
54 # exit, and then it just gives up if "man_MANS" isn't defined,
55 # presumably on the theory that the only reason it wouldn't be defined
56 # is because the automake file uses the obsolete "MANS" variable instead
57 # of the shiny new "man_MANS" variable.)
58 #
59 # So we also define "man_MANS", but don't define it as anything;
60 # automake will arrange that the Makefile define it as the union of all
61 # the "man{section}_MANS" variables.
62 #
63 bin_PROGRAMS = @ethereal_bin@ @editcap_bin@ @mergecap_bin@ @tethereal_bin@ @dftest_bin@ @randpkt_bin@ @text2pcap_bin@ @idl2eth_bin@
64 man1_MANS = @ethereal_man@ @editcap_man@ @mergecap_man@ @tethereal_man@ @text2pcap_man@ @idl2eth_man@
65 man_MANS = 
66
67 EXTRA_PROGRAMS = ethereal ethereal_static tethereal tethereal_static editcap mergecap dftest text2pcap
68
69 sysconf_DATA = manuf
70
71 DISSECTOR_SRC = \
72         packet-aarp.c  \
73         packet-afs.c   \
74         packet-aim.c   \
75         packet-arp.c   \
76         packet-ascend.c\
77         packet-atalk.c \
78         packet-atm.c   \
79         packet-auto_rp.c   \
80         packet-bacapp.c   \
81         packet-bacnet.c   \
82         packet-bgp.c   \
83         packet-bootp.c \
84         packet-bootparams.c \
85         packet-bpdu.c  \
86         packet-bvlc.c \
87         packet-bxxp.c \
88         packet-cdp.c   \
89         packet-cgmp.c  \
90         packet-chdlc.c  \
91         packet-clip.c  \
92         packet-clnp.c  \
93         packet-cops.c  \
94         packet-cups.c  \
95         packet-data.c  \
96         packet-dcerpc.c  \
97         packet-dcerpc-conv.c  \
98         packet-dcerpc-epm.c  \
99         packet-dcerpc-mgmt.c  \
100         packet-dcerpc-remact.c  \
101         packet-dcerpc-oxid.c  \
102         packet-ddtp.c  \
103         packet-dec-bpdu.c \
104         packet-diameter.c \
105         packet-dns.c   \
106         packet-dsi.c   \
107         packet-dvmrp.c \
108         packet-eigrp.c \
109         packet-esis.c  \
110         packet-eth.c   \
111         packet-ethertype.c   \
112         packet-fddi.c  \
113         packet-fr.c    \
114         packet-frame.c  \
115         packet-ftp.c   \
116         packet-giop.c  \
117         packet-gmrp.c \
118         packet-gnutella.c \
119         packet-gre.c   \
120         packet-gtp.c   \
121         packet-gvrp.c  \
122         packet-h1.c    \
123         packet-h261.c  \
124         packet-hclnfsd.c  \
125         packet-hsrp.c  \
126         packet-http.c  \
127         packet-icap.c  \
128         packet-icmpv6.c\
129         packet-icp.c   \
130         packet-icq.c   \
131         packet-ieee80211.c \
132         packet-ieee8023.c \
133         packet-igmp.c  \
134         packet-igrp.c  \
135         packet-imap.c   \
136         packet-ip.c    \
137         packet-ipp.c   \
138         packet-ipsec.c \
139         packet-ipv6.c  \
140         packet-ipx.c   \
141         packet-irc.c   \
142         packet-isakmp.c\
143         packet-iscsi.c \
144         packet-isis.c  \
145         packet-isis-clv.c \
146         packet-isis-hello.c \
147         packet-isis-lsp.c \
148         packet-isis-snp.c \
149         packet-isl.c   \
150         packet-isup.c  \
151         packet-iua.c   \
152         packet-kerberos.c \
153         packet-klm.c   \
154         packet-l2tp.c  \
155         packet-lapb.c  \
156         packet-lapbether.c \
157         packet-lapd.c  \
158         packet-ldap.c  \
159         packet-ldp.c   \
160         packet-llc.c   \
161         packet-lmi.c   \
162         packet-lpd.c   \
163         packet-m2pa.c  \
164         packet-m3ua.c  \
165         packet-mapi.c  \
166         packet-mbtcp.c \
167         packet-mip.c  \
168         packet-mount.c \
169         packet-mpeg1.c  \
170         packet-mpls.c \
171         packet-mrdisc.c \
172         packet-msdp.c  \
173         packet-msnip.c \
174         packet-msproxy.c \
175         packet-mtp3.c \
176         packet-nbipx.c \
177         packet-nbns.c  \
178         packet-ncp.c   \
179         packet-ncp2222.c   \
180         packet-netbios.c \
181         packet-nfs.c   \
182         packet-nisplus.c \
183         packet-nlm.c   \
184         packet-nntp.c  \
185         packet-ntp.c  \
186         packet-null.c  \
187         packet-osi.c   \
188         packet-osi-options.c \
189         packet-ospf.c  \
190         packet-pgm.c   \
191         packet-pim.c   \
192         packet-pop.c   \
193         packet-portmap.c   \
194         packet-ppp.c   \
195         packet-pppoe.c \
196         packet-pptp.c  \
197         packet-q2931.c \
198         packet-q931.c  \
199         packet-quake.c \
200         packet-quakeworld.c \
201         packet-quake2.c \
202         packet-quake3.c \
203         packet-radius.c\
204         packet-ranap.c \
205         packet-raw.c   \
206         packet-rip.c   \
207         packet-ripng.c \
208         packet-rlogin.c \
209         packet-rpc.c   \
210         packet-rquota.c \
211         packet-rsh.c   \
212         packet-rsvp.c  \
213         packet-rtcp.c  \
214         packet-rtp.c   \
215         packet-rtsp.c  \
216         packet-rwall.c \
217         packet-rx.c  \
218         packet-sap.c   \
219         packet-sctp.c   \
220         packet-sdp.c   \
221         packet-sip.c   \
222         packet-sll.c   \
223         packet-smb.c   \
224         packet-smb-browse.c \
225         packet-smb-common.c \
226         packet-smb-logon.c \
227         packet-smb-mailslot.c \
228         packet-smb-pipe.c \
229         packet-smtp.c \
230         packet-sna.c   \
231         packet-snmp.c   \
232         packet-socks.c \
233         packet-spray.c \
234         packet-srvloc.c \
235         packet-sscop.c \
236         packet-ssl.c   \
237         packet-stat.c   \
238         packet-stat-notify.c \
239         packet-sual.c   \
240         packet-syslog.c \
241         packet-tacacs.c \
242         packet-tcp.c   \
243         packet-telnet.c\
244         packet-tftp.c  \
245         packet-time.c  \
246         packet-tns.c \
247         packet-tpkt.c  \
248         packet-tr.c    \
249         packet-trmac.c \
250         packet-udp.c   \
251         packet-v120.c \
252         packet-vines.c \
253         packet-vlan.c \
254         packet-vrrp.c \
255         packet-vtp.c  \
256         packet-wccp.c \
257         packet-wcp.c \
258         packet-who.c  \
259         packet-wap.c \
260         packet-wtls.c \
261         packet-wsp.c \
262         packet-wtp.c \
263         packet-x11.c   \
264         packet-x25.c   \
265         packet-xot.c   \
266         packet-yhoo.c  \
267         packet-ypbind.c \
268         packet-yppasswd.c \
269         packet-ypserv.c \
270         packet-ypxfr.c \
271         packet-zebra.c
272
273 if HAVE_PLUGINS
274 plugin_src = \
275         plugins/gryphon/packet-gryphon.c \
276         plugins/mgcp/packet-mgcp.c \
277         plugins/giop/packet-cosnaming.c \
278         plugins/giop/packet-coseventcomm.c
279
280 plugin_static_ldadd = \
281         plugins/gryphon/packet-gryphon-static.o         \
282         plugins/mgcp/packet-mgcp-static.o               \
283         plugins/giop/packet-cosnaming-static.o          \
284         plugins/giop/packet-coseventcomm-static.o
285
286 plugin_libs = \
287         plugins/gryphon/gryphon.la \
288         plugins/mgcp/mgcp.la \
289         plugins/giop/cosnaming.la \
290         plugins/giop/coseventcomm.la
291
292 plugin_ldadd = \
293         "-dlopen" self  \
294         "-dlopen" plugins/gryphon/gryphon.la \
295         "-dlopen" plugins/mgcp/mgcp.la \
296         "-dlopen" plugins/giop/cosnaming.la \
297         "-dlopen" plugins/giop/coseventcomm.la
298 else
299 plugin_src =
300
301 plugin_static_ldadd =
302
303 plugin_libs =
304
305 plugin_ldadd =
306 endif
307
308 noinst_HEADERS = \
309         packet-afs.h   \
310         packet-afs-macros.h \
311         packet-afs-register-info.h \
312         packet-afs-defs.h \
313         packet-arp.h   \
314         packet-atalk.h \
315         packet-bgp.h   \
316         packet-bootparams.h \
317         packet-chdlc.h \
318         packet-clip.h  \
319         packet-dcerpc.h \
320         packet-ddtp.h  \
321         packet-diameter-defs.h \
322         packet-dns.h   \
323         packet-dvmrp.h \
324         packet-esis.h  \
325         packet-eth.h   \
326         packet-fddi.h  \
327         packet-fr.h    \
328         packet-frame.h  \
329         packet-giop.h  \
330         packet-gnutella.h \
331         packet-hclnfsd.h  \
332         packet-http.h  \
333         packet-ieee80211.h \
334         packet-ieee8023.h \
335         packet-ip.h    \
336         packet-ipsec.h \
337         packet-ipv6.h  \
338         packet-ipx.h   \
339         packet-isis.h  \
340         packet-isis-clv.h \
341         packet-isis-hello.h \
342         packet-isis-lsp.h \
343         packet-isis-snp.h \
344         packet-isl.h   \
345         packet-klm.h   \
346         packet-ldap.h  \
347         packet-llc.h   \
348         packet-mount.h \
349         packet-mrdisc.h \
350         packet-msnip.h \
351         packet-ncp-int.h \
352         packet-netbios.h \
353         packet-nfs.h   \
354         packet-nisplus.h \
355         packet-nlm.h   \
356         packet-ntp.h  \
357         packet-null.h  \
358         packet-osi.h   \
359         packet-osi-options.h \
360         packet-pgm.h   \
361         packet-pim.h   \
362         packet-portmap.h   \
363         packet-ppp.h   \
364         packet-q931.h  \
365         packet-raw.h   \
366         packet-ripng.h \
367         packet-rpc.h   \
368         packet-rquota.h \
369         packet-rtcp.h  \
370         packet-rtp.h   \
371         packet-rwall.h  \
372         packet-rx.h  \
373         packet-sll.h   \
374         packet-smb.h   \
375         packet-smb-browse.h \
376         packet-smb-common.h \
377         packet-smb-logon.h \
378         packet-smb-mailslot.h \
379         packet-smb-pipe.h \
380         packet-sna.h   \
381         packet-snmp.h   \
382         packet-spray.h \
383         packet-stat.h   \
384         packet-stat-notify.h \
385         packet-tcp.h   \
386         packet-tns.h \
387         packet-tpkt.h  \
388         packet-tr.h    \
389         packet-udp.h   \
390         packet-vines.h \
391         packet-vlan.h \
392         packet-wccp.h \
393         packet-wap.h \
394         packet-wtls.h \
395         packet-wtp.h \
396         packet-wsp.h \
397         packet-x11-keysym.h     \
398         packet-yhoo.h  \
399         packet-ypbind.h \
400         packet-yppasswd.h \
401         packet-ypserv.h \
402         packet-ypxfr.h 
403
404 ETHEREAL_COMMON_SRC = \
405         aftypes.h      \
406         alignment.h    \
407         afn.c          \
408         afn.h          \
409         asn1.c         \
410         asn1.h         \
411         bridged_pids.h \
412         column.c       \
413         column.h       \
414         color.h        \
415         etypes.h       \
416         follow.c       \
417         follow.h       \
418         greproto.h     \
419         in_cksum.c     \
420         in_cksum.h     \
421         ipproto.c      \
422         ipproto.h      \
423         llcsaps.h      \
424         nlpid.h        \
425         oui.h          \
426         ppptypes.h     \
427         prefs.c        \
428         prefs.h        \
429         prefs-int.h    \
430         print.c        \
431         print.h        \
432         ps.c           \
433         ps.h           \
434         ptvcursor.c     \
435         ptvcursor.h     \
436         reassemble.c   \
437         reassemble.h   \
438         register.h     \
439         smb.h          \
440         util.c         \
441         util.h         \
442         x11-declarations.h \
443         x11-register-info.h \
444         xdlc.c         \
445         xdlc.h
446
447 BUILT_SOURCES = \
448         x11-declarations.h \
449         x11-register-info.h
450
451 ethereal_SOURCES = \
452         $(DISSECTOR_SRC) \
453         $(ETHEREAL_COMMON_SRC) \
454         register.c     \
455         capture.c      \
456         capture.h      \
457         file.c         \
458         file.h         \
459         filters.c      \
460         filters.h      \
461         globals.h      \
462         menu.h         \
463         progress_dlg.h \
464         proto_hier_stats.h      \
465         proto_hier_stats.c      \
466         simple_dialog.h \
467         statusbar.h    \
468         summary.c      \
469         summary.h      \
470         ui_util.h
471
472 ethereal_static_SOURCES = \
473         $(DISSECTOR_SRC) \
474         $(ETHEREAL_COMMON_SRC) \
475         register-static.c     \
476         capture.c      \
477         capture.h      \
478         file.c         \
479         file.h         \
480         filters.c      \
481         filters.h      \
482         globals.h      \
483         menu.h         \
484         progress_dlg.h \
485         proto_hier_stats.h      \
486         proto_hier_stats.c      \
487         simple_dialog.h \
488         statusbar.h    \
489         summary.c      \
490         summary.h      \
491         ui_util.h       
492
493 EXTRA_ethereal_SOURCES = \
494         snprintf.c      \
495         snprintf.h      \
496         snprintf-imp.h  \
497         strerror.c      \
498         strerror.h      \
499         strcasecmp.c    \
500         strncasecmp.c   \
501         mkstemp.c       \
502         mkstemp.h       \
503         strptime.c      \
504         strptime.h
505
506 # Optional objects that I know how to build. These will be
507 # linked into the ethereal executable.
508 # They will also be linked into the tethereal executable; if this
509 # list ever grows to include something that can't be linked with
510 # tethereal, or if tethereal needs something that ethereal doesn't,
511 # we should probably split this into stuff needed both
512 # by ethereal and tethereal and stuff needed only by one or the
513 # other.
514 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
515         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
516
517 # Additional libs that I know how to build. These will be
518 # linked into the ethereal executable.
519 ethereal_additional_libs = \
520         wiretap/libwiretap.a    \
521         gtk/libui.a             \
522         epan/libethereal.a      \
523         epan/ftypes/libftypes.a \
524         epan/dfilter/libdfilter.a
525
526 # This is the automake dependency variable for the executable
527 ethereal_DEPENDENCIES = \
528         $(ethereal_optional_objects)    \
529         $(ethereal_additional_libs)     \
530         $(plugin_libs)
531
532 ethereal_static_DEPENDENCIES = \
533         $(ethereal_optional_objects)    \
534         $(ethereal_additional_libs)
535
536 # This automake variable adds to the link-line for the executable.
537 #
538 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
539 # they are included in @GTK_LIBS@, and doesn't have to be linked with
540 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
541 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
542 # applications are X applications).
543 ethereal_LDADD = \
544         $(ethereal_optional_objects)    \
545         $(ethereal_additional_libs)     \
546         @SNMP_LIBS@ @SSL_LIBS@          \
547         $(plugin_ldadd)                 \
548         @PCAP_LIBS@ @GTK_LIBS@
549
550 ethereal_static_LDADD = \
551         "-all-static"                   \
552         $(plugin_static_ldadd)          \
553         $(ethereal_optional_objects)    \
554         $(ethereal_additional_libs)     \
555         @SNMP_LIBS@ @SSL_LIBS@          \
556         @PCAP_LIBS@ @GTK_LIBS@          
557
558 ethereal_LDFLAGS = -export-dynamic
559 ethereal_static_LDFLAGS = -Wl,-static
560
561 tethereal_SOURCES = \
562         $(DISSECTOR_SRC) \
563         $(ETHEREAL_COMMON_SRC) \
564         register.c     \
565         tethereal.c
566
567 tethereal_static_SOURCES = \
568         $(DISSECTOR_SRC) \
569         $(ETHEREAL_COMMON_SRC) \
570         register-static.c     \
571         tethereal.c
572
573 # Additional libs that I know how to build. These will be
574 # linked into the tethereal executable.
575 tethereal_additional_libs =             \
576         wiretap/libwiretap.a            \
577         epan/libethereal.a              \
578         epan/ftypes/libftypes.a         \
579         epan/dfilter/libdfilter.a
580
581 # This is the automake dependency variable for the executable
582 tethereal_DEPENDENCIES = \
583         $(ethereal_optional_objects)    \
584         $(tethereal_additional_libs)    \
585         $(plugin_libs)
586
587 tethereal_static_DEPENDENCIES = \
588         $(ethereal_optional_objects)    \
589         $(tethereal_additional_libs)    
590
591 # This automake variable adds to the link-line for the executable
592 tethereal_LDADD = wiretap/libwiretap.a  \
593         $(ethereal_optional_objects)    \
594         $(tethereal_additional_libs)    \
595         @SNMP_LIBS@ @SSL_LIBS@          \
596         $(plugin_ldadd)                 \
597         @GLIB_LIBS@ -lm \
598         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
599
600 tethereal_static_LDADD = \
601         "-all-static"           \
602         $(plugin_static_ldadd)  \
603         wiretap/libwiretap.a    \
604         $(ethereal_optional_objects)    \
605         $(tethereal_additional_libs)    \
606         @SNMP_LIBS@ @SSL_LIBS@          \
607         @GLIB_LIBS@ -lm \
608         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
609
610 tethereal_LDFLAGS = -export-dynamic
611 tethereal_static_LDFLAGS = -Wl,-static
612
613 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
614 text2pcap_DEPENDENCIES = text2pcap.h
615
616 mergecap_SOURCES = mergecap.c
617 mergecap_DEPENDENCIES = wiretap/libwiretap.a
618
619 editcap_SOURCES = editcap.c
620
621 # This is the automake dependency variable for the executable
622 editcap_DEPENDENCIES = wiretap/libwiretap.a
623
624 # This automake variable adds to the link-line for the executable
625 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
626 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
627
628 #
629 # Build various header files for the X11 dissector.
630 #
631 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
632         $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
633
634 #
635 # Build "register.c", which contains a function "register_all_protocols()"
636 # that calls the register routines for all protocols.
637 #
638 # We do this by grepping through sources.  If that turns out to be too slow,
639 # maybe we could just require every .o file to have an register routine
640 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
641 #
642 # Formatting conventions:  The name of the proto_register_* routines must
643 # start in column zero, or must be preceded only by "void " starting in
644 # column zero, and must not be inside #if.
645 #
646 # We assume that all dissector routines are in "packet-XXX.c" files.
647 #
648 # For some unknown reason, having a big "for" loop in the Makefile
649 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
650 # they seem to pass only the first few names in the list to the shell,
651 # for some reason.
652 #
653 # Therefore, we have a script to generate the "register.c" file.
654 #
655 # The first argument is the directory in which the source files live.
656 # All subsequent arguments are the files to scan.
657 #
658 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
659         @echo Making register.c
660         @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
661
662 register-static.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
663         @echo Making register-static.c
664         @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(plugin_src) $(DISSECTOR_SRC)
665
666 ps.c: print.ps rdps
667         ./rdps $(srcdir)/print.ps ps.c
668
669 rdps: rdps.c
670         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
671
672 randpkt.o: randpkt.c
673         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
674
675 randpkt: randpkt.o wiretap/libwiretap.a
676         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
677
678
679 dftest_SOURCES = \
680         $(DISSECTOR_SRC) \
681         $(ETHEREAL_COMMON_SRC) \
682         register.c     \
683         dftest.c
684
685 dftest_additional_libs =                \
686         epan/libethereal.a              \
687         epan/ftypes/libftypes.a         \
688         epan/dfilter/libdfilter.a
689
690 dftest_DEPENDENCIES = \
691         $(ethereal_optional_objects)    \
692         $(dftest_additional_libs)       \
693         $(plugin_libs)
694
695 # This automake variable adds to the link-line for the executable
696 dftest_LDADD = \
697         $(ethereal_optional_objects)    \
698         $(dftest_additional_libs)       \
699         @SNMP_LIBS@ @SSL_LIBS@          \
700         $(plugin_ldadd)                 \
701         @GLIB_LIBS@ -lm \
702         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
703
704 dftest_LDFLAGS = -export-dynamic
705
706 DISTCLEANFILES =        \
707         register.c      \
708         register-static.c \
709         rdps            \
710         ps.c            \
711         *~
712
713 EXTRA_DIST = \
714         aclocal-flags           \
715         capture-wpcap.c         \
716         capture-wpcap.h         \
717         cleanbld.bat            \
718         config.h.win32          \
719         config.nmake            \
720         debian/README.debian    \
721         debian/changelog        \
722         debian/control          \
723         debian/copyright        \
724         debian/dirs             \
725         debian/docs             \
726         debian/menu             \
727         debian/postinst         \
728         debian/prerm            \
729         debian/rules            \
730         doc/Makefile.am         \
731         doc/Makefile.nmake      \
732         doc/README.design       \
733         doc/README.developer    \
734         doc/README.idl2eth      \
735         doc/README.plugins      \
736         doc/README.regression   \
737         doc/README.tvbuff       \
738         doc/dfilter2pod.pl      \
739         doc/editcap.pod         \
740         doc/ethereal.pod.template \
741         doc/mergecap.pod        \
742         doc/randpkt.txt         \
743         doc/tethereal.pod.template \
744         doc/text2pcap.pod       \
745         editcap.c               \
746         ethereal_be.py          \
747         ethereal_gen.py         \
748         mergecap.c              \
749         text2pcap.c             \
750         text2pcap.h             \
751         text2pcap-scanner.l     \
752         getopt.c                \
753         getopt.h                \
754         idl2eth                 \
755         ieee-float.h            \
756         image/Makefile.nmake    \
757         image/editcap.rc.in     \
758         image/elogo3d48x48.png  \
759         image/ethereal48x48-trans.png  \
760         image/ethereal48x48.png \
761         image/ethereal.ico      \
762         image/ethereal.rc.in    \
763         image/icon-excl.xpm     \
764         image/icon-ethereal.xpm \
765         image/mergecap.rc.in    \
766         image/tethereal.rc.in   \
767         image/text2pcap.rc.in   \
768         INSTALL.configure       \
769         Makefile.nmake          \
770         make-reg-dotc           \
771         make-reg-dotc.py        \
772         manuf                   \
773         ncp2222.py              \
774         packet-ncp2222.inc      \
775         print.ps                \
776         process-x11-fields.pl   \
777         README.aix              \
778         README.bsd              \
779         README.hpux             \
780         README.irix             \
781         README.linux            \
782         README.tru64            \
783         README.vmware           \
784         README.win32            \
785         randpkt.c               \
786         rdps.c                  \
787         TODO                    \
788         x11-fields
789
790 if SETUID_INSTALL
791 install-exec-hook:
792         -chmod +s $(DESTDIR)$(bindir)/ethereal
793         -chmod +s $(DESTDIR)$(bindir)/tethereal
794         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
795 else
796 install-exec-hook:
797 endif
798
799 #
800 # Currently register.c can be included in the distribution because
801 # we always build all protocol dissectors. We used to have to check
802 # whether or not to build the snmp dissector. If we again need to
803 # variably build something, making register.c non-portable, uncomment
804 # the dist-hook line below.
805 #
806 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
807 # its contents depend on the configuration, and therefore we want it
808 # to be built when the first "make" is done; however, Automake insists
809 # on putting *all* source into the distribution.
810 #
811 # We work around this by having a "dist-hook" rule that deletes
812 # "register.c", so that "dist" won't pick it up.
813 #
814 #dist-hook:
815 #       @rm -f $(distdir)/register.c
816
817 if HAVE_PLUGINS
818 SUBDIRS = tools wiretap doc epan plugins packaging @ethereal_SUBDIRS@
819 else
820 SUBDIRS = tools wiretap doc epan packaging @ethereal_SUBDIRS@
821 endif
822
823 ethereal.1: ethereal doc/ethereal.pod.template
824         (cd doc ; \
825         $(MAKE) ../ethereal.1 )
826
827 tethereal.1: tethereal doc/tethereal.pod.template
828         (cd doc ; \
829         $(MAKE) ../tethereal.1 )
830
831 editcap.1: doc/editcap.pod
832         (cd doc ; \
833         $(MAKE) ../editcap.1 )
834
835 idl2eth.1: doc/idl2eth.pod
836         (cd doc ; \
837         $(MAKE) ../idl2eth.1 )
838
839 mergecap.1: doc/mergecap.pod
840         (cd doc ; \
841         $(MAKE) ../mergecap.1 )
842
843 text2pcap.1: doc/text2pcap.pod
844         (cd doc ; \
845         $(MAKE) ../text2pcap.1 )
846
847 packet-ncp2222.c : ncp2222.py
848         $(PYTHON) $(srcdir)/ncp2222.py > $@
849
850 libtool: $(LIBTOOL_DEPS)
851         $(SHELL) ./config.status --recheck
852
853 # We load top_stagedir with an explicit path so that libtool doesn't freak.
854 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
855 stagedir=$(top_stagedir)/$(PACKAGE).stage
856 host_cpu=@host_cpu@
857 host_os=@host_os@
858
859 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
860         if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
861                 rm -rf $(stagedir) ; \
862                 $(MAKE) DESTDIR=$(stagedir) install-strip; \
863                 $(srcdir)/packaging/svr4/mkpkg \
864                         $(PACKAGE) \
865                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
866                         $(prefix) \
867                         $(top_stagedir) ; \
868         else \
869                 echo "Error: SVR4 packaging tools not found." ; \
870                 echo "Package build abandoned." ; \
871         fi
872
873 solaris-package: svr4-package
874
875 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
876
877 rpm-package: dist
878         if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
879                 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
880                 rpm -bb --clean --rmsource $(specfile) ; \
881         else \
882                 echo "Error: RPM executable and/or source directory not found." ; \
883                 echo "Package build abandoned." ; \
884         fi
885
886 srpm-package: dist
887         if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
888                 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
889                 rpm -bs --clean --rmsource $(specfile) ; \
890         else \
891                 echo "Error: RPM executable and/or source directory not found." ; \
892                 echo "Package build abandoned." ; \
893         fi
894
895 debian-package: debian/rules
896         dpkg-buildpackage -rfakeroot -us -uc
897
898 clean-local:
899         rm -rf $(top_stagedir)