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