Makefile.am revision c407dc5cd9bdc5668497f21b26b09d988ab439de
1# Makefile.am
2# Automake file for SPDY plugin
3#
4# $Id$
5#
6# Wireshark - Network traffic analyzer
7# By Gerald Combs <gerald@wireshark.org>
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
29if HAVE_WARNINGS_AS_ERRORS
30AM_CFLAGS = -Werror
31endif
32
33plugin_LTLIBRARIES = spdy.la
34spdy_la_SOURCES = \
35	plugin.c \
36	moduleinfo.h \
37	$(DISSECTOR_SRC) \
38	$(DISSECTOR_SUPPORT_SRC) \
39	$(DISSECTOR_INCLUDES)
40spdy_la_LDFLAGS = -module -avoid-version
41spdy_la_LIBADD = @PLUGIN_LIBS@
42
43# Libs must be cleared, or else libtool won't create a shared module.
44# If your module needs to be linked against any particular libraries,
45# add them here.
46LIBS =
47
48#
49# Build plugin.c, which contains the plugin version[] string, a
50# function plugin_register() that calls the register routines for all
51# protocols, and a function plugin_reg_handoff() that calls the handoff
52# registration routines for all protocols.
53#
54# We do this by scanning sources.  If that turns out to be too slow,
55# maybe we could just require every .o file to have an register routine
56# of a given name (packet-aarp.o -> proto_register_aarp, etc.).
57#
58# Formatting conventions:  The name of the proto_register_* routines an
59# proto_reg_handoff_* routines must start in column zero, or must be
60# preceded only by "void " starting in column zero, and must not be
61# inside #if.
62#
63# DISSECTOR_SRC is assumed to have all the files that need to be scanned.
64#
65# For some unknown reason, having a big "for" loop in the Makefile
66# to scan all the files doesn't work with some "make"s; they seem to
67# pass only the first few names in the list to the shell, for some
68# reason.
69#
70# Therefore, we have a script to generate the plugin.c file.
71# The shell script runs slowly, as multiple greps and seds are run
72# for each input file; this is especially slow on Windows.  Therefore,
73# if Python is present (as indicated by PYTHON being defined), we run
74# a faster Python script to do that work instead.
75#
76# The first argument is the directory in which the source files live.
77# The second argument is "plugin", to indicate that we should build
78# a plugin.c file for a plugin.
79# All subsequent arguments are the files to scan.
80#
81plugin.c: $(DISSECTOR_SRC) $(top_srcdir)/tools/make-dissector-reg \
82    $(top_srcdir)/tools/make-dissector-reg.py
83	@if test -n "$(PYTHON)"; then \
84		echo Making plugin.c with python ; \
85		$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
86		    plugin $(DISSECTOR_SRC) ; \
87	else \
88		echo Making plugin.c with shell script ; \
89		$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
90		    $(plugin_src) plugin $(DISSECTOR_SRC) ; \
91	fi
92
93#
94# Currently plugin.c can be included in the distribution because
95# we always build all protocol dissectors. We used to have to check
96# whether or not to build the snmp dissector. If we again need to
97# variably build something, making plugin.c non-portable, uncomment
98# the dist-hook line below.
99#
100# Oh, yuk.  We don't want to include "plugin.c" in the distribution, as
101# its contents depend on the configuration, and therefore we want it
102# to be built when the first "make" is done; however, Automake insists
103# on putting *all* source into the distribution.
104#
105# We work around this by having a "dist-hook" rule that deletes
106# "plugin.c", so that "dist" won't pick it up.
107#
108#dist-hook:
109#	@rm -f $(distdir)/plugin.c
110
111CLEANFILES = \
112	spdy \
113	*~
114
115MAINTAINERCLEANFILES = \
116	Makefile.in	\
117	plugin.c
118
119EXTRA_DIST = \
120	Makefile.common		\
121	Makefile.nmake		\
122	moduleinfo.nmake	\
123	plugin.rc.in
124
125checkapi:
126	$(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput $(DISSECTOR_SRC)
127