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