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