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