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