autotools: propagate git version info to distribution tarball
[metze/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Wireshark
3 #
4 # Wireshark - Network traffic analyzer
5 # By Gerald Combs <gerald@wireshark.org>
6 # Copyright 1998 Gerald Combs
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22 include ./Makefile.am.inc
23
24 AM_DISTCHECK_CONFIGURE_FLAGS=@GUI_CONFIGURE_FLAGS@
25 # Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
26 # in configure.ac in sync, otherwise there will be an error running autogen.sh.
27 ACLOCAL_AMFLAGS = -I m4
28
29 # Common headers
30 COMMONCPPFLAGS =
31
32 AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) $(COMMONCPPFLAGS)
33
34 bin_PROGRAMS = \
35         @wireshark_bin@         \
36         @tshark_bin@            \
37         @tfshark_bin@           \
38         @text2pcap_bin@         \
39         @mergecap_bin@          \
40         @capinfos_bin@          \
41         @captype_bin@           \
42         @editcap_bin@           \
43         @randpkt_bin@           \
44         @dftest_bin@            \
45         @dumpcap_bin@           \
46         @reordercap_bin@        \
47         @rawshark_bin@          \
48         @echld_test_bin@
49
50 EXTRA_PROGRAMS = wireshark-gtk wireshark tshark tfshark capinfos captype \
51         editcap mergecap dftest randpkt text2pcap dumpcap reordercap \
52         rawshark echld_test
53
54 #
55 # Wireshark configuration files are put in $(pkgdatadir).
56 #
57 dist_pkgdata_DATA = COPYING manuf services cfilters colorfilters dfilters \
58         smi_modules ipmap.html pdml2html.xsl
59
60 pkgconfigdir = $(libdir)/pkgconfig
61 pkgconfig_DATA = wireshark.pc
62
63 #
64 # Install global profiles in the "profiles" subdirectory
65 #
66 profilesdir = $(pkgdatadir)
67 nobase_dist_profiles_DATA = \
68         profiles/Bluetooth/colorfilters \
69         profiles/Classic/colorfilters
70
71 #
72 # Install the Diameter DTD and XML files in the "diameter" subdirectory
73 # of that directory.
74 #
75 diameterdir = $(pkgdatadir)/diameter
76 include diameter/Custom.make
77 dist_diameter_DATA = $(_CUSTOM_diameter_xml_files_) \
78         diameter/chargecontrol.xml \
79         diameter/Cisco.xml \
80         diameter/CiscoSystems.xml \
81         diameter/Custom.xml \
82         diameter/dictionary.dtd \
83         diameter/dictionary.xml \
84         diameter/eap.xml \
85         diameter/Ericsson.xml \
86         diameter/etsie2e4.xml \
87         diameter/mobileipv4.xml \
88         diameter/mobileipv6.xml \
89         diameter/nasreq.xml \
90         diameter/sip.xml \
91         diameter/Starent.xml \
92         diameter/sunping.xml \
93         diameter/TGPP.xml \
94         diameter/TGPP2.xml \
95         diameter/Vodafone.xml \
96         diameter/AlcatelLucent.xml \
97         diameter/Nokia.xml \
98         diameter/NokiaSolutionsAndNetworks.xml \
99         diameter/HP.xml \
100         diameter/Oracle.xml
101
102 #
103 # Install the DTDs directory files in the "dtds" subdirectory
104 # of that directory
105 #
106 dtdsdir = $(pkgdatadir)/dtds
107 dist_dtds_DATA = \
108         dtds/dc.dtd \
109         dtds/itunes.dtd \
110         dtds/mscml.dtd \
111         dtds/pocsettings.dtd \
112         dtds/presence.dtd \
113         dtds/reginfo.dtd \
114         dtds/rlmi.dtd \
115         dtds/rss.dtd \
116         dtds/smil.dtd \
117         dtds/xcap-caps.dtd \
118         dtds/xcap-error.dtd \
119         dtds/watcherinfo.dtd
120
121 #
122 # Install the RADIUS directory files in the "radius" subdirectory
123 # of that directory.
124 #
125 radiusdir = $(pkgdatadir)/radius
126 include radius/Custom.make
127 dist_radius_DATA = $(_CUSTOM_radius_dict_) \
128         radius/README.radius_dictionary \
129         radius/custom.includes \
130         radius/dictionary \
131         radius/dictionary.3com \
132         radius/dictionary.3gpp \
133         radius/dictionary.3gpp2 \
134         radius/dictionary.acc \
135         radius/dictionary.acme \
136         radius/dictionary.airespace \
137         radius/dictionary.actelis \
138         radius/dictionary.aerohive \
139         radius/dictionary.alcatel \
140         radius/dictionary.alcatel.esam \
141         radius/dictionary.alcatel.sr \
142         radius/dictionary.alcatel-lucent.aaa \
143         radius/dictionary.alteon \
144         radius/dictionary.altiga \
145         radius/dictionary.alvarion \
146         radius/dictionary.alvarion.wimax.v2_2 \
147         radius/dictionary.apc \
148         radius/dictionary.aptis \
149         radius/dictionary.arbor \
150         radius/dictionary.aruba \
151         radius/dictionary.ascend \
152         radius/dictionary.asn \
153         radius/dictionary.audiocodes \
154         radius/dictionary.avaya \
155         radius/dictionary.azaire \
156         radius/dictionary.bay \
157         radius/dictionary.bluecoat \
158         radius/dictionary.bintec \
159         radius/dictionary.broadsoft \
160         radius/dictionary.brocade \
161         radius/dictionary.bskyb \
162         radius/dictionary.bristol \
163         radius/dictionary.bt \
164         radius/dictionary.camiant \
165         radius/dictionary.cablelabs \
166         radius/dictionary.cabletron \
167         radius/dictionary.chillispot \
168         radius/dictionary.cisco \
169         radius/dictionary.cisco.asa \
170         radius/dictionary.cisco.bbsm \
171         radius/dictionary.cisco.vpn3000 \
172         radius/dictionary.cisco.vpn5000 \
173         radius/dictionary.citrix \
174         radius/dictionary.clavister \
175         radius/dictionary.colubris \
176         radius/dictionary.columbia_university \
177         radius/dictionary.compatible \
178         radius/dictionary.compat \
179         radius/dictionary.cosine \
180         radius/dictionary.dante \
181         radius/dictionary.dhcp \
182         radius/dictionary.dlink \
183         radius/dictionary.digium \
184         radius/dictionary.dragonwave \
185         radius/dictionary.efficientip \
186         radius/dictionary.eltex \
187         radius/dictionary.epygi \
188         radius/dictionary.equallogic \
189         radius/dictionary.ericsson \
190         radius/dictionary.ericsson.ab \
191         radius/dictionary.ericsson.packet.core.networks \
192         radius/dictionary.erx \
193         radius/dictionary.extreme \
194         radius/dictionary.f5 \
195         radius/dictionary.fdxtended \
196         radius/dictionary.fortinet \
197         radius/dictionary.foundry \
198         radius/dictionary.freedhcp \
199         radius/dictionary.freeradius \
200         radius/dictionary.freeradius.internal \
201         radius/dictionary.freeswitch \
202         radius/dictionary.gandalf \
203         radius/dictionary.garderos \
204         radius/dictionary.gemtek \
205         radius/dictionary.h3c \
206         radius/dictionary.hp \
207         radius/dictionary.huawei \
208         radius/dictionary.iana \
209         radius/dictionary.iea \
210         radius/dictionary.infoblox \
211         radius/dictionary.infonet \
212         radius/dictionary.ipunplugged \
213         radius/dictionary.issanni \
214         radius/dictionary.itk \
215         radius/dictionary.jradius \
216         radius/dictionary.juniper \
217         radius/dictionary.kineto \
218         radius/dictionary.karlnet \
219         radius/dictionary.lancom \
220         radius/dictionary.livingston \
221         radius/dictionary.localweb \
222         radius/dictionary.lucent \
223         radius/dictionary.manzara \
224         radius/dictionary.meinberg \
225         radius/dictionary.merit \
226         radius/dictionary.meru \
227         radius/dictionary.microsoft \
228         radius/dictionary.mikrotik \
229         radius/dictionary.motorola \
230         radius/dictionary.motorola.wimax \
231         radius/dictionary.navini \
232         radius/dictionary.netscreen \
233         radius/dictionary.networkphysics \
234         radius/dictionary.nexans \
235         radius/dictionary.nokia \
236         radius/dictionary.nokia.conflict \
237         radius/dictionary.nomadix \
238         radius/dictionary.nortel \
239         radius/dictionary.ntua \
240         radius/dictionary.openser \
241         radius/dictionary.packeteer \
242         radius/dictionary.paloalto \
243         radius/dictionary.patton \
244         radius/dictionary.perle \
245         radius/dictionary.propel \
246         radius/dictionary.prosoft \
247         radius/dictionary.proxim \
248         radius/dictionary.purewave \
249         radius/dictionary.quiconnect \
250         radius/dictionary.quintum \
251         radius/dictionary.redcreek \
252         radius/dictionary.rfc2865 \
253         radius/dictionary.rfc2866 \
254         radius/dictionary.rfc2867 \
255         radius/dictionary.rfc2868 \
256         radius/dictionary.rfc2869 \
257         radius/dictionary.rfc3162 \
258         radius/dictionary.rfc3576 \
259         radius/dictionary.rfc3580 \
260         radius/dictionary.rfc4072 \
261         radius/dictionary.rfc4372 \
262         radius/dictionary.rfc4603 \
263         radius/dictionary.rfc4675 \
264         radius/dictionary.rfc4679 \
265         radius/dictionary.rfc4818 \
266         radius/dictionary.rfc4849 \
267         radius/dictionary.rfc5090 \
268         radius/dictionary.rfc5176 \
269         radius/dictionary.rfc5447 \
270         radius/dictionary.rfc5580 \
271         radius/dictionary.rfc5607 \
272         radius/dictionary.rfc5904 \
273         radius/dictionary.rfc6519 \
274         radius/dictionary.rfc6572 \
275         radius/dictionary.rfc6677 \
276         radius/dictionary.rfc6911 \
277         radius/dictionary.rfc6929 \
278         radius/dictionary.rfc6930 \
279         radius/dictionary.rfc7055 \
280         radius/dictionary.rfc7155 \
281         radius/dictionary.rfc7268 \
282         radius/dictionary.rfc7499 \
283         radius/dictionary.riverbed \
284         radius/dictionary.riverstone \
285         radius/dictionary.roaringpenguin \
286         radius/dictionary.ruckus \
287         radius/dictionary.ruggedcom \
288         radius/dictionary.sangoma \
289         radius/dictionary.sg \
290         radius/dictionary.shasta \
291         radius/dictionary.shiva \
292         radius/dictionary.siemens \
293         radius/dictionary.slipstream \
294         radius/dictionary.sofaware \
295         radius/dictionary.sonicwall \
296         radius/dictionary.springtide \
297         radius/dictionary.starent \
298         radius/dictionary.starent.vsa1 \
299         radius/dictionary.surfnet \
300         radius/dictionary.symbol \
301         radius/dictionary.t_systems_nova \
302         radius/dictionary.telebit \
303         radius/dictionary.telkom \
304         radius/dictionary.terena \
305         radius/dictionary.trapeze \
306         radius/dictionary.travelping \
307         radius/dictionary.tropos \
308         radius/dictionary.ukerna \
309         radius/dictionary.unix \
310         radius/dictionary.usr \
311         radius/dictionary.utstarcom \
312         radius/dictionary.valemount \
313         radius/dictionary.versanet \
314         radius/dictionary.vqp \
315         radius/dictionary.walabi \
316         radius/dictionary.waverider \
317         radius/dictionary.wichorus \
318         radius/dictionary.wimax \
319         radius/dictionary.wimax.alvarion \
320         radius/dictionary.wimax.wichorus \
321         radius/dictionary.wispr \
322         radius/dictionary.xedia \
323         radius/dictionary.xylan \
324         radius/dictionary.yubico \
325         radius/dictionary.zeus \
326         radius/dictionary.zte \
327         radius/dictionary.zyxel
328
329 #
330 # Install the tpncp directory files in the "tpncp" subdirectory
331 # of that directory
332 #
333 tpncpdir = $(pkgdatadir)/tpncp
334 dist_tpncp_DATA = \
335         tpncp/tpncp.dat
336
337 #
338 # Install the wimaxasncp directory files in the "wimaxasncp" subdirectory
339 # of that directory
340 #
341 wimaxasncpdir = $(pkgdatadir)/wimaxasncp
342 dist_wimaxasncp_DATA = \
343         wimaxasncp/dictionary.xml \
344         wimaxasncp/dictionary.dtd
345
346 if HAVE_PLUGINS
347 -include plugins/Custom.make
348 plugin_ldadd = $(_CUSTOM_plugin_ldadd_) \
349         -dlopen plugins/docsis/docsis.la \
350         -dlopen plugins/ethercat/ethercat.la \
351         -dlopen plugins/gryphon/gryphon.la \
352         -dlopen plugins/irda/irda.la \
353         -dlopen plugins/m2m/m2m.la \
354         -dlopen plugins/mate/mate.la \
355         -dlopen plugins/opcua/opcua.la \
356         -dlopen plugins/profinet/profinet.la \
357         -dlopen plugins/stats_tree/stats_tree.la \
358         -dlopen plugins/unistim/unistim.la \
359         -dlopen plugins/wimax/wimax.la \
360         -dlopen plugins/wimaxmacphy/wimaxmacphy.la
361
362 else            # HAVE_PLUGINS
363
364 plugin_ldadd =
365
366 endif           # HAVE_PLUGINS
367
368 # "BUILT_SOURCES" are built before any "make all" or "make check" targets.
369 BUILT_HEADER_FILES = \
370         version.h
371
372 BUILT_C_FILES =
373
374 BUILT_SOURCES = $(BUILT_C_FILES) $(BUILT_HEADER_FILES)
375
376 # Header files generated from source files.
377 GENERATED_HEADER_FILES = \
378         text2pcap-scanner_lex.h \
379         $(BUILT_HEADER_FILES)
380
381 # C source files generated from source files.
382 GENERATED_C_FILES =
383
384 # All the generated files.
385 GENERATED_FILES = $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES)
386
387 EXTCAP_COMMON_SRC = \
388         extcap.c                \
389         extcap_parser.c \
390         extcap_spawn.c
391
392 EXTCAP_COMMON_INCLUDES = \
393         extcap.h                \
394         extcap_parser.h \
395         extcap_spawn.h
396
397 # sources common for wireshark, tshark, and rawshark
398 SHARK_COMMON_SRC = \
399         cfile.c                 \
400         frame_tvbuff.c          \
401         sync_pipe_write.c
402
403 # corresponding headers
404 SHARK_COMMON_INCLUDES = \
405         cfile.h                 \
406         file.h                  \
407         fileset.h               \
408         frame_tvbuff.h          \
409         register.h              \
410         ws_symbol_export.h
411
412 # wireshark specifics
413 WIRESHARK_COMMON_SRC = \
414         $(SHARK_COMMON_SRC)     \
415         capture_info.c          \
416         capture_opts.c          \
417         file.c                  \
418         fileset.c               \
419         filter_files.c          \
420         summary.c               \
421         ws_version_info.c
422
423 # corresponding headers
424 WIRESHARK_COMMON_INCLUDES = \
425         capture_info.h          \
426         capture_opts.h          \
427         filter_files.h          \
428         globals.h               \
429         log.h                   \
430         summary.h               \
431         sync_pipe.h
432
433 if HAVE_EXTCAP
434 SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC)
435 endif
436
437 if ENABLE_STATIC
438 EXTRALINKFLAGS = -Wl,-static -all-static
439 else
440 EXTRALINKFLAGS = -export-dynamic
441 endif
442
443 EPAN_EXTRA_LIBS = \
444         @SSL_LIBS@                      \
445         @C_ARES_LIBS@                   \
446         @KRB5_LIBS@                     \
447         @LIBGCRYPT_LIBS@                \
448         @LIBGNUTLS_LIBS@                \
449         @LIBSMI_LDFLAGS@
450
451 # Libraries and plugin flags with which to link wireshark.
452 #
453 # GTK_CFLAGS/GTK_LIBS is a strict superset of GLIB_CFLAGS/GLIB_LIBS
454 # (see configure.ac for pkg-config modules used).
455 #
456 wireshark_common_ldadd = \
457         capchild/libcapchild.a          \
458         caputils/libcaputils.a          \
459         ui/libui.a                      \
460         ui/libui_dirty.a                \
461         codecs/libwscodecs.la           \
462         wiretap/libwiretap.la           \
463         epan/libwireshark.la            \
464         wsutil/libwsutil.la             \
465         $(plugin_ldadd)                 \
466         @PCAP_LIBS@                     \
467         @APPLICATIONSERVICES_FRAMEWORKS@        \
468         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
469         @COREFOUNDATION_FRAMEWORKS@     \
470         $(EPAN_EXTRA_LIBS)                      \
471         @LIBNL_LIBS@
472
473 if HAVE_Qt
474 wireshark_SOURCES = $(WIRESHARK_COMMON_SRC) wireshark-qt.cpp
475
476 wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(Qt_CFLAGS)
477
478 wireshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) $(Qt_LDFLAGS)
479
480 wireshark_LDADD = \
481         ui/qt/libqtui.a                 \
482         $(wireshark_common_ldadd)       \
483         $(GLIB_LIBS)                    \
484         $(Qt_LIBS)
485
486 if HAVE_SPEEXDSP
487 wireshark_LDADD += $(SPEEXDSP_LIBS)
488 endif
489 endif   # HAVE_Qt
490
491 if HAVE_GTK
492 wireshark_gtk_SOURCES = $(WIRESHARK_COMMON_SRC)
493
494 wireshark_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(GTK_CFLAGS)
495
496 wireshark_gtk_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
497
498 wireshark_gtk_LDADD = \
499         ui/gtk/libgtkui.a               \
500         $(wireshark_common_ldadd)       \
501         $(GTK_LIBS)                     \
502         @PORTAUDIO_LIBS@
503 endif
504
505 tshark_SOURCES = \
506         $(SHARK_COMMON_SRC)     \
507         capture_opts.c          \
508         filter_files.c          \
509         tshark.c                \
510         ws_version_info.c
511
512 tshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
513
514 tshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
515
516 # Libraries and plugin flags with which to link tshark.
517 tshark_LDADD = \
518         capchild/libcapchild.a          \
519         caputils/libcaputils.a          \
520         ui/cli/libcliui.a               \
521         ui/libui.a                      \
522         wiretap/libwiretap.la           \
523         epan/libwireshark.la            \
524         wsutil/libwsutil.la             \
525         $(plugin_ldadd)                 \
526         @GLIB_LIBS@                     \
527         @PCAP_LIBS@                     \
528         ${EPAN_EXTRA_LIBS}      \
529         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
530         @COREFOUNDATION_FRAMEWORKS@
531
532 tfshark_SOURCES = \
533         $(SHARK_COMMON_SRC)     \
534         tfshark.c               \
535         ws_version_info.c
536
537 tfshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
538
539 tfshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
540
541 # Libraries and plugin flags with which to link tfshark.
542 tfshark_LDADD = \
543         ui/cli/libcliui.a               \
544         ui/libui.a                      \
545         wiretap/libwiretap.la           \
546         epan/libwireshark.la            \
547         wsutil/libwsutil.la             \
548         $(plugin_ldadd)                 \
549         @GLIB_LIBS@                     \
550         @PCAP_LIBS@                     \
551         ${EPAN_EXTRA_LIBS}      \
552         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
553         @COREFOUNDATION_FRAMEWORKS@
554
555 rawshark_SOURCES = \
556         $(SHARK_COMMON_SRC)     \
557         rawshark.c              \
558         ws_version_info.c
559
560 rawshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
561
562 rawshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
563
564 # Libraries and plugin flags with which to link rawshark.
565 rawshark_LDADD = \
566         caputils/libcaputils.a          \
567         ui/libui.a                      \
568         wiretap/libwiretap.la           \
569         epan/libwireshark.la            \
570         wsutil/libwsutil.la             \
571         $(plugin_ldadd)                 \
572         @GLIB_LIBS@                     \
573         @PCAP_LIBS@                     \
574         ${EPAN_EXTRA_LIBS}      \
575         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
576         @COREFOUNDATION_FRAMEWORKS@
577
578 text2pcap_SOURCES = \
579         text2pcap.c             \
580         text2pcap-scanner.l     \
581         ws_version_info.c
582
583 text2pcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
584
585 # Don't turn on -Werror for text2pcap: its source includes text2pcap-scanner.c
586 # which is generated (and therefore not always clean).
587 # We could generate text2pcap.o as a library with -Werror but for now it
588 # doesn't seem worth the effort.
589 text2pcap_CFLAGS = $(GENERATED_CFLAGS)
590
591 # Libraries with which to link text2pcap.
592 text2pcap_LDADD = \
593         writecap/libwritecap.a          \
594         wsutil/libwsutil.la             \
595         @GLIB_LIBS@
596
597 mergecap_SOURCES = \
598         mergecap.c      \
599         ws_version_info.c
600
601 mergecap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
602
603 # Libraries with which to link mergecap.
604 mergecap_LDADD = \
605         wiretap/libwiretap.la           \
606         wsutil/libwsutil.la             \
607         @GLIB_LIBS@
608
609 capinfos_SOURCES = \
610         capinfos.c      \
611         ws_version_info.c
612
613 capinfos_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
614
615 # Libraries with which to link capinfos.
616 capinfos_LDADD = \
617         wiretap/libwiretap.la           \
618         wsutil/libwsutil.la             \
619         @GLIB_LIBS@                     \
620         @LIBGCRYPT_LIBS@
621
622 captype_SOURCES = \
623         captype.c       \
624         ws_version_info.c
625
626 captype_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
627
628 # Libraries with which to link captype.
629 captype_LDADD = \
630         wiretap/libwiretap.la           \
631         wsutil/libwsutil.la             \
632         @GLIB_LIBS@
633
634 editcap_SOURCES = \
635         editcap.c       \
636         ws_version_info.c
637
638 editcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
639
640 # Libraries with which to link editcap.
641 editcap_LDADD = \
642         wiretap/libwiretap.la           \
643         wsutil/libwsutil.la             \
644         @GLIB_LIBS@
645
646 reordercap_SOURCES = \
647         reordercap.c    \
648         ws_version_info.c
649
650 reordercap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
651
652 # Libraries with which to link reordercap.
653 reordercap_LDADD = \
654         wiretap/libwiretap.la           \
655         wsutil/libwsutil.la             \
656         @GLIB_LIBS@
657
658 randpkt_SOURCES = \
659         randpkt.c       \
660         ws_version_info.c
661
662 randpkt_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
663
664 # Libraries with which to link randpkt.
665 randpkt_LDADD = \
666         randpkt_core/librandpkt_core.a  \
667         wiretap/libwiretap.la           \
668         wsutil/libwsutil.la             \
669         @GLIB_LIBS@                     \
670         @PCAP_LIBS@                     \
671         @C_ARES_LIBS@
672
673 dftest_SOURCES = \
674         dftest.c
675
676 dftest_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
677
678 # Libraries and plugin flags with which to link dftest.
679 dftest_LDADD = \
680         ui/libui.a                      \
681         wiretap/libwiretap.la           \
682         wsutil/libwsutil.la             \
683         epan/libwireshark.la            \
684         $(plugin_ldadd)                 \
685         @GLIB_LIBS@                     \
686         @PCAP_LIBS@                     \
687         ${EPAN_EXTRA_LIBS}
688
689 echld_test_SOURCES = \
690         echld_test.c                    \
691         capture_opts.c                  \
692         capture_stop_conditions.c       \
693         cfile.c                         \
694         conditions.c                    \
695         ringbuffer.c                    \
696         sync_pipe_write.c
697
698 echld_test_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
699
700 echld_test_LDADD = \
701         epan/libwireshark.la            \
702         echld/libechld.la               \
703         writecap/libwritecap.a          \
704         wsutil/libwsutil.la             \
705         @GLIB_LIBS@                     \
706         @PCAP_LIBS@                     \
707         @C_ARES_LIBS@
708
709 echld_test_DEPENDENCIES = \
710         echld/libechld.la       \
711         epan/libwireshark.la
712
713 dumpcap_SOURCES = \
714         capture_opts.c                  \
715         capture_stop_conditions.c       \
716         conditions.c                    \
717         dumpcap.c                       \
718         filter_files.c                  \
719         ringbuffer.c                    \
720         sync_pipe_write.c               \
721         ws_version_info.c
722
723 dumpcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
724
725 dumpcap_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS)
726
727 dumpcap_LDFLAGS = $(AM_LDFLAGS) $(PIE_LDFLAGS)
728
729 # Libraries with which to link dumpcap.
730 dumpcap_LDADD = \
731         caputils/libcaputils.a          \
732         writecap/libwritecap.a          \
733         wsutil/libwsutil.la             \
734         @GLIB_LIBS@                     \
735         @PCAP_LIBS@                     \
736         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
737         @COREFOUNDATION_FRAMEWORKS@     \
738         @LIBCAP_LIBS@                   \
739         @LIBNL_LIBS@
740
741 # this target needed for distribution only
742 noinst_HEADERS = \
743         $(SHARK_COMMON_INCLUDES)        \
744         $(EXTCAP_COMMON_INCLUDES)       \
745         $(WIRESHARK_COMMON_INCLUDES)    \
746         capture_stop_conditions.h       \
747         conditions.h                    \
748         ringbuffer.h                    \
749         ws_diag_control.h               \
750         ws_version_info.h
751
752 #
753 # Build the version string
754 #
755 # FORCE is the portable version of .PHONY
756 FORCE:
757
758 version.h: FORCE
759         $(AM_V_PERL)$(PERL) $(srcdir)/make-version.pl $(srcdir)
760
761 #
762 # Build shell scripts by doing variable substitution.
763 # Taken from autoconf 2.13.
764 #
765 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
766
767 SUFFIXES = .sh
768 .sh:
769         rm -f $@ $@.tmp
770         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
771
772 services:
773         $(PYTHON) $(srcdir)/tools/make-services.py
774
775 CLEANFILES = \
776         *~              \
777         doxygen-core.tag        \
778         vgcore.*
779
780 #
781 # We have to remove version.h with "make distclean", as, otherwise,
782 # "make distcheck" fails.  We still need to make the tarballs work
783 # even if you do "make distclean" and try to rebuild; that's a work in
784 # progress.
785 #
786 # XXX - "ps.c" is distributed in the source tarballs; why is it in the
787 # list of files removed by "make distclean"?  (It's deliberately
788 # included in that list.)
789 #
790 DISTCLEANFILES = \
791         ps.c                    \
792         version.h
793
794 MAINTAINERCLEANFILES = \
795         $(GENERATED_FILES)      \
796         Makefile.in             \
797         aclocal.m4              \
798         compile                 \
799         config.h.in             \
800         configure               \
801         depcomp                 \
802         install-sh              \
803         ltmain.sh               \
804         missing                 \
805         ylwrap
806
807 EXTRA_DIST = \
808         .editorconfig           \
809         .mailmap                \
810         INSTALL.configure       \
811         Makefile.am.inc         \
812         README.aix              \
813         README.bsd              \
814         README.DECT             \
815         README.hpux             \
816         README.linux            \
817         README.macos            \
818         README.vmware           \
819         README.windows          \
820         abi-descriptor.template \
821         autogen.sh              \
822         cfilters                \
823         colorfilters            \
824         debian                  \
825         dfilters                \
826         doxygen_global.cfg      \
827         doxygen.cfg.in          \
828         fix                     \
829         idl                     \
830         image                   \
831         ipmap.html              \
832         m4                      \
833         macosx-setup.sh         \
834         macosx-support-lib-patches      \
835         make-version.pl         \
836         manuf                   \
837         manuf.tmpl              \
838         pdml2html.xsl           \
839         smi_modules             \
840         text2pcap-scanner.l     \
841         text2pcap.h             \
842         services                \
843         wireshark.desktop       \
844         wireshark-gtk.desktop   \
845         wireshark-mime-package.xml      \
846         wireshark.appdata.xml   \
847         wireshark.pc.in         \
848         wka.tmpl                \
849         CMakeLists.txt          \
850         CMakeListsCustom.txt.example    \
851         cmakeconfig.h.in        \
852         CMakeOptions.txt        \
853         README.cmake            \
854         ConfigureChecks.cmake   \
855         cmake                   \
856         CPackConfig.txt
857
858 install-exec-hook:
859 if HAVE_DUMPCAP_GROUP
860         chgrp $(DUMPCAP_GROUP) $(DESTDIR)$(bindir)/dumpcap
861 endif
862 if SETCAP_INSTALL
863         $(SETCAP) cap_net_raw,cap_net_admin+ep $(DESTDIR)$(bindir)/dumpcap
864         chmod o-rws $(DESTDIR)$(bindir)/dumpcap
865 else
866 if SETUID_INSTALL
867         chmod o-rws $(DESTDIR)$(bindir)/dumpcap
868         chmod +s $(DESTDIR)$(bindir)/dumpcap
869 endif
870 endif
871
872
873 DIST_SUBDIRS = \
874         capchild        \
875         caputils        \
876         codecs          \
877         doc             \
878         epan            \
879         echld           \
880         ui              \
881         ui/cli          \
882         ui/gtk          \
883         ui/qt           \
884         help            \
885         packaging       \
886         plugins         \
887         randpkt_core    \
888         tools           \
889         wiretap         \
890         writecap        \
891         wsutil          \
892         extcap          \
893         docbook
894
895 SUBDIRS = \
896         tools                   \
897         wsutil                  \
898         writecap                \
899         wiretap                 \
900         epan                    \
901         capchild                \
902         caputils                \
903         @echld_dir@             \
904         @plugins_dir@           \
905         packaging               \
906         help                    \
907         ui                      \
908         @wireshark_SUBDIRS@     \
909         ui/cli                  \
910         randpkt_core            \
911         @extcap_subdir@         \
912         .                       \
913         doc
914
915 help/faq.txt: $(srcdir)/help/faq.py
916         $(AM_V_GEN)(cd help ; \
917         $(MAKE) faq.txt ;)
918
919 libtool: $(LIBTOOL_DEPS)
920         $(SHELL) ./config.status --recheck
921
922
923 #
924 # Install icons and other desktop files for (for use with GNOME, KDE, or
925 # any other freedesktop.org-compliant desktops).
926 #
927 # We use $(datadir).  If the desktop doesn't look for them there,
928 # the desktop is broken; the latest XDG Base Directory Specification
929 # at
930 #
931 #    http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
932 #
933 # says
934 #
935 # $XDG_DATA_DIRS defines the preference-ordered set of base directories
936 # to search for data files in addition to the $XDG_DATA_HOME base
937 # directory. The directories in $XDG_DATA_DIRS should be seperated with a
938 # colon ':'.
939 #
940 # If $XDG_DATA_DIRS is either not set or empty, a value equal to
941 # /usr/local/share/:/usr/share/ should be used.
942 #
943 # so:
944 #
945 #    if this is configured to install under /usr, that should Just Work,
946 #    unless XDG_DATA_DIRS is set incorrectly or the desktop isn't
947 #    compliant with the latest version of the spec;
948 #
949 #    if this installs under the default /usr/share, that should Just Work,
950 #    unless XDG_DATA_DIRS is set incorrectly or the desktop isn't
951 #    compliant with the latest version of the spec;
952 #
953 #    if this is configured to install somewhere else, whoever configured
954 #    it should also have made sure that XDG_DATA_DIRS was set correctly
955 #    and, if that doesn't work, the desktop isn't compliant with the
956 #    latest version of the spec.
957 #
958 # We install these as part of the standard installation process, just
959 # as, for example, Inkscape does with its icons.  See bug 10737.
960 #
961 # Do not use the -T flag to the install command, as it's not portable.
962 # Some versions of install don't support a -T flag at all, and the
963 # FreeBSD install command has a -T flag that takes an argument and
964 # that has completely different semantics.
965 #
966 # We neither need nor want any of this on OS X, nor do we want it if
967 # we're not building Wireshark (that being the only desktop app).
968 #
969 install-data-local:
970 if BUILDING_WIRESHARK
971 if NOT_OS_X
972         mkdir -p $(DESTDIR)$(datadir)/mime/packages
973         install -m 644 $(srcdir)/wireshark-mime-package.xml $(DESTDIR)$(datadir)/mime/packages/wireshark.xml
974         mkdir -p $(DESTDIR)$(datadir)/appdata
975         install -m 644 $(srcdir)/wireshark.appdata.xml $(DESTDIR)$(datadir)/appdata/wireshark.appdata.xml
976         mkdir -p $(DESTDIR)$(datadir)/applications
977         if test x$(DESKTOP_FILE_INSTALL) != x ; then \
978                 $(DESKTOP_FILE_INSTALL) --dir $(DESTDIR)$(datadir)/applications $(srcdir)/wireshark.desktop  $(srcdir)/wireshark-gtk.desktop ; \
979         else \
980                 install -m 644 $(srcdir)/wireshark.desktop $(srcdir)/wireshark-gtk.desktop $(DESTDIR)$(datadir)/applications; \
981         fi
982         for size in 16 24 32 48 64 128 256; \
983         do \
984                 mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps ; \
985                 install -m 644 $(srcdir)/image/wsicon$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
986                 mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes ; \
987                 install -m 644 $(srcdir)/image/WiresharkDoc-$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
988         done
989         mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps
990         install -m 644 $(srcdir)/image/wsicon.svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/wireshark.svg
991 endif
992 endif
993
994 uninstall-local:
995 if BUILDING_WIRESHARK
996 if NOT_OS_X
997         rm -f $(DESTDIR)$(datadir)/appdata/wireshark.appdata.xml
998         rm -f $(DESTDIR)$(datadir)/applications/wireshark.desktop
999         rm -f $(DESTDIR)$(datadir)/applications/wireshark-gtk.desktop
1000         rm -f $(DESTDIR)$(datadir)/mime/packages/wireshark.xml
1001         for size in 16 24 32 48 64 128 256; \
1002         do \
1003                 rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
1004                 rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
1005         done
1006         rm -f $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/wireshark.svg
1007 endif
1008 endif
1009
1010 install-data-hook: update-databases-and-caches-install
1011 uninstall-hook: update-databases-and-caches-uninstall
1012
1013 #
1014 # XXX - which of this stuff can, and should, we do ourselves?
1015 #
1016 # If we're "installing" under $(DESTDIR) as part of the process of
1017 # building a package, we probably don't need to, and shouldn't, do
1018 # any of this.
1019 #
1020 # If we're installing for use, we may need to do some of this; which
1021 # of them do we need to tell where to search, especially if we're
1022 # installing somewhere other than under /usr or /usr/local?
1023 #
1024 # What if we're installing in the user's home directory?
1025 #
1026 # What if we're installing under /opt?
1027 #
1028 # We only need to run ldconfig on systems where it's necessary in order
1029 # to update a shared library cache to know about our shared libraries.
1030 #
1031 # We only need to run update-desktop-database and update-mime-database
1032 # on freedesktop.org desktops.
1033 #
1034 # We only need to run gtk-update-icon-cache if we're installing a GTK+
1035 # version of Wireshark.
1036 #
1037 # We neither need nor want any of this on OS X, nor do we want it if
1038 # we're not building Wireshark (that being the only desktop app).
1039 #
1040 update-databases-and-caches-common:
1041 if BUILDING_WIRESHARK
1042 if NOT_OS_X
1043         @echo "You may need to run \"ldconfig\" as root"
1044         @echo "You may need to run \"update-desktop-database $(datadir)/applications\""
1045         @echo "You may need to run \"update-mime-database $(datadir)/mime\""
1046         @echo "You may need to run \"gtk-update-icon-cache -f -t $(datadir)/icons/hicolor\""
1047 endif
1048 endif
1049
1050 update-databases-and-caches-install: update-databases-and-caches-common
1051
1052 update-databases-and-caches-uninstall: update-databases-and-caches-common
1053
1054 # Used by svr4-package and osx-package
1055 # We load top_stagedir with an absolute path so that libtool doesn't freak.
1056 top_stagedir=$(abs_top_builddir)/packaging/staging
1057 stagedir=$(top_stagedir)/$(PACKAGE).inst
1058
1059 host_cpu=@host_cpu@
1060 host_os=@host_os@
1061
1062 solaris-package: svr4-package
1063
1064 svr4-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
1065         @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
1066                 rm -rf $(stagedir) ; \
1067                 $(MAKE) DESTDIR=$(stagedir) install; \
1068                 $(srcdir)/packaging/svr4/mkpkg \
1069                         $(PACKAGE) \
1070                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
1071                         $(prefix) \
1072                         $(top_stagedir) ; \
1073         else \
1074                 echo "Error: SVR4 packaging tools not found." ; \
1075                 echo "Package build abandoned." ; \
1076         fi
1077
1078
1079 rpm_topdir=`cd $(top_builddir) && pwd`/packaging/rpm
1080 if HAVE_RPM
1081 rpm-package: dist
1082         @cd $(rpm_topdir) && \
1083           mkdir -p BUILD RPMS SOURCES SRPMS && \
1084           cd SOURCES && \
1085           ln -sf ../../../$(distdir).tar.xz && \
1086           cd .. && \
1087           $(RPMBUILD) --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" \
1088                 @RPMBUILD_WITH_ARGS@ --clean -ba SPECS/wireshark.spec && \
1089           echo "Package successfully built in `pwd`/RPMS." ; \
1090           rm -f SOURCES/$(distdir).tar.xz ../../$(distdir).tar.xz
1091 else
1092 rpm-package:
1093         @echo "RPM executable not available." ; \
1094           false
1095 endif
1096
1097 # XXX - This assumes we're building from the source directory.
1098 osx-app: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) packaging/macosx/Info.plist
1099         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1100                 rm -rf $(stagedir) ; \
1101                 $(MAKE) DESTDIR=$(stagedir) install; \
1102                 cd $(srcdir)/packaging/macosx ; \
1103                 ./osx-app.sh @OSX_APP_FLAGS@ \
1104                         --create-bundle \
1105                         --binary-path ../staging/$(PACKAGE).inst$(bindir) \
1106                         --plugin-path ../staging/$(PACKAGE).inst$(plugindir) \
1107                         --extcap-path ../staging/$(PACKAGE).inst$(extcapdir) \
1108                         --library-path ../staging/$(PACKAGE).inst$(libdir) ; \
1109         else \
1110                 echo "Error: OS X packaging tools not found." ; \
1111                 echo "Package build abandoned." ; \
1112         fi
1113
1114 packaging/macosx/COPYING.txt: COPYING
1115         (cd packaging/macosx ; \
1116         $(MAKE) COPYING.txt ;)
1117
1118 osx-package: osx-app packaging/macosx/COPYING.txt
1119         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1120                 cd $(srcdir)/packaging/macosx ; \
1121                 chmod +x ./osx-dmg.sh ; \
1122                 ./osx-dmg.sh @OSX_DMG_FLAGS@ ; \
1123         fi
1124
1125 osx-install: osx-app
1126         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1127                 echo "Copying Wireshark.app to /Applications" ; \
1128                 cp -pr $(srcdir)/packaging/macosx/Wireshark.app /Applications ; \
1129         fi
1130
1131 test-programs:
1132         cd epan && $(MAKE) $@
1133
1134 clean-local:
1135         rm -rf $(top_stagedir)
1136
1137 dumpabi:
1138         $(MAKE) -C wiretap dumpabi-libwiretap
1139         $(MAKE) -C epan dumpabi-libwireshark
1140         $(MAKE) -C wsutil dumpabi-libwsutil
1141
1142 checkapi_local:
1143         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -build \
1144         -sourcedir=$(srcdir) \
1145         $(TSHARK_TAP_SRC) \
1146         $(wireshark_gtk_SOURCES)
1147 #       $(EXTRA_wireshark_gtk_SOURCES)
1148
1149 checkapi: checkapi_local
1150         cd wiretap && $(MAKE) checkapi
1151         cd codecs && $(MAKE) checkapi
1152         cd capchild && $(MAKE) checkapi
1153         cd caputils && $(MAKE) checkapi
1154         cd ui && $(MAKE) checkapi
1155         cd ui/gtk && $(MAKE) checkapi
1156         cd ui/cli && $(MAKE) checkapi
1157         cd epan && $(MAKE) checkapi
1158         cd epan/crypt && $(MAKE) checkapi
1159         cd epan/dfilter && $(MAKE) checkapi
1160         cd epan/ftypes && $(MAKE) checkapi
1161         cd epan/wmem && $(MAKE) checkapi
1162         cd epan/wslua && $(MAKE) checkapi
1163         cd epan/dissectors && $(MAKE) checkapi
1164         cd plugins && $(MAKE) checkapi
1165         cd randpkt_core && $(MAKE) checkapi
1166         cd writecap && $(MAKE) checkapi
1167         cd wsutil && $(MAKE) checkapi
1168
1169 if HAVE_SHELLCHECK
1170 # --external-sources requires 0.4.0 or later.
1171 shellcheck:
1172         cd $(top_srcdir) && \
1173         shellcheck --external-sources \
1174           tools/fuzz-test.sh \
1175           tools/randpkt-test.sh \
1176           tools/runa2x.sh \
1177           tools/test-captures.sh \
1178           tools/valgrind-wireshark.sh
1179 else
1180 shellcheck:
1181         @echo "Shellcheck not available." ; \
1182           false
1183 endif
1184
1185 wsar_html: doxygen.cfg doxygen_global.cfg FORCE
1186 if HAVE_DOXYGEN
1187         rm -rf wsar_html
1188         cd epan && $(MAKE) $@
1189         cd capchild && $(MAKE) $@
1190         cd caputils && $(MAKE) $@
1191         cd randpkt_core && $(MAKE) $@
1192         cd ui && $(MAKE) $@
1193         (umask 022 ; $(DOXYGEN) doxygen.cfg)
1194 endif
1195
1196 wsar-zip: wsar_html
1197 if HAVE_DOXYGEN
1198         rm -f wsar_html.zip
1199         zip -rq wsar_html.zip wsar_html
1200 endif
1201
1202 # Update AUTHORS file with entries from git shortlog
1203 gen-authors:
1204         cd $(top_srcdir) && $(PERL) tools/generate_authors.pl AUTHORS.src > AUTHORS
1205
1206 dist-hook:
1207         printf "git_description=%s\n" "$$(git -C $(top_srcdir) describe)" \
1208                 > $(top_distdir)/version.conf