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