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