8c670d290a9b234f0f7cb89afc4fb20be6f0e10d
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.201 2000/05/28 22:59:16 guy Exp $
5 #
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@zing.org>
8 # Copyright 1998 Gerald Combs
9 #
10
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24
25 EXTRA_PROGRAMS = ethereal_static
26 bin_PROGRAMS = ethereal editcap tethereal
27
28 man_MANS = ethereal.1 editcap.1 tethereal.1
29
30 sysconf_DATA = manuf
31
32 # Any POSIX-compatible YACC should honor the -p flag
33 YFLAGS=-d -p dfilter_
34
35 DISSECTOR_SOURCES = \
36         packet-aarp.c  \
37         packet-afs.c   \
38         packet-arp.c   \
39         packet-ascend.c\
40         packet-atalk.c \
41         packet-atm.c   \
42         packet-auto_rp.c   \
43         packet-bgp.c   \
44         packet-bootp.c \
45         packet-bootparams.c \
46         packet-bpdu.c  \
47         packet-cdp.c   \
48         packet-cgmp.c  \
49         packet-clip.c  \
50         packet-clnp.c  \
51         packet-data.c  \
52         packet-ddtp.c  \
53         packet-dns.c   \
54         packet-eigrp.c \
55         packet-esis.c  \
56         packet-eth.c   \
57         packet-ethertype.c   \
58         packet-fddi.c  \
59         packet-ftp.c   \
60         packet-giop.c  \
61         packet-gre.c   \
62         packet-h1.c    \
63         packet-hsrp.c  \
64         packet-http.c  \
65         packet-icmpv6.c\
66         packet-icp.c   \
67         packet-icq.c   \
68         packet-imap.c   \
69         packet-ip.c    \
70         packet-ipp.c   \
71         packet-ipsec.c \
72         packet-ipv6.c  \
73         packet-ipx.c   \
74         packet-irc.c   \
75         packet-isakmp.c\
76         packet-isis.c  \
77         packet-isis-clv.c \
78         packet-isis-hello.c \
79         packet-isis-lsp.c \
80         packet-isis-snp.c \
81         packet-isl.c   \
82         packet-l2tp.c  \
83         packet-lapb.c  \
84         packet-lapd.c  \
85         packet-ldap.c  \
86         packet-llc.c   \
87         packet-lpd.c   \
88         packet-mapi.c  \
89         packet-mip.c  \
90         packet-mount.c \
91         packet-mpls.c \
92         packet-msproxy.c \
93         packet-nbipx.c \
94         packet-nbns.c  \
95         packet-ncp.c   \
96         packet-netbios.c \
97         packet-nfs.c   \
98         packet-nlm.c   \
99         packet-nntp.c  \
100         packet-ntp.c  \
101         packet-null.c  \
102         packet-osi.c   \
103         packet-osi-options.c \
104         packet-ospf.c  \
105         packet-pim.c   \
106         packet-pop.c   \
107         packet-portmap.c   \
108         packet-ppp.c   \
109         packet-pppoe.c \
110         packet-pptp.c  \
111         packet-q2931.c \
112         packet-q931.c  \
113         packet-radius.c\
114         packet-raw.c   \
115         packet-rip.c   \
116         packet-ripng.c \
117         packet-rlogin.c \
118         packet-rpc.c   \
119         packet-rsvp.c  \
120         packet-rtcp.c  \
121         packet-rtp.c   \
122         packet-rtsp.c  \
123         packet-rx.c  \
124         packet-sap.c   \
125         packet-sdp.c   \
126         packet-smb.c   \
127         packet-smb-browse.c \
128         packet-smb-common.c \
129         packet-smb-logon.c \
130         packet-smb-mailslot.c \
131         packet-smb-pipe.c \
132         packet-sna.c   \
133         packet-snmp.c   \
134         packet-socks.c \
135         packet-srvloc.c \
136         packet-sscop.c \
137         packet-stat.c   \
138         packet-tacacs.c \
139         packet-tcp.c   \
140         packet-telnet.c\
141         packet-tftp.c  \
142         packet-time.c  \
143         packet-tns.c \
144         packet-tr.c    \
145         packet-trmac.c \
146         packet-udp.c   \
147         packet-v120.c \
148         packet-vines.c \
149         packet-vlan.c \
150         packet-vrrp.c \
151         packet-vtp.c  \
152         packet-wccp.c \
153         packet-who.c  \
154         packet-x25.c   \
155         packet-yhoo.c  \
156         packet-ypbind.c \
157         packet-ypserv.c \
158         packet-ypxfr.c
159
160 noinst_HEADERS = \
161         packet-afs.h   \
162         packet-arp.h   \
163         packet-ascend.h\
164         packet-atalk.h \
165         packet-atm.h   \
166         packet-bgp.h   \
167         packet-bootparams.h \
168         packet-bpdu.h  \
169         packet-cdp.h   \
170         packet-cgmp.h  \
171         packet-clip.h  \
172         packet-clnp.h  \
173         packet-ddtp.h  \
174         packet-dns.h   \
175         packet-eigrp.h \
176         packet-esis.h  \
177         packet-eth.h   \
178         packet-fddi.h  \
179         packet-http.h  \
180         packet-ip.h    \
181         packet-ipp.h   \
182         packet-ipsec.h \
183         packet-ipv6.h  \
184         packet-ipx.h   \
185         packet-isis.h  \
186         packet-isis-clv.h \
187         packet-isis-hello.h \
188         packet-isis-lsp.h \
189         packet-isis-snp.h \
190         packet-isl.h   \
191         packet-lapb.h  \
192         packet-lapd.h  \
193         packet-ldap.h  \
194         packet-llc.h   \
195         packet-mount.h \
196         packet-nbipx.h \
197         packet-ncp.h   \
198         packet-netbios.h \
199         packet-nfs.h   \
200         packet-nlm.h   \
201         packet-ntp.h  \
202         packet-null.h  \
203         packet-osi.h   \
204         packet-osi-options.h \
205         packet-ospf.h  \
206         packet-portmap.h   \
207         packet-ppp.h   \
208         packet-q2931.h \
209         packet-q931.h  \
210         packet-raw.h   \
211         packet-rip.h   \
212         packet-ripng.h \
213         packet-rpc.h   \
214         packet-rtcp.h  \
215         packet-rtp.h   \
216         packet-rx.h  \
217         packet-sdp.h   \
218         packet-smb.h   \
219         packet-smb-common.h \
220         packet-sna.h   \
221         packet-snmp.h   \
222         packet-sscop.h \
223         packet-stat.h   \
224         packet-tcp.h   \
225         packet-tftp.h  \
226         packet-tns.h \
227         packet-tr.h    \
228         packet-trmac.h \
229         packet-udp.h   \
230         packet-v120.h \
231         packet-vines.h \
232         packet-vlan.h \
233         packet-vtp.h  \
234         packet-x25.h   \
235         packet-yhoo.h  \
236         packet-ypbind.h \
237         packet-ypserv.h \
238         packet-ypxfr.h 
239
240 ETHEREAL_COMMON_SOURCES = \
241         alignment.h    \
242         asn1.c         \
243         asn1.h         \
244         column.c       \
245         column.h       \
246         conversation.c \
247         conversation.h \
248         dfilter-int.h  \
249         dfilter-grammar.y \
250         dfilter-scanner.l \
251         dfilter.c      \
252         dfilter.h      \
253         etypes.h       \
254         except.c        \
255         except.h        \
256         exceptions.h    \
257         follow.c       \
258         follow.h       \
259         inet_v6defs.h  \
260         ipproto.c      \
261         ipv4.c         \
262         ipv4.h         \
263         llcsaps.h      \
264         nlpid.h        \
265         oui.h          \
266         packet.c       \
267         packet.h       \
268         plugins.c      \
269         plugins.h      \
270         ppptypes.h     \
271         prefs.c        \
272         prefs.h        \
273         print.c        \
274         print.h        \
275         proto.c        \
276         proto.h        \
277         ps.c           \
278         ps.h           \
279         register.c     \
280         register.h     \
281         resolv.c       \
282         resolv.h       \
283         smb.h          \
284         timestamp.h    \
285         tvbuff.c        \
286         tvbuff.h        \
287         util.c         \
288         util.h         \
289         xdlc.c         \
290         xdlc.h
291
292 ethereal_SOURCES = \
293         $(DISSECTOR_SOURCES) \
294         $(ETHEREAL_COMMON_SOURCES) \
295         capture.c      \
296         capture.h      \
297         file.c         \
298         file.h         \
299         globals.h      \
300         menu.h         \
301         simple_dialog.h \
302         summary.c      \
303         summary.h      \
304         ui_util.h
305
306 ethereal_static_SOURCES = \
307         $(ethereal_SOURCES)
308
309 EXTRA_ethereal_SOURCES = \
310         dfilter-grammar.c \
311         dfilter-grammar.h \
312         dfilter-scanner.c \
313         snprintf.c      \
314         snprintf.h      \
315         snprintf-imp.h  \
316         strerror.c      \
317         strerror.h      \
318         strncasecmp.c   \
319         mkstemp.c       \
320         mkstemp.h       \
321         inet_aton.c     \
322         inet_pton.c     \
323         inet_ntop.c
324
325 # Optional objects that I know how to build. These will be
326 # linked into the ethereal executable.
327 # They will also be linked into the tethereal executable; if this
328 # list ever grows to include something that can't be linked with
329 # tethereal, or if tethereal needs something that ethereal doesn't,
330 # we should probably split this into stuff needed both
331 # by ethereal and tethereal and stuff needed only by one or the
332 # other.
333 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
334         @STRNCASECMP_O@ @MKSTEMP_O@ \
335         @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ 
336
337 # Additional libs that I know how to build. These will be
338 # linked into the ethereal executable.
339 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a
340
341 # This is the automake dependency variable for the executable
342 ethereal_DEPENDENCIES = \
343         $(ethereal_optional_objects)    \
344         $(ethereal_additional_libs)     \
345         plugins/gryphon/gryphon.la
346
347 ethereal_static_DEPENDENCIES = \
348         $(ethereal_optional_objects)    \
349         $(ethereal_additional_libs)
350
351 # This automake variable adds to the link-line for the executable.
352 #
353 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
354 # they are included in @GTK_LIBS@, and doesn't have to be linked with
355 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
356 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
357 # applications are X applications).
358 ethereal_LDADD = \
359         $(ethereal_optional_objects)    \
360         $(ethereal_additional_libs)     \
361         @SNMP_LIBS@                     \
362         "-dlopen" self  \
363         "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@
364
365 ethereal_static_LDADD = \
366         $(ethereal_optional_objects)    \
367         $(ethereal_additional_libs) \
368         @SNMP_LIBS@                     \
369         @PCAP_LIBS@ @GTK_LIBS@
370
371 ethereal_LDFLAGS = -export-dynamic
372 ethereal_static_LDFLAGS = -Wl,-static
373
374 tethereal_SOURCES = \
375         $(DISSECTOR_SOURCES) \
376         $(ETHEREAL_COMMON_SOURCES) \
377         tethereal.c
378
379 # Additional libs that I know how to build. These will be
380 # linked into the tethereal executable.
381 tethereal_additional_libs = wiretap/libwiretap.a
382
383 # This is the automake dependency variable for the executable
384 tethereal_DEPENDENCIES = \
385         $(ethereal_optional_objects)    \
386         $(tethereal_additional_libs)    \
387         plugins/gryphon/gryphon.la
388
389 # This automake variable adds to the link-line for the executable
390 tethereal_LDADD = wiretap/libwiretap.a  \
391         $(ethereal_optional_objects)    \
392         $(tethereal_additional_libs)    \
393         @SNMP_LIBS@                     \
394         "-dlopen" self  \
395         "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
396         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
397
398 tethereal_LDFLAGS = -export-dynamic
399
400 editcap_SOURCES = editcap.c
401
402 # This is the automake dependency variable for the executable
403 editcap_DEPENDENCIES = wiretap/libwiretap.a
404
405 # This automake variable adds to the link-line for the executable
406 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
407
408 #
409 # Build "register.c", which contains a function "register_all_protocols()"
410 # that calls the register routines for all protocols.
411 #
412 # We do this by grepping through sources.  If that turns out to be too slow,
413 # maybe we could just require every .o file to have an register routine
414 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
415 #
416 # Formatting conventions:  The name of the proto_register_* routines must
417 # start in column zero, or must be preceded only by "void " starting in
418 # column zero, and must not be inside #if.
419 #
420 # We assume that all dissector routines are in "packet-XXX.c" files,
421 # or in "packet.c".
422 #
423 # For some unknown reason, having a big "for" loop in the Makefile
424 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
425 # they seem to pass only the first few names in the list to the shell,
426 # for some reason.
427 #
428 # Therefore, we have a script to generate the "register.c" file.
429 #
430 # The first argument is the directory in which the source files live.
431 # All subsequent arguments are the files to scan.
432 #
433 register.c: packet.c $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
434         @echo Making register.c
435         @$(srcdir)/make-reg-dotc $(srcdir) packet.c $(DISSECTOR_SOURCES)
436
437 ps.c: print.ps rdps
438         ./rdps $(srcdir)/print.ps ps.c
439
440 rdps: rdps.c
441         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
442
443 randpkt.o: randpkt.c
444         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
445
446 randpkt: randpkt.o wiretap/libwiretap.a
447         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
448
449 tvbtest: tvbtest.o tvbuff.o except.o
450
451 DISTCLEANFILES =        \
452         register.c      \
453         rdps            \
454         ps.c            \
455         *~
456
457 EXTRA_DIST = \
458         config.h.win32          \
459         config.nmake            \
460         debian/README.debian    \
461         debian/changelog        \
462         debian/control          \
463         debian/copyright        \
464         debian/dirs             \
465         debian/docs             \
466         debian/menu             \
467         debian/postinst         \
468         debian/prerm            \
469         debian/rules            \
470         doc/README.developer    \
471         doc/Makefile.in         \
472         doc/Makefile.am         \
473         doc/README.regression   \
474         doc/README.tvbuff       \
475         doc/dfilter2pod.in      \
476         doc/editcap.pod         \
477         doc/ethereal.pod.template \
478         doc/randpkt.txt         \
479         doc/tethereal.pod.template \
480         editcap.c               \
481         ethereal.spec.in         \
482         getopt.c                \
483         getopt.h                \
484         ieee-float.h            \
485         image/editcap.rc        \
486         image/ethereal48x48-trans.png  \
487         image/ethereal48x48.png \
488         image/ethereal.ico      \
489         image/ethereal.rc       \
490         image/icon-excl.xpm     \
491         image/icon-ethereal.xpm \
492         image/tethereal.rc      \
493         INSTALL.configure       \
494         Makefile.nmake          \
495         make-reg-dotc           \
496         manuf                   \
497         print.ps                \
498         README.aix              \
499         README.bsd              \
500         README.hpux             \
501         README.irix             \
502         README.linux            \
503         README.tru64            \
504         README.vmware           \
505         README.win32            \
506         randpkt.c               \
507         rdps.c                  \
508         tvbtest.c               \
509         TODO
510
511 if SETUID_INSTALL
512 install-exec-hook:
513         -chmod +s $(DESTDIR)$(bindir)/ethereal
514         -chmod +s $(DESTDIR)$(bindir)/tethereal
515         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
516 else
517 install-exec-hook:
518 endif
519
520 #
521 # Currently register.c can be included in the distribution because
522 # we always build all protocol dissectors. We used to have to check
523 # whether or not to build the snmp dissector. If we again need to
524 # variably build something, making register.c non-portable, uncomment
525 # the dist-hook line below.
526 #
527 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
528 # its contents depend on the configuration, and therefore we want it
529 # to be built when the first "make" is done; however, Automake insists
530 # on putting *all* source into the distribution.
531 #
532 # We work around this by having a "dist-hook" rule that deletes
533 # "register.c", so that "dist" won't pick it up.
534 #
535 #dist-hook:
536 #       @rm -f $(distdir)/register.c
537
538 SUBDIRS = wiretap gtk plugins @ethereal_SUBDIRS@
539
540 ethereal.1: ethereal doc/ethereal.pod.template
541         (cd doc ; \
542         $(MAKE) ../ethereal.1 )
543
544 tethereal.1: tethereal doc/tethereal.pod.template
545         (cd doc ; \
546         $(MAKE) ../tethereal.1 )
547
548 editcap.1: doc/editcap.pod
549         (cd doc ; \
550         $(MAKE) ../editcap.1 )
551
552 dfilter-scanner.c : dfilter-scanner.l
553         $(LEX) -Pdfilter_ -odfilter-scanner.c $(srcdir)/dfilter-scanner.l
554
555 libtool: $(LIBTOOL_DEPS)
556         $(SHELL) ./config.status --recheck