Move the list of dissectors (DISSECTOR_SRC) out of Makefile.am and
[metze/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.699 2004/01/21 21:46:58 jmayer 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 man4_MANS = @etherealfilter_man@
67 man_MANS =
68
69 EXTRA_PROGRAMS = ethereal tethereal editcap mergecap dftest text2pcap
70 EXTRA_SCRIPTS = idl2eth
71
72 #
73 # Ethereal configuration files are put in $(pkgdatadir).  It currently
74 # contains the "manuf" file and a "diameter" directory.
75 #
76 pkgdata_DATA = manuf
77
78 #
79 # Install the Diameter DTD and XML files in the "diameter" subdirectory
80 # of that directory.
81 #
82 diameterdir = $(pkgdatadir)/diameter
83 diameter_DATA = dictionary.dtd dictionary.xml mobileipv4.xml \
84         nasreq.xml sunping.xml
85
86 include Makefile.common
87
88 if HAVE_PLUGINS
89 plugin_libs = \
90         plugins/acn/acn.la \
91         plugins/artnet/artnet.la \
92         plugins/asn1/asn1.la \
93         plugins/docsis/docsis.la \
94         plugins/enttec/enttec.la \
95         plugins/giop/cosnaming.la \
96         plugins/giop/coseventcomm.la \
97         plugins/gryphon/gryphon.la \
98         plugins/irda/irda.la \
99         plugins/lwres/lwres.la \
100         plugins/megaco/megaco.la \
101         plugins/mgcp/mgcp.la \
102         plugins/pcli/pcli.la \
103         plugins/rdm/rdm.la \
104         plugins/rtnet/rtnet.la \
105         plugins/v5ua/v5ua.la
106
107 if ENABLE_STATIC
108 plugin_ldadd = \
109         plugins/acn/packet-acn.o \
110         plugins/artnet/packet-artnet.o \
111         plugins/asn1/packet-asn1.o \
112         plugins/docsis/packet-bpkmattr.o \
113         plugins/docsis/packet-bpkmreq.o \
114         plugins/docsis/packet-bpkmrsp.o \
115         plugins/docsis/packet-docsis.o \
116         plugins/docsis/packet-dsaack.o \
117         plugins/docsis/packet-dsareq.o \
118         plugins/docsis/packet-dsarsp.o \
119         plugins/docsis/packet-dscack.o \
120         plugins/docsis/packet-dscreq.o \
121         plugins/docsis/packet-dscrsp.o \
122         plugins/docsis/packet-dsdreq.o \
123         plugins/docsis/packet-dsdrsp.o \
124         plugins/docsis/packet-macmgmt.o \
125         plugins/docsis/packet-map.o \
126         plugins/docsis/packet-regack.o \
127         plugins/docsis/packet-regreq.o \
128         plugins/docsis/packet-regrsp.o \
129         plugins/docsis/packet-rngreq.o \
130         plugins/docsis/packet-rngrsp.o \
131         plugins/docsis/packet-tlv.o \
132         plugins/docsis/packet-uccreq.o \
133         plugins/docsis/packet-uccrsp.o \
134         plugins/docsis/packet-ucd.o \
135         plugins/enttec/packet-enttec.o \
136         plugins/giop/packet-cosnaming.o \
137         plugins/giop/packet-coseventcomm.o \
138         plugins/gryphon/packet-gryphon.o \
139         plugins/irda/packet-irda.o \
140         plugins/lwres/packet-lwres.o \
141         plugins/megaco/packet-megaco.o \
142         plugins/mgcp/packet-mgcp.o \
143         plugins/pcli/packet-pcli.o \
144         plugins/rdm/packet-rdm.o \
145         plugins/rtnet/packet-rtnet.o \
146         plugins/v5ua/packet-v5ua.o
147
148 plugin_src = \
149         plugins/acn/packet-acn.c \
150         plugins/artnet/packet-artnet.c \
151         plugins/asn1/packet-asn1.c \
152         plugins/docsis/packet-bpkmattr.c \
153         plugins/docsis/packet-bpkmreq.c \
154         plugins/docsis/packet-bpkmrsp.c \
155         plugins/docsis/packet-docsis.c \
156         plugins/docsis/packet-dsaack.c \
157         plugins/docsis/packet-dsareq.c \
158         plugins/docsis/packet-dsarsp.c \
159         plugins/docsis/packet-dscack.c \
160         plugins/docsis/packet-dscreq.c \
161         plugins/docsis/packet-dscrsp.c \
162         plugins/docsis/packet-dsdreq.c \
163         plugins/docsis/packet-dsdrsp.c \
164         plugins/docsis/packet-macmgmt.c \
165         plugins/docsis/packet-map.c \
166         plugins/docsis/packet-regack.c \
167         plugins/docsis/packet-regreq.c \
168         plugins/docsis/packet-regrsp.c \
169         plugins/docsis/packet-rngreq.c \
170         plugins/docsis/packet-rngrsp.c \
171         plugins/docsis/packet-tlv.c \
172         plugins/docsis/packet-uccreq.c \
173         plugins/docsis/packet-uccrsp.c \
174         plugins/docsis/packet-ucd.c \
175         plugins/enttec/packet-enttec.c \
176         plugins/giop/packet-cosnaming.c \
177         plugins/giop/packet-coseventcomm.c \
178         plugins/gryphon/packet-gryphon.c \
179         plugins/irda/packet-irda.c \
180         plugins/lwres/packet-lwres.c \
181         plugins/megaco/packet-megaco.c \
182         plugins/mgcp/packet-mgcp.c \
183         plugins/pcli/packet-pcli.c \
184         plugins/rdm/packet-rdm.c \
185         plugins/rtnet/packet-rtnet.c \
186         plugins/v5ua/packet-v5ua.c
187
188 else            # ENABLE_STATIC
189 plugin_ldadd = \
190         "-dlopen" self  \
191         "-dlopen" plugins/acn/acn.la \
192         "-dlopen" plugins/artnet/artnet.la \
193         "-dlopen" plugins/asn1/asn1.la \
194         "-dlopen" plugins/docsis/docsis.la \
195         "-dlopen" plugins/enttec/enttec.la \
196         "-dlopen" plugins/giop/cosnaming.la \
197         "-dlopen" plugins/giop/coseventcomm.la \
198         "-dlopen" plugins/gryphon/gryphon.la \
199         "-dlopen" plugins/irda/irda.la \
200         "-dlopen" plugins/lwres/lwres.la \
201         "-dlopen" plugins/megaco/megaco.la \
202         "-dlopen" plugins/mgcp/mgcp.la \
203         "-dlopen" plugins/pcli/pcli.la \
204         "-dlopen" plugins/rdm/rdm.la \
205         "-dlopen" plugins/rtnet/rtnet.la \
206         "-dlopen" plugins/v5ua/v5ua.la
207
208 plugin_src =
209
210 endif           # ENABLE_STATIC
211
212 else            # HAVE_PLUGINS
213 plugin_src =
214
215 plugin_libs =
216
217 plugin_ldadd =
218 endif           # HAVE_PLUGINS
219
220 noinst_HEADERS = \
221         packet-afp.h   \
222         packet-afs-defs.h \
223         packet-afs-macros.h \
224         packet-afs-register-info.h \
225         packet-afs.h   \
226         packet-ansi_a.h \
227         packet-ansi_map.h \
228         packet-arcnet.h \
229         packet-arp.h   \
230         packet-atalk.h \
231         packet-atm.h   \
232         packet-bgp.h   \
233         packet-bootparams.h \
234         packet-bssap.h \
235         packet-chdlc.h \
236         packet-clearcase.h  \
237         packet-clip.h  \
238         packet-data.h \
239         packet-dccp.h \
240         packet-dcerpc-atsvc.h \
241         packet-dcerpc-browser.h \
242         packet-dcerpc-dce122.h \
243         packet-dcerpc-dcom.h \
244         packet-dcerpc-dfs.h \
245         packet-dcerpc-dnsserver.h \
246         packet-dcerpc-drsuapi.h \
247         packet-dcerpc-initshutdown.h \
248         packet-dcerpc-lsa.h \
249         packet-dcerpc-mapi.h \
250         packet-dcerpc-netlogon.h \
251         packet-dcerpc-nt.h \
252         packet-dcerpc-reg.h \
253         packet-dcerpc-samr.h \
254         packet-dcerpc-spoolss.h \
255         packet-dcerpc-srvsvc.h \
256         packet-dcerpc-svcctl.h \
257         packet-dcerpc-tapi.h \
258         packet-dcerpc-wkssvc.h \
259         packet-dcerpc.h \
260         packet-ddtp.h  \
261         packet-diameter-defs.h \
262         packet-diffserv-mpls-common.h \
263         packet-dns.h   \
264         packet-dvmrp.h \
265         packet-edonkey.h \
266         packet-esis.h  \
267         packet-eth.h   \
268         packet-fc.h \
269         packet-fcbls.h \
270         packet-fcct.h \
271         packet-fcdns.h \
272         packet-fcels.h \
273         packet-fcfcs.h \
274         packet-fcfzs.h \
275         packet-fclctl.h \
276         packet-fcp.h \
277         packet-fcsb3.h \
278         packet-fcsp.h \
279         packet-fcswils.h \
280         packet-fddi.h  \
281         packet-frame.h  \
282         packet-giop.h  \
283         packet-gnutella.h \
284         packet-gsm_a.h  \
285         packet-gssapi.h \
286         packet-gtp.h    \
287         packet-h225.h    \
288         packet-h245.h    \
289         packet-hclnfsd.h  \
290         packet-hpext.h  \
291         packet-http.h  \
292         packet-ieee80211.h \
293         packet-ieee8023.h \
294         packet-igap.h  \
295         packet-igmp.h  \
296         packet-ip.h    \
297         packet-ipfc.h  \
298         packet-ipsec.h \
299         packet-ipv6.h  \
300         packet-ipx.h   \
301         packet-isis-clv.h \
302         packet-isis-hello.h \
303         packet-isis-lsp.h \
304         packet-isis-snp.h \
305         packet-isis.h  \
306         packet-isl.h   \
307         packet-isup.h   \
308         packet-kerberos.h \
309         packet-klm.h   \
310         packet-ldap.h  \
311         packet-llc.h   \
312         packet-mip6.h  \
313         packet-mount.h \
314         packet-mrdisc.h \
315         packet-msnip.h \
316         packet-mtp3.h  \
317         packet-ncp-int.h \
318         packet-ndps.h    \
319         packet-netbios.h \
320         packet-nfs.h   \
321         packet-nisplus.h \
322         packet-nlm.h   \
323         packet-ntp.h  \
324         packet-null.h  \
325         packet-osi-options.h \
326         packet-osi.h   \
327         packet-pcnfsd.h \
328         packet-per.h   \
329         packet-pflog.h \
330         packet-pim.h   \
331         packet-portmap.h   \
332         packet-ppp.h   \
333         packet-pres.h  \
334         packet-prism.h \
335         packet-q931.h  \
336         packet-raw.h   \
337         packet-ripng.h \
338         packet-rmi.h   \
339         packet-rpc.h   \
340         packet-rquota.h \
341         packet-rsvp.h  \
342         packet-rtcp.h  \
343         packet-rtp.h   \
344         packet-rtp-events.h \
345         packet-rwall.h  \
346         packet-rx.h  \
347         packet-scsi.h  \
348         packet-ses.h   \
349         packet-sll.h   \
350         packet-smb-browse.h \
351         packet-smb-common.h \
352         packet-smb-mailslot.h \
353         packet-smb-pipe.h \
354         packet-smb-sidsnooping.h \
355         packet-sna.h   \
356         packet-snmp.h   \
357         packet-spray.h \
358         packet-stat-notify.h \
359         packet-stat.h   \
360         packet-tacacs.h \
361         packet-tcap.h  \
362         packet-tcp.h   \
363         packet-tns.h \
364         packet-tpkt.h  \
365         packet-tr.h    \
366         packet-udp.h   \
367         packet-vines.h \
368         packet-vlan.h \
369         packet-wap.h \
370         packet-wccp.h \
371         packet-wlancap.h \
372         packet-wsp.h \
373         packet-wtls.h \
374         packet-wtp.h \
375         packet-x11-keysym.h     \
376         packet-x11-keysymdef.h  \
377         packet-ypbind.h \
378         packet-yppasswd.h \
379         packet-ypserv.h \
380         packet-ypxfr.h
381
382 DISSECTOR_SUPPORT_SRC = \
383         adler32.c      \
384         adler32.h      \
385         afn.c          \
386         afn.h          \
387         aftypes.h      \
388         arcnet_pids.h  \
389         asn1.c         \
390         asn1.h         \
391         bridged_pids.h \
392         chdlctypes.h   \
393         column.c       \
394         column.h       \
395         crc32.c        \
396         crc32.h        \
397         crypt-des.c    \
398         crypt-des.h    \
399         crypt-md4.c    \
400         crypt-md4.h    \
401         crypt-md5.c    \
402         crypt-md5.h    \
403         crypt-rc4.c    \
404         crypt-rc4.h    \
405         etypes.h       \
406         follow.c       \
407         follow.h       \
408         format-oid.h   \
409         g711.c          \
410         g711.h          \
411         greproto.h     \
412         h225-persistentdata.c \
413         h225-persistentdata.h \
414         in_cksum.c     \
415         in_cksum.h     \
416         ip_opts.h      \
417         ipproto.c      \
418         ipproto.h      \
419         llcsaps.h      \
420         nlpid.h        \
421         oui.h          \
422         packet-dcerpc-nt.c \
423         ppptypes.h     \
424         prefs-int.h    \
425         prefs.c        \
426         prefs.h        \
427         ptvcursor.c     \
428         ptvcursor.h     \
429         reassemble.c   \
430         reassemble.h   \
431         req_resp_hdrs.c \
432         req_resp_hdrs.h \
433         rpc_defrag.h   \
434         rtp_pt.h       \
435         sctpppids.h    \
436         smb.h          \
437         t35.c           \
438         t35.h           \
439         tap.c           \
440         tap.h           \
441         util.c         \
442         util.h         \
443         x264_prt_id.h  \
444         xdlc.c         \
445         xdlc.h         \
446         xmlstub.c      \
447         xmlstub.h
448
449 BUILT_SOURCES = \
450         cvsversion.h    \
451         x11-declarations.h \
452         x11-register-info.h
453
454 ETHEREAL_COMMON_SRC = \
455         $(DISSECTOR_SUPPORT_SRC) \
456         $(BUILT_SOURCES) \
457         capture_stop_conditions.c   \
458         capture_stop_conditions.h   \
459         cfile.c         \
460         cfile.h         \
461         color.h        \
462         conditions.c   \
463         conditions.h   \
464         disabled_protos.c      \
465         disabled_protos.h      \
466         file.h         \
467         pcap-util.c    \
468         pcap-util.h    \
469         pcap-util-int.h \
470         pcap-util-unix.c \
471         print.c        \
472         print.h        \
473         ps.c           \
474         ps.h           \
475         range.c         \
476         range.h         \
477         register.h     \
478         ringbuffer.c   \
479         ringbuffer.h   \
480         timestats.c     \
481         timestats.h     \
482         version_info.c  \
483         version_info.h
484
485 ethereal_SOURCES = \
486         $(DISSECTOR_SRC) \
487         $(ETHEREAL_COMMON_SRC) \
488         register.c     \
489         capture.c      \
490         capture.h      \
491         file.c         \
492         filters.c      \
493         filters.h      \
494         globals.h      \
495         menu.h         \
496         progress_dlg.h \
497         proto_hier_stats.h      \
498         proto_hier_stats.c      \
499         simple_dialog.h \
500         statusbar.h    \
501         summary.c      \
502         summary.h      \
503         tap_dfilter_dlg.h \
504         ui_util.h
505
506 EXTRA_ethereal_SOURCES = \
507         snprintf.c      \
508         snprintf.h      \
509         snprintf-imp.h  \
510         strerror.c      \
511         strerror.h      \
512         strcasecmp.c    \
513         strncasecmp.c   \
514         mkstemp.c       \
515         mkstemp.h       \
516         strptime.c      \
517         strptime.h
518
519 # Optional objects that I know how to build. These will be
520 # linked into the ethereal executable.
521 # They will also be linked into the tethereal executable; if this
522 # list ever grows to include something that can't be linked with
523 # tethereal, or if tethereal needs something that ethereal doesn't,
524 # we should probably split this into stuff needed both
525 # by ethereal and tethereal and stuff needed only by one or the
526 # other.
527 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
528         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
529
530 # Additional libs that I know how to build. These will be
531 # linked into the ethereal executable.
532 ethereal_additional_libs = \
533         wiretap/libwiretap.a    \
534         gtk/libui.a             \
535         epan/libethereal.a      \
536         epan/ftypes/libftypes.a \
537         epan/dfilter/libdfilter.a
538
539 # This is the automake dependency variable for the executable
540 ethereal_DEPENDENCIES = \
541         $(ethereal_optional_objects)    \
542         $(ethereal_additional_libs)     \
543         $(plugin_libs)
544
545 # This automake variable adds to the link-line for the executable.
546 #
547 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
548 # they are included in @GTK_LIBS@, and doesn't have to be linked with
549 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
550 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
551 # applications are X applications).
552
553 if ENABLE_STATIC
554 ethereal_LDFLAGS = -Wl,-static -all-static
555 else
556 ethereal_LDFLAGS = -export-dynamic
557 endif
558
559 ethereal_LDADD = \
560         $(ethereal_optional_objects)    \
561         $(ethereal_additional_libs)     \
562         @SNMP_LIBS@ @SSL_LIBS@          \
563         $(plugin_ldadd)                 \
564         @PCRE_LIBS@ \
565         @PCAP_LIBS@ @GTK_LIBS@ @ADNS_LIBS@
566
567 TETHEREAL_TAP_SRC = \
568         tap-ansi_astat.c        \
569         tap-bootpstat.c         \
570         tap-dcerpcstat.c        \
571         tap-gsm_astat.c         \
572         tap-h225counter.c       \
573         tap-h225rassrt.c        \
574         tap-httpstat.c          \
575         tap-iostat.c            \
576         tap-iousers.c           \
577         tap-mgcpstat.c          \
578         tap-protocolinfo.c      \
579         tap-protohierstat.c     \
580         tap-rpcstat.c           \
581         tap-rpcprogs.c          \
582         tap-smbsids.c           \
583         tap-smbstat.c           \
584         tap-wspstat.c
585
586 tethereal_SOURCES = \
587         $(DISSECTOR_SRC) \
588         $(ETHEREAL_COMMON_SRC) \
589         $(TETHEREAL_TAP_SRC) \
590         tethereal-tap-register.c \
591         register.c     \
592         tethereal.c
593
594 # Additional libs that I know how to build. These will be
595 # linked into the tethereal executable.
596 tethereal_additional_libs =             \
597         wiretap/libwiretap.a            \
598         epan/libethereal.a              \
599         epan/ftypes/libftypes.a         \
600         epan/dfilter/libdfilter.a
601
602 # This is the automake dependency variable for the executable
603 tethereal_DEPENDENCIES = \
604         $(ethereal_optional_objects)    \
605         $(tethereal_additional_libs)    \
606         $(plugin_libs)
607
608 # This automake variable adds to the link-line for the executable
609 tethereal_LDADD = \
610         $(ethereal_optional_objects)    \
611         $(tethereal_additional_libs)    \
612         @SNMP_LIBS@ @SSL_LIBS@          \
613         $(plugin_ldadd)                 \
614         @PCRE_LIBS@ \
615         @GLIB_LIBS@ -lm                 \
616         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
617
618 if ENABLE_STATIC
619 tethereal_LDFLAGS = -Wl,-static -all-static
620 else
621 tethereal_LDFLAGS = -export-dynamic
622 endif
623
624 # Optional objects that I know how to build, and that are needed by
625 # text2pcap.
626 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
627
628 text2pcap_SOURCES = text2pcap.c text2pcap-scanner.l
629 text2pcap_DEPENDENCIES = text2pcap.h
630
631 # This automake variable adds to the link-line for the executable
632 text2pcap_LDADD = $(text2pcap_optional_objects) \
633         @GLIB_LIBS@ -lm
634
635 mergecap_SOURCES = mergecap.c cvsversion.h
636 mergecap_DEPENDENCIES = wiretap/libwiretap.a
637
638 editcap_SOURCES = editcap.c
639
640 # This is the automake dependency variable for the executable
641 editcap_DEPENDENCIES = wiretap/libwiretap.a
642
643 # This automake variable adds to the link-line for the executable
644 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
645 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
646
647 # Common headers
648 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap
649
650 #
651 # Build the version string
652 #
653 cvsversion.h:
654         $(PERL) $(srcdir)/make-version.pl
655
656 #
657 # Build various header files for the X11 dissector.
658 #
659 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
660         $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
661
662 #
663 # Build shell scripts by doing variable substitution.
664 # Taken from autoconf 2.13.
665 #
666 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
667
668 SUFFIXES = .sh
669 .sh:
670         rm -f $@ $@.tmp
671         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
672
673 #
674 # Build "register.c", which contains a function "register_all_protocols()"
675 # that calls the register routines for all protocols.
676 #
677 # We do this by grepping through sources.  If that turns out to be too slow,
678 # maybe we could just require every .o file to have an register routine
679 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
680 #
681 # Formatting conventions:  The name of the proto_register_* routines must
682 # start in column zero, or must be preceded only by "void " starting in
683 # column zero, and must not be inside #if.
684 #
685 # We assume that all dissector routines are in "packet-XXX.c" files.
686 #
687 # For some unknown reason, having a big "for" loop in the Makefile
688 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
689 # they seem to pass only the first few names in the list to the shell,
690 # for some reason.
691 #
692 # Therefore, we have a script to generate the "register.c" file.
693 #
694 # The first argument is the name of the file to write.
695 # The second argument is the directory in which the source files live.
696 # All subsequent arguments are the files to scan.
697 #
698 register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
699         @if test -n $(PYTHON); then \
700                 echo Making register.c with python ; \
701                 $(PYTHON) $(srcdir)/make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
702         else \
703                 echo Making register.c with shell script ; \
704                 $(srcdir)/make-reg-dotc register.c $(srcdir) \
705                         $(plugin_src) $(DISSECTOR_SRC) ; \
706         fi
707
708 #
709 # Build "tethereal-tap-register.c", which contains a function 
710 # "register_all_tap_listeners()"
711 # that calls the register routines for all tehtereal tap listeners.
712 #
713 # We do this by grepping through sources.
714 #
715 # Formatting conventions:  The name of the tap_listener_register_* 
716 # routines must start in column zero, or must be preceded only by 
717 # "void " starting in column zero, and must not be inside #if.
718 #
719 # The first argument is the directory in which the source files live.
720 # All subsequent arguments are the files to scan.
721 #
722 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) $(srcdir)/make-tapreg-dotc
723         @echo Making tethereal-tap-register.c
724         @$(srcdir)/make-tapreg-dotc tethereal-tap-register.c $(srcdir) $(TETHEREAL_TAP_SRC)
725
726 ps.c: print.ps rdps
727         ./rdps $(srcdir)/print.ps ps.c
728
729 rdps: rdps.c
730         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
731
732 randpkt.o: randpkt.c
733         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
734
735 randpkt: randpkt.o wiretap/libwiretap.a
736         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
737
738
739 dftest_SOURCES = \
740         $(DISSECTOR_SRC) \
741         $(DISSECTOR_SUPPORT_SRC) \
742         $(BUILT_SOURCES) \
743         register.c     \
744         dftest.c
745
746 dftest_additional_libs =                \
747         wiretap/libwiretap.a            \
748         epan/libethereal.a              \
749         epan/ftypes/libftypes.a         \
750         epan/dfilter/libdfilter.a
751
752 dftest_DEPENDENCIES = \
753         $(ethereal_optional_objects)    \
754         $(dftest_additional_libs)       \
755         $(plugin_libs)
756
757 # This automake variable adds to the link-line for the executable
758 dftest_LDADD = \
759         $(ethereal_optional_objects)    \
760         $(dftest_additional_libs)       \
761         @SNMP_LIBS@ @SSL_LIBS@          \
762         $(plugin_ldadd)                 \
763         @PCRE_LIBS@ \
764         @GLIB_LIBS@ -lm \
765         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
766
767 dftest_LDFLAGS = -export-dynamic
768
769 CLEANFILES =    \
770         @rdps_bin@ \
771         idl2eth
772
773 DISTCLEANFILES = \
774         aclocal-missing/*.m4 \
775         ps.c \
776         *~
777
778 MAINTAINERCLEANFILES =          \
779         register.c              \
780         ps.c
781
782 EXTRA_DIST = \
783         Ethereal.desktop        \
784         FAQ                     \
785         INSTALL.configure       \
786         Makefile.common         \
787         Makefile.nmake          \
788         README.aix              \
789         README.bsd              \
790         README.hpux             \
791         README.irix             \
792         README.linux            \
793         README.tru64            \
794         README.vmware           \
795         README.win32            \
796         TODO                    \
797         aclocal-fallback/glib-2.0.m4 \
798         aclocal-fallback/glib.m4 \
799         aclocal-fallback/gtk-2.0.m4 \
800         aclocal-fallback/gtk.m4 \
801         aclocal-flags           \
802         aclocal-missing/dummy   \
803         autogen.sh              \
804         capture-wpcap.c         \
805         capture-wpcap.h         \
806         cleanbld.bat            \
807         config.h.win32          \
808         config.nmake            \
809         debian/README.debian    \
810         debian/changelog        \
811         debian/control          \
812         debian/copyright        \
813         debian/dirs             \
814         debian/docs             \
815         debian/menu             \
816         debian/postinst         \
817         debian/prerm            \
818         debian/rules            \
819         dictionary.dtd          \
820         dictionary.xml          \
821         doc/Makefile.am         \
822         doc/Makefile.nmake      \
823         doc/README.capture      \
824         doc/README.design       \
825         doc/README.developer    \
826         doc/README.idl2eth      \
827         doc/README.plugins      \
828         doc/README.regression   \
829         doc/README.tapping      \
830         doc/README.tvbuff       \
831         doc/README.xml-output   \
832         doc/dfilter2pod.pl      \
833         doc/editcap.pod         \
834         doc/ethereal-filter.pod.template \
835         doc/ethereal.pod        \
836         doc/idl2eth.pod         \
837         doc/mergecap.pod        \
838         doc/randpkt.txt         \
839         doc/tethereal.pod       \
840         doc/text2pcap.pod       \
841         editcap.c               \
842         ethereal_be.py          \
843         ethereal_gen.py         \
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.icns     \
860         image/ethereal.ico      \
861         image/ethereal.rc.in    \
862         image/ethereal48x48-trans.png  \
863         image/ethereal48x48.png \
864         image/hi16-app-ethereal.png     \
865         image/hi32-app-ethereal.png     \
866         image/hi48-app-ethereal.png     \
867         image/icon-ethereal.xpm \
868         image/icon-excl.xpm     \
869         image/lo16-app-ethereal.png     \
870         image/lo32-app-ethereal.png     \
871         image/lo48-app-ethereal.png     \
872         image/mergecap.rc.in    \
873         image/nsis-checked.bmp  \
874         image/nsis-unchecked.bmp        \
875         image/tethereal.rc.in   \
876         image/text2pcap.rc.in   \
877         image/toolbar/capture_24.xpm    \
878         image/toolbar/cfilter_24.xpm    \
879         image/toolbar/dfilter_24.xpm    \
880         image/toolbar/stock_close_24.xpm        \
881         image/toolbar/stock_colorselector_24.xpm        \
882         image/toolbar/stock_help_24.xpm \
883         image/toolbar/stock_jump_to_24.xpm      \
884         image/toolbar/stock_open_24.xpm \
885         image/toolbar/stock_preferences_24.xpm  \
886         image/toolbar/stock_print_24.xpm        \
887         image/toolbar/stock_refresh_24.xpm      \
888         image/toolbar/stock_right_arrow_24.xpm  \
889         image/toolbar/stock_save_24.xpm \
890         image/toolbar/stock_search_24.xpm       \
891         image/toolbar/stock_stop_24.xpm \
892         image/up_arrow.xpm      \
893         make-manuf              \
894         make-reg-dotc           \
895         make-reg-dotc.py        \
896         make-tapreg-dotc        \
897         manuf                   \
898         manuf.tmpl              \
899         mergecap.c              \
900         mobileipv4.xml          \
901         nasreq.xml              \
902         ncp2222.py              \
903         packet-ncp2222.inc      \
904         print.ps                \
905         process-x11-fields.pl   \
906         randpkt.c               \
907         rdps.c                  \
908         sunping.xml             \
909         text2pcap-scanner.l     \
910         text2pcap.c             \
911         text2pcap.h             \
912         wka.tmpl                \
913         x11-fields
914
915 if SETUID_INSTALL
916 install-exec-hook:
917         -chmod +s $(DESTDIR)$(bindir)/ethereal
918         -chmod +s $(DESTDIR)$(bindir)/tethereal
919 else
920 install-exec-hook:
921 endif
922
923 #
924 # Currently register.c can be included in the distribution because
925 # we always build all protocol dissectors. We used to have to check
926 # whether or not to build the snmp dissector. If we again need to
927 # variably build something, making register.c non-portable, uncomment
928 # the dist-hook line below.
929 #
930 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
931 # its contents depend on the configuration, and therefore we want it
932 # to be built when the first "make" is done; however, Automake insists
933 # on putting *all* source into the distribution.
934 #
935 # We work around this by having a "dist-hook" rule that deletes
936 # "register.c", so that "dist" won't pick it up.
937 #
938 #dist-hook:
939 #       @rm -f $(distdir)/register.c
940
941 DIST_SUBDIRS = tools wiretap doc epan plugins packaging gtk help
942
943 if HAVE_PLUGINS
944 SUBDIRS = tools wiretap doc epan plugins packaging help @ethereal_SUBDIRS@
945 else
946 SUBDIRS = tools wiretap doc epan packaging help @ethereal_SUBDIRS@
947 endif
948
949 ethereal.1: ethereal doc/ethereal.pod
950         (cd doc ; \
951         $(MAKE) ../ethereal.1 )
952
953 tethereal.1: tethereal doc/tethereal.pod
954         (cd doc ; \
955         $(MAKE) ../tethereal.1 )
956
957 ethereal-filter.4: tethereal doc/ethereal-filter.pod.template
958         (cd doc ; \
959         $(MAKE) ../ethereal-filter.4 )
960
961 editcap.1: doc/editcap.pod
962         (cd doc ; \
963         $(MAKE) ../editcap.1 )
964
965 idl2eth.1: doc/idl2eth.pod
966         (cd doc ; \
967         $(MAKE) ../idl2eth.1 )
968
969 mergecap.1: doc/mergecap.pod
970         (cd doc ; \
971         $(MAKE) ../mergecap.1 )
972
973 text2pcap.1: doc/text2pcap.pod
974         (cd doc ; \
975         $(MAKE) ../text2pcap.1 )
976
977 packet-ncp2222.c : ncp2222.py
978         $(PYTHON) $(srcdir)/ncp2222.py -o $@
979
980 libtool: $(LIBTOOL_DEPS)
981         $(SHELL) ./config.status --recheck
982
983 # We load top_stagedir with an explicit path so that libtool doesn't freak.
984 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
985 stagedir=$(top_stagedir)/$(PACKAGE).stage
986 host_cpu=@host_cpu@
987 host_os=@host_os@
988
989 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
990         @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
991                 rm -rf $(stagedir) ; \
992                 $(MAKE) DESTDIR=$(stagedir) install; \
993                 $(srcdir)/packaging/svr4/mkpkg \
994                         $(PACKAGE) \
995                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
996                         $(prefix) \
997                         $(top_stagedir) ; \
998         else \
999                 echo "Error: SVR4 packaging tools not found." ; \
1000                 echo "Package build abandoned." ; \
1001         fi
1002
1003 solaris-package: svr4-package
1004
1005 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
1006 rpm-package: dist
1007         if test x$(HAVE_RPM) = xyes ; then \
1008                 cd $(rpm_topdir) ; \
1009                 mkdir -p BUILD RPMS SOURCES ; \
1010                 cd SOURCES ; \
1011                 ln -s ../../../$(distdir).tar.gz ; \
1012                 cd .. ; \
1013                 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
1014                         echo "Package successfully built in `pwd`/RPMS." ; \
1015         else \
1016                 echo "Error: RPM executable and/or source directory not found." ; \
1017         fi
1018 srpm-package: dist
1019         if test x$(HAVE_RPM) = xyes ; then \
1020                 cd $(rpm_topdir) ; \
1021                 mkdir -p BUILD SRPMS SOURCES ; \
1022                 cd SOURCES ; \
1023                 ln -s ../../../$(distdir).tar.gz ; \
1024                 cd .. ; \
1025                 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
1026                         echo "Package successfully built in `pwd`/SRPMS." ; \
1027         else \
1028                 echo "Error: RPM executable and/or source directory not found." ; \
1029         fi
1030
1031 debian-package: debian/rules
1032         dpkg-buildpackage -rfakeroot -us -uc
1033
1034 clean-local:
1035         rm -rf $(top_stagedir)
1036
1037 test-splint: $(ethereal_SOURCES)
1038         splint \
1039                 -gnu-extensions -D_U_=""        \
1040                 -I. `glib-config --cflags` \
1041                 -I./epan \
1042                 -I./tools/lemon \
1043                 -I./wiretap     \
1044                 $(ethereal_SOURCES)