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