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