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