Run make-version.pl on every make (at least with gnu make)
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.707 2004/02/10 00:50:04 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 # Optional objects that I know how to build. These will be
221 # linked into the ethereal executable.
222 # They will also be linked into the tethereal executable; if this
223 # list ever grows to include something that can't be linked with
224 # tethereal, or if tethereal needs something that ethereal doesn't,
225 # we should probably split this into stuff needed both
226 # by ethereal and tethereal and stuff needed only by one or the
227 # other.
228 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
229         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@ @STRPTIME_O@
230
231 # Additional libs that I know how to build. These will be
232 # linked into the ethereal executable.
233 ethereal_additional_libs = \
234         wiretap/libwiretap.a    \
235         gtk/libui.a             \
236         epan/libethereal.a      \
237         epan/ftypes/libftypes.a \
238         epan/dfilter/libdfilter.a
239
240 # This is the automake dependency variable for the executable
241 ethereal_DEPENDENCIES = \
242         $(ethereal_optional_objects)    \
243         $(ethereal_additional_libs)     \
244         $(plugin_libs)
245
246 # This automake variable adds to the link-line for the executable.
247 #
248 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
249 # they are included in @GTK_LIBS@, and doesn't have to be linked with
250 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
251 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
252 # applications are X applications).
253
254 if ENABLE_STATIC
255 ethereal_LDFLAGS = -Wl,-static -all-static
256 else
257 ethereal_LDFLAGS = -export-dynamic
258 endif
259
260 ethereal_LDADD = \
261         $(ethereal_optional_objects)    \
262         $(ethereal_additional_libs)     \
263         @SNMP_LIBS@ @SSL_LIBS@          \
264         $(plugin_ldadd)                 \
265         @PCRE_LIBS@ \
266         @PCAP_LIBS@ @GTK_LIBS@ @ADNS_LIBS@
267
268 # Additional libs that I know how to build. These will be
269 # linked into the tethereal executable.
270 tethereal_additional_libs =             \
271         wiretap/libwiretap.a            \
272         epan/libethereal.a              \
273         epan/ftypes/libftypes.a         \
274         epan/dfilter/libdfilter.a
275
276 # This is the automake dependency variable for the executable
277 tethereal_DEPENDENCIES = \
278         $(ethereal_optional_objects)    \
279         $(tethereal_additional_libs)    \
280         $(plugin_libs)
281
282 # This automake variable adds to the link-line for the executable
283 tethereal_LDADD = \
284         $(ethereal_optional_objects)    \
285         $(tethereal_additional_libs)    \
286         @SNMP_LIBS@ @SSL_LIBS@          \
287         $(plugin_ldadd)                 \
288         @PCRE_LIBS@ \
289         @GLIB_LIBS@ -lm                 \
290         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
291
292 if ENABLE_STATIC
293 tethereal_LDFLAGS = -Wl,-static -all-static
294 else
295 tethereal_LDFLAGS = -export-dynamic
296 endif
297
298 # Optional objects that I know how to build, and that are needed by
299 # text2pcap.
300 text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
301
302 text2pcap_DEPENDENCIES = text2pcap.h
303
304 # This automake variable adds to the link-line for the executable
305 text2pcap_LDADD = $(text2pcap_optional_objects) \
306         @GLIB_LIBS@ -lm
307
308 mergecap_DEPENDENCIES = wiretap/libwiretap.a
309
310 # This is the automake dependency variable for the executable
311 editcap_DEPENDENCIES = wiretap/libwiretap.a
312
313 # This automake variable adds to the link-line for the executable
314 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
315 mergecap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
316
317 # Common headers
318 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap
319
320 #
321 # Build the version string
322 #
323 .PHONY: cvsversion.h
324
325 cvsversion.h:
326         $(PERL) $(srcdir)/make-version.pl
327
328 #
329 # Build various header files for the X11 dissector.
330 #
331 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
332         $(PERL) $(srcdir)/process-x11-fields.pl <$(srcdir)/x11-fields
333
334 #
335 # Build shell scripts by doing variable substitution.
336 # Taken from autoconf 2.13.
337 #
338 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
339
340 SUFFIXES = .sh
341 .sh:
342         rm -f $@ $@.tmp
343         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
344
345 #
346 # Build "register.c", which contains a function "register_all_protocols()"
347 # that calls the register routines for all protocols.
348 #
349 # We do this by grepping through sources.  If that turns out to be too slow,
350 # maybe we could just require every .o file to have an register routine
351 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
352 #
353 # Formatting conventions:  The name of the proto_register_* routines must
354 # start in column zero, or must be preceded only by "void " starting in
355 # column zero, and must not be inside #if.
356 #
357 # We assume that all dissector routines are in "packet-XXX.c" files.
358 #
359 # For some unknown reason, having a big "for" loop in the Makefile
360 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
361 # they seem to pass only the first few names in the list to the shell,
362 # for some reason.
363 #
364 # Therefore, we have a script to generate the "register.c" file.
365 #
366 # The first argument is the name of the file to write.
367 # The second argument is the directory in which the source files live.
368 # All subsequent arguments are the files to scan.
369 #
370 register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
371         @if test -n $(PYTHON); then \
372                 echo Making register.c with python ; \
373                 $(PYTHON) $(srcdir)/make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
374         else \
375                 echo Making register.c with shell script ; \
376                 $(srcdir)/make-reg-dotc register.c $(srcdir) \
377                         $(plugin_src) $(DISSECTOR_SRC) ; \
378         fi
379
380 #
381 # Build "tethereal-tap-register.c", which contains a function 
382 # "register_all_tap_listeners()"
383 # that calls the register routines for all tehtereal tap listeners.
384 #
385 # We do this by grepping through sources.
386 #
387 # Formatting conventions:  The name of the tap_listener_register_* 
388 # routines must start in column zero, or must be preceded only by 
389 # "void " starting in column zero, and must not be inside #if.
390 #
391 # The first argument is the directory in which the source files live.
392 # All subsequent arguments are the files to scan.
393 #
394 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) $(srcdir)/make-tapreg-dotc
395         @echo Making tethereal-tap-register.c
396         @$(srcdir)/make-tapreg-dotc tethereal-tap-register.c $(srcdir) $(TETHEREAL_TAP_SRC)
397
398 ps.c: print.ps rdps
399         ./rdps $(srcdir)/print.ps ps.c
400
401 rdps: rdps.c
402         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
403
404 randpkt.o: randpkt.c
405         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
406
407 randpkt: randpkt.o wiretap/libwiretap.a
408         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
409
410
411 dftest_additional_libs =                \
412         wiretap/libwiretap.a            \
413         epan/libethereal.a              \
414         epan/ftypes/libftypes.a         \
415         epan/dfilter/libdfilter.a
416
417 dftest_DEPENDENCIES = \
418         $(ethereal_optional_objects)    \
419         $(dftest_additional_libs)       \
420         $(plugin_libs)
421
422 # This automake variable adds to the link-line for the executable
423 dftest_LDADD = \
424         $(ethereal_optional_objects)    \
425         $(dftest_additional_libs)       \
426         @SNMP_LIBS@ @SSL_LIBS@          \
427         $(plugin_ldadd)                 \
428         @PCRE_LIBS@ \
429         @GLIB_LIBS@ -lm \
430         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@
431
432 dftest_LDFLAGS = -export-dynamic
433
434 CLEANFILES =    \
435         @rdps_bin@ \
436         idl2eth
437
438 DISTCLEANFILES = \
439         aclocal-missing/*.m4 \
440         ps.c \
441         *~
442
443 MAINTAINERCLEANFILES =          \
444         register.c              \
445         ps.c
446
447 EXTRA_DIST = \
448         Ethereal.desktop        \
449         FAQ                     \
450         INSTALL.configure       \
451         Makefile.common         \
452         Makefile.nmake          \
453         README.aix              \
454         README.bsd              \
455         README.hpux             \
456         README.irix             \
457         README.linux            \
458         README.tru64            \
459         README.vmware           \
460         README.win32            \
461         TODO                    \
462         aclocal-fallback/glib-2.0.m4 \
463         aclocal-fallback/glib.m4 \
464         aclocal-fallback/gtk-2.0.m4 \
465         aclocal-fallback/gtk.m4 \
466         aclocal-flags           \
467         aclocal-missing/dummy   \
468         autogen.sh              \
469         capture-wpcap.c         \
470         capture-wpcap.h         \
471         cleanbld.bat            \
472         config.h.win32          \
473         config.nmake            \
474         debian/README.debian    \
475         debian/changelog        \
476         debian/control          \
477         debian/copyright        \
478         debian/dirs             \
479         debian/docs             \
480         debian/menu             \
481         debian/postinst         \
482         debian/prerm            \
483         debian/rules            \
484         dictionary.dtd          \
485         dictionary.xml          \
486         doc/Makefile.am         \
487         doc/Makefile.nmake      \
488         doc/README.capture      \
489         doc/README.design       \
490         doc/README.developer    \
491         doc/README.idl2eth      \
492         doc/README.plugins      \
493         doc/README.regression   \
494         doc/README.tapping      \
495         doc/README.tvbuff       \
496         doc/README.xml-output   \
497         doc/dfilter2pod.pl      \
498         doc/editcap.pod         \
499         doc/ethereal-filter.pod.template \
500         doc/ethereal.pod        \
501         doc/idl2eth.pod         \
502         doc/mergecap.pod        \
503         doc/randpkt.txt         \
504         doc/tethereal.pod       \
505         doc/text2pcap.pod       \
506         editcap.c               \
507         ethereal_be.py          \
508         ethereal_gen.py         \
509         getopt.c                \
510         getopt.h                \
511         idl2eth.sh              \
512         image/Ethereal.icns     \
513         image/Makefile.nmake    \
514         image/README.image      \
515         image/clist_ascend.xpm  \
516         image/clist_descend.xpm \
517         image/dn_arrow.xpm      \
518         image/editcap.rc.in     \
519         image/eexcl3d64.xpm     \
520         image/eicon3d16.xpm     \
521         image/eicon3d32.xpm     \
522         image/eicon3d48.xpm     \
523         image/eicon3d64.xpm     \
524         image/elogo3d48x48.png  \
525         image/ethereal.ico      \
526         image/ethereal.rc.in    \
527         image/ethereal48x48-trans.png  \
528         image/ethereal48x48.png \
529         image/hi16-app-ethereal.png     \
530         image/hi32-app-ethereal.png     \
531         image/hi48-app-ethereal.png     \
532         image/icon-ethereal.xpm \
533         image/icon-excl.xpm     \
534         image/lo16-app-ethereal.png     \
535         image/lo32-app-ethereal.png     \
536         image/lo48-app-ethereal.png     \
537         image/mergecap.rc.in    \
538         image/nsis-checked.bmp  \
539         image/nsis-unchecked.bmp        \
540         image/stock_dialog_error_48.xpm \
541         image/stock_dialog_warning_48.xpm       \
542         image/stock_dialog_question_48.xpm      \
543         image/stock_dialog_info_48.xpm  \
544         image/tethereal.rc.in   \
545         image/text2pcap.rc.in   \
546         image/toolbar/capture_24.xpm    \
547         image/toolbar/cfilter_24.xpm    \
548         image/toolbar/dfilter_24.xpm    \
549         image/toolbar/stock_close_24.xpm        \
550         image/toolbar/stock_colorselector_24.xpm        \
551         image/toolbar/stock_help_24.xpm \
552         image/toolbar/stock_jump_to_24.xpm      \
553         image/toolbar/stock_open_24.xpm \
554         image/toolbar/stock_preferences_24.xpm  \
555         image/toolbar/stock_print_24.xpm        \
556         image/toolbar/stock_refresh_24.xpm      \
557         image/toolbar/stock_right_arrow_24.xpm  \
558         image/toolbar/stock_save_24.xpm \
559         image/toolbar/stock_search_24.xpm       \
560         image/toolbar/stock_stop_24.xpm \
561         image/up_arrow.xpm      \
562         make-manuf              \
563         make-reg-dotc           \
564         make-reg-dotc.py        \
565         make-tapreg-dotc        \
566         manuf                   \
567         manuf.tmpl              \
568         mergecap.c              \
569         mobileipv4.xml          \
570         nasreq.xml              \
571         ncp2222.py              \
572         packet-ncp2222.inc      \
573         print.ps                \
574         process-x11-fields.pl   \
575         randpkt.c               \
576         rdps.c                  \
577         sunping.xml             \
578         text2pcap-scanner.l     \
579         text2pcap.c             \
580         text2pcap.h             \
581         wka.tmpl                \
582         x11-fields
583
584 if SETUID_INSTALL
585 install-exec-hook:
586         -chmod +s $(DESTDIR)$(bindir)/ethereal
587         -chmod +s $(DESTDIR)$(bindir)/tethereal
588 else
589 install-exec-hook:
590 endif
591
592 #
593 # Currently register.c can be included in the distribution because
594 # we always build all protocol dissectors. We used to have to check
595 # whether or not to build the snmp dissector. If we again need to
596 # variably build something, making register.c non-portable, uncomment
597 # the dist-hook line below.
598 #
599 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
600 # its contents depend on the configuration, and therefore we want it
601 # to be built when the first "make" is done; however, Automake insists
602 # on putting *all* source into the distribution.
603 #
604 # We work around this by having a "dist-hook" rule that deletes
605 # "register.c", so that "dist" won't pick it up.
606 #
607 #dist-hook:
608 #       @rm -f $(distdir)/register.c
609
610 DIST_SUBDIRS = tools wiretap doc epan plugins packaging gtk help
611
612 if HAVE_PLUGINS
613 SUBDIRS = tools wiretap doc epan plugins packaging help @ethereal_SUBDIRS@
614 else
615 SUBDIRS = tools wiretap doc epan packaging help @ethereal_SUBDIRS@
616 endif
617
618 ethereal.1: ethereal doc/ethereal.pod
619         (cd doc ; \
620         $(MAKE) ../ethereal.1 )
621
622 tethereal.1: tethereal doc/tethereal.pod
623         (cd doc ; \
624         $(MAKE) ../tethereal.1 )
625
626 ethereal-filter.4: tethereal doc/ethereal-filter.pod.template
627         (cd doc ; \
628         $(MAKE) ../ethereal-filter.4 )
629
630 editcap.1: doc/editcap.pod
631         (cd doc ; \
632         $(MAKE) ../editcap.1 )
633
634 idl2eth.1: doc/idl2eth.pod
635         (cd doc ; \
636         $(MAKE) ../idl2eth.1 )
637
638 mergecap.1: doc/mergecap.pod
639         (cd doc ; \
640         $(MAKE) ../mergecap.1 )
641
642 text2pcap.1: doc/text2pcap.pod
643         (cd doc ; \
644         $(MAKE) ../text2pcap.1 )
645
646 packet-ncp2222.c : ncp2222.py
647         $(PYTHON) $(srcdir)/ncp2222.py -o $@
648
649 libtool: $(LIBTOOL_DEPS)
650         $(SHELL) ./config.status --recheck
651
652 # We load top_stagedir with an explicit path so that libtool doesn't freak.
653 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
654 stagedir=$(top_stagedir)/$(PACKAGE).stage
655 host_cpu=@host_cpu@
656 host_os=@host_os@
657
658 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
659         @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
660                 rm -rf $(stagedir) ; \
661                 $(MAKE) DESTDIR=$(stagedir) install; \
662                 $(srcdir)/packaging/svr4/mkpkg \
663                         $(PACKAGE) \
664                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
665                         $(prefix) \
666                         $(top_stagedir) ; \
667         else \
668                 echo "Error: SVR4 packaging tools not found." ; \
669                 echo "Package build abandoned." ; \
670         fi
671
672 solaris-package: svr4-package
673
674 rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
675 rpm-package: dist
676         if test x$(HAVE_RPM) = xyes ; then \
677                 cd $(rpm_topdir) ; \
678                 mkdir -p BUILD RPMS SOURCES ; \
679                 cd SOURCES ; \
680                 ln -s ../../../$(distdir).tar.gz ; \
681                 cd .. ; \
682                 rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
683                         echo "Package successfully built in `pwd`/RPMS." ; \
684         else \
685                 echo "Error: RPM executable and/or source directory not found." ; \
686         fi
687 srpm-package: dist
688         if test x$(HAVE_RPM) = xyes ; then \
689                 cd $(rpm_topdir) ; \
690                 mkdir -p BUILD SRPMS SOURCES ; \
691                 cd SOURCES ; \
692                 ln -s ../../../$(distdir).tar.gz ; \
693                 cd .. ; \
694                 rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
695                         echo "Package successfully built in `pwd`/SRPMS." ; \
696         else \
697                 echo "Error: RPM executable and/or source directory not found." ; \
698         fi
699
700 debian-package: debian/rules
701         dpkg-buildpackage -rfakeroot -us -uc
702
703 clean-local:
704         rm -rf $(top_stagedir)
705
706 test-splint: $(ethereal_SOURCES)
707         splint \
708                 -gnu-extensions -D_U_=""        \
709                 -I. `glib-config --cflags` \
710                 -I./epan \
711                 -I./tools/lemon \
712                 -I./wiretap     \
713                 $(ethereal_SOURCES)