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