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