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