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