Add the source files for the swift library.
[swifty.git] / src / libswift / doc / wireshark-dissector / Makefile.am
1 # Makefile.am
2 # Automake file for swift plugin
3 # By Andrew Keating <andrewzkeating@gmail.com>
4 # Copyright 2011 Andrew Keating
5 #
6 # $Id$
7 #
8 # Wireshark - Network traffic analyzer
9 # By Gerald Combs <gerald@wireshark.org>
10 # Copyright 1998 Gerald Combs
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License
14 # as published by the Free Software Foundation; either version 2
15 # of the License, or (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25 #
26
27 INCLUDES = -I$(top_srcdir) -I$(includedir)
28
29 include Makefile.common
30
31 if HAVE_WARNINGS_AS_ERRORS
32 AM_CFLAGS = -Werror
33 endif
34
35 plugindir = @plugindir@
36
37 plugin_LTLIBRARIES = swift.la
38 swift_la_SOURCES = \
39         plugin.c \
40         moduleinfo.h \
41         $(DISSECTOR_SRC) \
42         $(DISSECTOR_SUPPORT_SRC) \
43         $(DISSECTOR_INCLUDES)
44 swift_la_LDFLAGS = -module -avoid-version
45 swift_la_LIBADD = @PLUGIN_LIBS@
46
47 # Libs must be cleared, or else libtool won't create a shared module.
48 # If your module needs to be linked against any particular libraries,
49 # add them here.
50 LIBS =
51
52 #
53 # Build plugin.c, which contains the plugin version[] string, a
54 # function plugin_register() that calls the register routines for all
55 # protocols, and a function plugin_reg_handoff() that calls the handoff
56 # registration routines for all protocols.
57 #
58 # We do this by scanning sources.  If that turns out to be too slow,
59 # maybe we could just require every .o file to have an register routine
60 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
61 #
62 # Formatting conventions:  The name of the proto_register_* routines an
63 # proto_reg_handoff_* routines must start in column zero, or must be
64 # preceded only by "void " starting in column zero, and must not be
65 # inside #if.
66 #
67 # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
68 #
69 # For some unknown reason, having a big "for" loop in the Makefile
70 # to scan all the files doesn't work with some "make"s; they seem to
71 # pass only the first few names in the list to the shell, for some
72 # reason.
73 #
74 # Therefore, we have a script to generate the plugin.c file.
75 # The shell script runs slowly, as multiple greps and seds are run
76 # for each input file; this is especially slow on Windows.  Therefore,
77 # if Python is present (as indicated by PYTHON being defined), we run
78 # a faster Python script to do that work instead.
79 #
80 # The first argument is the directory in which the source files live.
81 # The second argument is "plugin", to indicate that we should build
82 # a plugin.c file for a plugin.
83 # All subsequent arguments are the files to scan.
84 #
85 plugin.c: $(DISSECTOR_SRC) $(top_srcdir)/tools/make-dissector-reg \
86     $(top_srcdir)/tools/make-dissector-reg.py
87         @if test -n "$(PYTHON)"; then \
88                 echo Making plugin.c with python ; \
89                 $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
90                     plugin $(DISSECTOR_SRC) ; \
91         else \
92                 echo Making plugin.c with shell script ; \
93                 $(top_srcdir)/tools/make-dissector-reg $(srcdir) \
94                     $(plugin_src) plugin $(DISSECTOR_SRC) ; \
95         fi
96
97 #
98 # Currently plugin.c can be included in the distribution because
99 # we always build all protocol dissectors. We used to have to check
100 # whether or not to build the snmp dissector. If we again need to
101 # variably build something, making plugin.c non-portable, uncomment
102 # the dist-hook line below.
103 #
104 # Oh, yuk.  We don't want to include "plugin.c" in the distribution, as
105 # its contents depend on the configuration, and therefore we want it
106 # to be built when the first "make" is done; however, Automake insists
107 # on putting *all* source into the distribution.
108 #
109 # We work around this by having a "dist-hook" rule that deletes
110 # "plugin.c", so that "dist" won't pick it up.
111 #
112 #dist-hook:
113 #       @rm -f $(distdir)/plugin.c
114
115 CLEANFILES = \
116         swift \
117         *~
118
119 MAINTAINERCLEANFILES = \
120         Makefile.in     \
121         plugin.c
122
123 EXTRA_DIST = \
124         Makefile.common         \
125         Makefile.nmake          \
126         moduleinfo.nmake        \
127         plugin.rc.in            \
128         CMakeLists.txt
129
130 checkapi:
131         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES)