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