plugins: config.h must not be included by public headers
[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/m2m/m2m.la \
361         -dlopen plugins/mate/mate.la \
362         -dlopen plugins/opcua/opcua.la \
363         -dlopen plugins/profinet/profinet.la \
364         -dlopen plugins/stats_tree/stats_tree.la \
365         -dlopen plugins/unistim/unistim.la \
366         -dlopen plugins/wimax/wimax.la \
367         -dlopen plugins/wimaxmacphy/wimaxmacphy.la
368
369 else            # HAVE_PLUGINS
370
371 plugin_ldadd =
372
373 endif           # HAVE_PLUGINS
374
375 # "BUILT_SOURCES" are built before any "make all" or "make check" targets.
376 BUILT_HEADER_FILES = \
377         version.h
378
379 BUILT_C_FILES =
380
381 BUILT_SOURCES = $(BUILT_C_FILES) $(BUILT_HEADER_FILES)
382
383 # Header files generated from source files.
384 GENERATED_HEADER_FILES = \
385         text2pcap-scanner_lex.h \
386         $(BUILT_HEADER_FILES)
387
388 # C source files generated from source files.
389 GENERATED_C_FILES =
390
391 # All the generated files.
392 GENERATED_FILES = $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES)
393
394 EXTCAP_COMMON_SRC = \
395         extcap.c                \
396         extcap_parser.c \
397         extcap_spawn.c
398
399 EXTCAP_COMMON_INCLUDES = \
400         extcap.h                \
401         extcap_parser.h \
402         extcap_spawn.h
403
404 # sources common for wireshark, tshark, and rawshark
405 SHARK_COMMON_SRC = \
406         cfile.c                 \
407         frame_tvbuff.c          \
408         sync_pipe_write.c
409
410 # corresponding headers
411 SHARK_COMMON_INCLUDES = \
412         cfile.h                 \
413         file.h                  \
414         fileset.h               \
415         frame_tvbuff.h          \
416         register.h              \
417         ws_symbol_export.h      \
418         ws_attributes.h
419
420 # wireshark specifics
421 WIRESHARK_COMMON_SRC = \
422         $(SHARK_COMMON_SRC)     \
423         capture_info.c          \
424         capture_opts.c          \
425         file.c                  \
426         fileset.c               \
427         summary.c               \
428         ws_version_info.c
429
430 # corresponding headers
431 WIRESHARK_COMMON_INCLUDES = \
432         capture_info.h          \
433         capture_opts.h          \
434         globals.h               \
435         log.h                   \
436         summary.h               \
437         sync_pipe.h
438
439 if HAVE_EXTCAP
440 SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC)
441 endif
442
443 if ENABLE_STATIC
444 EXTRALINKFLAGS = -Wl,-static -all-static
445 else
446 EXTRALINKFLAGS = -export-dynamic
447 endif
448
449 EPAN_EXTRA_LIBS = \
450         @SSL_LIBS@                      \
451         @C_ARES_LIBS@                   \
452         @KRB5_LIBS@                     \
453         @LIBGCRYPT_LIBS@                \
454         @LIBGNUTLS_LIBS@                \
455         @LIBSMI_LDFLAGS@
456
457 # Libraries and plugin flags with which to link wireshark.
458 #
459 # GTK_CFLAGS/GTK_LIBS is a strict superset of GLIB_CFLAGS/GLIB_LIBS
460 # (see configure.ac for pkg-config modules used).
461 #
462 wireshark_common_ldadd = \
463         capchild/libcapchild.a          \
464         caputils/libcaputils.a          \
465         ui/libui.a                      \
466         ui/libui_dirty.a                \
467         codecs/libwscodecs.la           \
468         wiretap/libwiretap.la           \
469         epan/libwireshark.la            \
470         wsutil/libwsutil.la             \
471         $(plugin_ldadd)                 \
472         @PCAP_LIBS@                     \
473         @APPLICATIONSERVICES_FRAMEWORKS@        \
474         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
475         @COREFOUNDATION_FRAMEWORKS@     \
476         $(EPAN_EXTRA_LIBS)                      \
477         @LIBNL_LIBS@
478
479 if HAVE_Qt
480 wireshark_SOURCES = $(WIRESHARK_COMMON_SRC) wireshark-qt.cpp
481
482 wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(Qt_CFLAGS)
483
484 wireshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) $(Qt_LDFLAGS)
485
486 wireshark_LDADD = \
487         ui/qt/libqtui.a                 \
488         $(wireshark_common_ldadd)       \
489         $(GLIB_LIBS)                    \
490         $(Qt_LIBS)
491
492 if HAVE_SPEEXDSP
493 wireshark_LDADD += $(SPEEXDSP_LIBS)
494 endif
495 endif   # HAVE_Qt
496
497 if HAVE_GTK
498 wireshark_gtk_SOURCES = $(WIRESHARK_COMMON_SRC)
499
500 wireshark_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(GTK_CFLAGS)
501
502 wireshark_gtk_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
503
504 wireshark_gtk_LDADD = \
505         ui/gtk/libgtkui.a               \
506         $(wireshark_common_ldadd)       \
507         $(GTK_LIBS)                     \
508         @PORTAUDIO_LIBS@
509 endif
510
511 tshark_SOURCES = \
512         $(SHARK_COMMON_SRC)     \
513         capture_opts.c          \
514         tshark.c                \
515         ws_version_info.c
516
517 tshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
518
519 tshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
520
521 # Libraries and plugin flags with which to link tshark.
522 tshark_LDADD = \
523         capchild/libcapchild.a          \
524         caputils/libcaputils.a          \
525         ui/cli/libcliui.a               \
526         ui/libui.a                      \
527         wiretap/libwiretap.la           \
528         epan/libwireshark.la            \
529         wsutil/libwsutil.la             \
530         $(plugin_ldadd)                 \
531         @GLIB_LIBS@                     \
532         @PCAP_LIBS@                     \
533         ${EPAN_EXTRA_LIBS}      \
534         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
535         @COREFOUNDATION_FRAMEWORKS@
536
537 tfshark_SOURCES = \
538         $(SHARK_COMMON_SRC)     \
539         tfshark.c               \
540         ws_version_info.c
541
542 tfshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
543
544 tfshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
545
546 # Libraries and plugin flags with which to link tfshark.
547 tfshark_LDADD = \
548         ui/cli/libcliui.a               \
549         ui/libui.a                      \
550         wiretap/libwiretap.la           \
551         epan/libwireshark.la            \
552         wsutil/libwsutil.la             \
553         $(plugin_ldadd)                 \
554         @GLIB_LIBS@                     \
555         @PCAP_LIBS@                     \
556         ${EPAN_EXTRA_LIBS}      \
557         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
558         @COREFOUNDATION_FRAMEWORKS@
559
560 rawshark_SOURCES = \
561         $(SHARK_COMMON_SRC)     \
562         rawshark.c              \
563         ws_version_info.c
564
565 rawshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
566
567 rawshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
568
569 # Libraries and plugin flags with which to link rawshark.
570 rawshark_LDADD = \
571         caputils/libcaputils.a          \
572         ui/libui.a                      \
573         wiretap/libwiretap.la           \
574         epan/libwireshark.la            \
575         wsutil/libwsutil.la             \
576         $(plugin_ldadd)                 \
577         @GLIB_LIBS@                     \
578         @PCAP_LIBS@                     \
579         ${EPAN_EXTRA_LIBS}      \
580         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
581         @COREFOUNDATION_FRAMEWORKS@
582
583 sharkd_SOURCES = \
584         $(SHARK_COMMON_SRC)     \
585         sharkd.c                \
586         sharkd.h                \
587         sharkd_daemon.c         \
588         sharkd_session.c        \
589         ws_version_info.c
590
591 sharkd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
592
593 if HAVE_SPEEXDSP
594 sharkd_CPPFLAGS += $(SPEEXDSP_CFLAGS)
595 endif
596
597 sharkd_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
598
599 # Libraries and plugin flags with which to link sharkd.
600 sharkd_LDADD = \
601         ui/cli/libcliui.a               \
602         ui/libui.a                      \
603         codecs/libwscodecs.la           \
604         wiretap/libwiretap.la           \
605         epan/libwireshark.la            \
606         wsutil/libwsutil.la             \
607         $(plugin_ldadd)                 \
608         @GLIB_LIBS@                     \
609         @PCAP_LIBS@                     \
610         ${EPAN_EXTRA_LIBS}      \
611         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
612         @COREFOUNDATION_FRAMEWORKS@
613
614 if HAVE_SPEEXDSP
615 sharkd_LDADD += $(SPEEXDSP_LIBS)
616 endif
617
618 text2pcap_SOURCES = \
619         text2pcap.c             \
620         text2pcap-scanner.l     \
621         ws_version_info.c
622
623 text2pcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
624
625 # Don't turn on -Werror for text2pcap: its source includes text2pcap-scanner.c
626 # which is generated (and therefore not always clean).
627 # We could generate text2pcap.o as a library with -Werror but for now it
628 # doesn't seem worth the effort.
629 text2pcap_CFLAGS = $(GENERATED_CFLAGS)
630
631 # Libraries with which to link text2pcap.
632 text2pcap_LDADD = \
633         writecap/libwritecap.a          \
634         wsutil/libwsutil.la             \
635         @GLIB_LIBS@
636
637 mergecap_SOURCES = \
638         mergecap.c      \
639         ws_version_info.c
640
641 mergecap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
642
643 # Libraries with which to link mergecap.
644 mergecap_LDADD = \
645         ui/libui.a                      \
646         wiretap/libwiretap.la           \
647         wsutil/libwsutil.la             \
648         @GLIB_LIBS@
649
650 capinfos_SOURCES = \
651         capinfos.c      \
652         ws_version_info.c
653
654 capinfos_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
655
656 # Libraries with which to link capinfos.
657 capinfos_LDADD = \
658         ui/libui.a                      \
659         wiretap/libwiretap.la           \
660         wsutil/libwsutil.la             \
661         @GLIB_LIBS@                     \
662         @LIBGCRYPT_LIBS@
663
664 captype_SOURCES = \
665         captype.c       \
666         ws_version_info.c
667
668 captype_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
669
670 # Libraries with which to link captype.
671 captype_LDADD = \
672         ui/libui.a                      \
673         wiretap/libwiretap.la           \
674         wsutil/libwsutil.la             \
675         @GLIB_LIBS@
676
677 editcap_SOURCES = \
678         editcap.c       \
679         ws_version_info.c
680
681 editcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
682
683 # Libraries with which to link editcap.
684 editcap_LDADD = \
685         ui/libui.a                      \
686         wiretap/libwiretap.la           \
687         wsutil/libwsutil.la             \
688         @GLIB_LIBS@                     \
689         @LIBGCRYPT_LIBS@
690
691 reordercap_SOURCES = \
692         reordercap.c    \
693         ws_version_info.c
694
695 reordercap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
696
697 # Libraries with which to link reordercap.
698 reordercap_LDADD = \
699         ui/libui.a                      \
700         wiretap/libwiretap.la           \
701         wsutil/libwsutil.la             \
702         @GLIB_LIBS@
703
704 randpkt_SOURCES = \
705         randpkt.c       \
706         ws_version_info.c
707
708 randpkt_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
709
710 # Libraries with which to link randpkt.
711 randpkt_LDADD = \
712         randpkt_core/librandpkt_core.a  \
713         ui/libui.a                      \
714         wiretap/libwiretap.la           \
715         wsutil/libwsutil.la             \
716         @GLIB_LIBS@                     \
717         @PCAP_LIBS@                     \
718         @C_ARES_LIBS@
719
720 dftest_SOURCES = \
721         dftest.c
722
723 dftest_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
724
725 # Libraries and plugin flags with which to link dftest.
726 dftest_LDADD = \
727         ui/libui.a                      \
728         wiretap/libwiretap.la           \
729         wsutil/libwsutil.la             \
730         epan/libwireshark.la            \
731         $(plugin_ldadd)                 \
732         @GLIB_LIBS@                     \
733         @PCAP_LIBS@                     \
734         ${EPAN_EXTRA_LIBS}
735
736 dumpcap_SOURCES = \
737         capture_opts.c                  \
738         capture_stop_conditions.c       \
739         conditions.c                    \
740         dumpcap.c                       \
741         ringbuffer.c                    \
742         sync_pipe_write.c               \
743         ws_version_info.c
744
745 dumpcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
746
747 dumpcap_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS)
748
749 dumpcap_LDFLAGS = $(AM_LDFLAGS) $(PIE_LDFLAGS)
750
751 # Libraries with which to link dumpcap.
752 dumpcap_LDADD = \
753         caputils/libcaputils.a          \
754         ui/libui.a                      \
755         writecap/libwritecap.a          \
756         wsutil/libwsutil.la             \
757         @GLIB_LIBS@                     \
758         @PCAP_LIBS@                     \
759         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
760         @COREFOUNDATION_FRAMEWORKS@     \
761         @LIBCAP_LIBS@                   \
762         @LIBNL_LIBS@
763
764 # this target needed for distribution only
765 noinst_HEADERS = \
766         $(SHARK_COMMON_INCLUDES)        \
767         $(EXTCAP_COMMON_INCLUDES)       \
768         $(WIRESHARK_COMMON_INCLUDES)    \
769         capture_stop_conditions.h       \
770         conditions.h                    \
771         ringbuffer.h                    \
772         ws_diag_control.h               \
773         ws_version_info.h
774
775 #
776 # Build the version string
777 #
778 # FORCE is the portable version of .PHONY
779 FORCE:
780
781 version.h: FORCE
782         $(AM_V_PERL)$(PERL) $(srcdir)/make-version.pl $(srcdir)
783
784 #
785 # Build shell scripts by doing variable substitution.
786 # Taken from autoconf 2.13.
787 #
788 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
789
790 SUFFIXES = .sh
791 .sh:
792         rm -f $@ $@.tmp
793         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
794
795 services:
796         $(PYTHON) $(srcdir)/tools/make-services.py
797
798 CLEANFILES = \
799         *~              \
800         doxygen-core.tag        \
801         vgcore.*
802
803 #
804 # We have to remove version.h with "make distclean", as, otherwise,
805 # "make distcheck" fails.  We still need to make the tarballs work
806 # even if you do "make distclean" and try to rebuild; that's a work in
807 # progress.
808 #
809 # XXX - "ps.c" is distributed in the source tarballs; why is it in the
810 # list of files removed by "make distclean"?  (It's deliberately
811 # included in that list.)
812 #
813 DISTCLEANFILES = \
814         ps.c                    \
815         version.h
816
817 MAINTAINERCLEANFILES = \
818         $(GENERATED_FILES)      \
819         Makefile.in             \
820         aclocal.m4              \
821         compile                 \
822         config.h.in             \
823         configure               \
824         depcomp                 \
825         install-sh              \
826         ltmain.sh               \
827         missing                 \
828         ylwrap
829
830 EXTRA_DIST = \
831         .editorconfig           \
832         .mailmap                \
833         INSTALL.configure       \
834         Makefile.am.inc         \
835         README.aix              \
836         README.bsd              \
837         README.DECT             \
838         README.hpux             \
839         README.linux            \
840         README.macos            \
841         README.md               \
842         README.windows          \
843         abi-descriptor.template \
844         autogen.sh              \
845         cfilters                \
846         colorfilters            \
847         debian                  \
848         dfilters                \
849         doxygen_global.cfg      \
850         doxygen.cfg.in          \
851         enterprises.tsv         \
852         fix                     \
853         idl                     \
854         image                   \
855         ipmap.html              \
856         m4                      \
857         macosx-support-lib-patches      \
858         make-version.pl         \
859         manuf                   \
860         manuf.tmpl              \
861         pdml2html.xsl           \
862         smi_modules             \
863         text2pcap-scanner.l     \
864         text2pcap.h             \
865         services                \
866         wireshark.desktop       \
867         wireshark-gtk.desktop   \
868         wireshark-mime-package.xml      \
869         wireshark.appdata.xml   \
870         wireshark.pc.in         \
871         wka                     \
872         CMakeLists.txt          \
873         CMakeListsCustom.txt.example    \
874         cmakeconfig.h.in        \
875         CMakeOptions.txt        \
876         ConfigureChecks.cmake   \
877         cmake
878
879 install-exec-hook:
880 if HAVE_DUMPCAP_GROUP
881         chgrp $(DUMPCAP_GROUP) $(DESTDIR)$(bindir)/dumpcap
882 endif
883 if SETCAP_INSTALL
884         $(SETCAP) cap_net_raw,cap_net_admin+ep $(DESTDIR)$(bindir)/dumpcap
885         chmod o-rws $(DESTDIR)$(bindir)/dumpcap
886 else
887 if SETUID_INSTALL
888         chmod o-rws $(DESTDIR)$(bindir)/dumpcap
889         chmod +s $(DESTDIR)$(bindir)/dumpcap
890 endif
891 endif
892
893
894 DIST_SUBDIRS = \
895         capchild        \
896         caputils        \
897         codecs          \
898         doc             \
899         epan            \
900         ui              \
901         ui/cli          \
902         ui/gtk          \
903         ui/qt           \
904         help            \
905         packaging       \
906         plugins         \
907         randpkt_core    \
908         tools           \
909         wiretap         \
910         writecap        \
911         wsutil          \
912         extcap          \
913         docbook
914
915 SUBDIRS = \
916         tools                   \
917         wsutil                  \
918         writecap                \
919         wiretap                 \
920         epan                    \
921         capchild                \
922         caputils                \
923         @plugins_dir@           \
924         packaging               \
925         help                    \
926         ui                      \
927         codecs                  \
928         @wireshark_SUBDIRS@     \
929         ui/cli                  \
930         randpkt_core            \
931         @extcap_subdir@         \
932         .                       \
933         doc
934
935 help/faq.txt: $(srcdir)/help/faq.py
936         $(AM_V_GEN)(cd help ; \
937         $(MAKE) faq.txt ;)
938
939 libtool: $(LIBTOOL_DEPS)
940         $(SHELL) ./config.status --recheck
941
942
943 #
944 # Install icons and other desktop files for (for use with GNOME, KDE, or
945 # any other freedesktop.org-compliant desktops).
946 #
947 # We use $(datadir).  If the desktop doesn't look for them there,
948 # the desktop is broken; the latest XDG Base Directory Specification
949 # at
950 #
951 #    http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
952 #
953 # says
954 #
955 # $XDG_DATA_DIRS defines the preference-ordered set of base directories
956 # to search for data files in addition to the $XDG_DATA_HOME base
957 # directory. The directories in $XDG_DATA_DIRS should be seperated with a
958 # colon ':'.
959 #
960 # If $XDG_DATA_DIRS is either not set or empty, a value equal to
961 # /usr/local/share/:/usr/share/ should be used.
962 #
963 # so:
964 #
965 #    if this is configured to install under /usr, that should Just Work,
966 #    unless XDG_DATA_DIRS is set incorrectly or the desktop isn't
967 #    compliant with the latest version of the spec;
968 #
969 #    if this installs under the default /usr/share, that should Just Work,
970 #    unless XDG_DATA_DIRS is set incorrectly or the desktop isn't
971 #    compliant with the latest version of the spec;
972 #
973 #    if this is configured to install somewhere else, whoever configured
974 #    it should also have made sure that XDG_DATA_DIRS was set correctly
975 #    and, if that doesn't work, the desktop isn't compliant with the
976 #    latest version of the spec.
977 #
978 # We install these as part of the standard installation process, just
979 # as, for example, Inkscape does with its icons.  See bug 10737.
980 #
981 # Do not use the -T flag to the install command, as it's not portable.
982 # Some versions of install don't support a -T flag at all, and the
983 # FreeBSD install command has a -T flag that takes an argument and
984 # that has completely different semantics.
985 #
986 # We neither need nor want any of this on macOS, nor do we want it if
987 # we're not building Wireshark (that being the only desktop app).
988 #
989 install-data-local:
990 if BUILDING_WIRESHARK
991 if NOT_MACOS
992         mkdir -p $(DESTDIR)$(datadir)/mime/packages
993         install -m 644 $(srcdir)/wireshark-mime-package.xml $(DESTDIR)$(datadir)/mime/packages/wireshark.xml
994         mkdir -p $(DESTDIR)$(datadir)/appdata
995         install -m 644 $(srcdir)/wireshark.appdata.xml $(DESTDIR)$(datadir)/appdata/wireshark.appdata.xml
996         mkdir -p $(DESTDIR)$(datadir)/applications
997         if test x$(DESKTOP_FILE_INSTALL) != x ; then \
998                 $(DESKTOP_FILE_INSTALL) --dir $(DESTDIR)$(datadir)/applications $(srcdir)/wireshark.desktop  $(srcdir)/wireshark-gtk.desktop ; \
999         else \
1000                 install -m 644 $(srcdir)/wireshark.desktop $(srcdir)/wireshark-gtk.desktop $(DESTDIR)$(datadir)/applications; \
1001         fi
1002         for size in 16 24 32 48 64 128 256; \
1003         do \
1004                 mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps ; \
1005                 install -m 644 $(srcdir)/image/wsicon$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
1006                 mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes ; \
1007                 install -m 644 $(srcdir)/image/WiresharkDoc-$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
1008         done
1009         mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps
1010         install -m 644 $(srcdir)/image/wsicon.svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/wireshark.svg
1011 endif
1012 endif
1013
1014 uninstall-local:
1015 if BUILDING_WIRESHARK
1016 if NOT_MACOS
1017         rm -f $(DESTDIR)$(datadir)/appdata/wireshark.appdata.xml
1018         rm -f $(DESTDIR)$(datadir)/applications/wireshark.desktop
1019         rm -f $(DESTDIR)$(datadir)/applications/wireshark-gtk.desktop
1020         rm -f $(DESTDIR)$(datadir)/mime/packages/wireshark.xml
1021         for size in 16 24 32 48 64 128 256; \
1022         do \
1023                 rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
1024                 rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
1025         done
1026         rm -f $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/wireshark.svg
1027 endif
1028 endif
1029
1030 install-data-hook: update-databases-and-caches-install
1031 uninstall-hook: update-databases-and-caches-uninstall
1032
1033 #
1034 # XXX - which of this stuff can, and should, we do ourselves?
1035 #
1036 # If we're "installing" under $(DESTDIR) as part of the process of
1037 # building a package, we probably don't need to, and shouldn't, do
1038 # any of this.
1039 #
1040 # If we're installing for use, we may need to do some of this; which
1041 # of them do we need to tell where to search, especially if we're
1042 # installing somewhere other than under /usr or /usr/local?
1043 #
1044 # What if we're installing in the user's home directory?
1045 #
1046 # What if we're installing under /opt?
1047 #
1048 # We only need to run ldconfig on systems where it's necessary in order
1049 # to update a shared library cache to know about our shared libraries.
1050 #
1051 # We only need to run update-desktop-database and update-mime-database
1052 # on freedesktop.org desktops.
1053 #
1054 # We only need to run gtk-update-icon-cache if we're installing a GTK+
1055 # version of Wireshark.
1056 #
1057 # We neither need nor want any of this on macOS, nor do we want it if
1058 # we're not building Wireshark (that being the only desktop app).
1059 #
1060 update-databases-and-caches-common:
1061 if BUILDING_WIRESHARK
1062 if NOT_MACOS
1063         @echo "You may need to run \"ldconfig\" as root"
1064         @echo "You may need to run \"update-desktop-database $(datadir)/applications\""
1065         @echo "You may need to run \"update-mime-database $(datadir)/mime\""
1066         @echo "You may need to run \"gtk-update-icon-cache -f -t $(datadir)/icons/hicolor\""
1067 endif
1068 endif
1069
1070 update-databases-and-caches-install: update-databases-and-caches-common
1071
1072 update-databases-and-caches-uninstall: update-databases-and-caches-common
1073
1074 # Used by svr4-package and osx-package
1075 # We load top_stagedir with an absolute path so that libtool doesn't freak.
1076 top_stagedir=$(abs_top_builddir)/packaging/staging
1077 stagedir=$(top_stagedir)/$(PACKAGE).inst
1078
1079 host_cpu=@host_cpu@
1080 host_os=@host_os@
1081
1082 solaris-package: svr4-package
1083
1084 svr4-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
1085         @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
1086                 rm -rf $(stagedir) ; \
1087                 $(MAKE) DESTDIR=$(stagedir) install; \
1088                 $(srcdir)/packaging/svr4/mkpkg \
1089                         $(PACKAGE) \
1090                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
1091                         $(prefix) \
1092                         $(top_stagedir) ; \
1093         else \
1094                 echo "Error: SVR4 packaging tools not found." ; \
1095                 echo "Package build abandoned." ; \
1096         fi
1097
1098
1099 rpm_topdir=`cd $(top_builddir) && pwd`/packaging/rpm
1100 if HAVE_RPM
1101 rpm-package: dist
1102         @cd $(rpm_topdir) && \
1103           mkdir -p BUILD RPMS SOURCES SRPMS && \
1104           cd SOURCES && \
1105           ln -sf ../../../$(distdir).tar.xz && \
1106           cd .. && \
1107           $(RPMBUILD) --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" \
1108                 @RPMBUILD_WITH_ARGS@ --clean -ba SPECS/wireshark.spec && \
1109           echo "Package successfully built in `pwd`/RPMS." ; \
1110           rm -f SOURCES/$(distdir).tar.xz ../../$(distdir).tar.xz
1111 else
1112 rpm-package:
1113         @echo "'rpmbuild' executable not available." ; \
1114           false
1115 endif
1116
1117 # XXX - This assumes we're building from the source directory.
1118 osx-app: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) packaging/macosx/Info.plist
1119         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1120                 rm -rf $(stagedir) ; \
1121                 $(MAKE) DESTDIR=$(stagedir) install; \
1122                 cd $(srcdir)/packaging/macosx ; \
1123                 ./osx-app.sh @OSX_APP_FLAGS@ \
1124                         --create-bundle \
1125                         --binary-path ../staging/$(PACKAGE).inst$(bindir) \
1126                         --plugin-path ../staging/$(PACKAGE).inst$(plugindir) \
1127                         --extcap-path ../staging/$(PACKAGE).inst$(extcapdir) \
1128                         --library-path ../staging/$(PACKAGE).inst$(libdir) ; \
1129         else \
1130                 echo "Error: macOS packaging tools not found." ; \
1131                 echo "Package build abandoned." ; \
1132         fi
1133
1134 packaging/macosx/COPYING.txt: COPYING
1135         (cd packaging/macosx ; \
1136         $(MAKE) COPYING.txt ;)
1137
1138 osx-package: osx-app packaging/macosx/COPYING.txt
1139         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1140                 cd $(srcdir)/packaging/macosx ; \
1141                 chmod +x ./osx-dmg.sh ; \
1142                 ./osx-dmg.sh @OSX_DMG_FLAGS@ ; \
1143         fi
1144
1145 osx-install: osx-app
1146         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1147                 echo "Copying Wireshark.app to /Applications" ; \
1148                 cp -pr $(srcdir)/packaging/macosx/Wireshark.app /Applications ; \
1149         fi
1150
1151 test-programs:
1152         cd epan && $(MAKE) $@
1153
1154 clean-local:
1155         rm -rf $(top_stagedir)
1156
1157 dumpabi:
1158         $(MAKE) -C wiretap dumpabi-libwiretap
1159         $(MAKE) -C epan dumpabi-libwireshark
1160         $(MAKE) -C wsutil dumpabi-libwsutil
1161
1162 checkapi_local:
1163         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -build \
1164         -sourcedir=$(srcdir) \
1165         $(TSHARK_TAP_SRC) \
1166         $(wireshark_gtk_SOURCES)
1167 #       $(EXTRA_wireshark_gtk_SOURCES)
1168
1169 checkapi: checkapi_local
1170         cd wiretap && $(MAKE) checkapi
1171         cd codecs && $(MAKE) checkapi
1172         cd capchild && $(MAKE) checkapi
1173         cd caputils && $(MAKE) checkapi
1174         cd ui && $(MAKE) checkapi
1175         cd ui/gtk && $(MAKE) checkapi
1176         cd ui/cli && $(MAKE) checkapi
1177         cd epan && $(MAKE) checkapi
1178         cd epan/crypt && $(MAKE) checkapi
1179         cd epan/dfilter && $(MAKE) checkapi
1180         cd epan/ftypes && $(MAKE) checkapi
1181         cd epan/wmem && $(MAKE) checkapi
1182         cd epan/wslua && $(MAKE) checkapi
1183         cd epan/dissectors && $(MAKE) checkapi
1184         cd plugins && $(MAKE) checkapi
1185         cd randpkt_core && $(MAKE) checkapi
1186         cd writecap && $(MAKE) checkapi
1187         cd wsutil && $(MAKE) checkapi
1188
1189 if HAVE_SHELLCHECK
1190 # --external-sources requires 0.4.0 or later.
1191 shellcheck:
1192         cd $(top_srcdir) && \
1193         shellcheck --external-sources \
1194           tools/fuzz-test.sh \
1195           tools/randpkt-test.sh \
1196           tools/runa2x.sh \
1197           tools/test-captures.sh \
1198           tools/valgrind-wireshark.sh
1199 else
1200 shellcheck:
1201         @echo "Shellcheck not available." ; \
1202           false
1203 endif
1204
1205 wsar_html: doxygen.cfg doxygen_global.cfg FORCE
1206 if HAVE_DOXYGEN
1207         rm -rf wsar_html
1208         cd epan && $(MAKE) $@
1209         cd capchild && $(MAKE) $@
1210         cd caputils && $(MAKE) $@
1211         cd randpkt_core && $(MAKE) $@
1212         cd ui && $(MAKE) $@
1213         (umask 022 ; $(DOXYGEN) doxygen.cfg)
1214 endif
1215
1216 wsar-zip: wsar_html
1217 if HAVE_DOXYGEN
1218         rm -f wsar_html.zip
1219         zip -rq wsar_html.zip wsar_html
1220 endif
1221
1222 # Update AUTHORS file with entries from git shortlog
1223 gen-authors:
1224         cd $(top_srcdir) && $(PERL) tools/generate_authors.pl AUTHORS.src > AUTHORS
1225
1226 dist-hook:
1227         printf "git_description=%s\n" "$$(git -C $(top_srcdir) describe --match 'v[1-9]*')" \
1228                 > $(top_distdir)/version.conf