Move dissectors to epan/dissectors directory.
[obnox/wireshark/wip.git] / epan / dissectors / Makefile.am
1 # Makefile.am
2 #
3 # $Id$
4 #
5 # Ethereal - Network traffic analyzer
6 # By Gerald Combs <gerald@zing.org>
7 # Copyright 2004 Gerald Combs
8 #
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 noinst_LTLIBRARIES = libdissectors.la
25
26 CLEANFILES = \
27         libdissectors.a         \
28         libdissectors.la        \
29         *~
30
31 INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/..
32
33 include Makefile.common
34
35 libdissectors_la_SOURCES = \
36         $(DISSECTOR_SRC) \
37         $(DISSECTOR_SUPPORT_SRC)
38
39 EXTRA_DIST = \
40         Makefile.nmake          
41
42 packet-ncp2222.c : $(srcdir)/ncp2222.py
43         $(PYTHON) $< -o $@
44
45 #
46 # Build various header files for the X11 dissector.
47 #
48 PROC_X11_FIELDS := $(srcdir)/process-x11-fields.pl
49 X11_FIELDS := $(srcdir)/x11-fields
50
51 x11-declarations.h x11-register-info.h: $(PROC_X11_FIELDS) $(X11_FIELDS)
52         $(PERL) $(PROC_X11_FIELDS) < $(X11_FIELDS)
53
54 #
55 # Build "register.c", which contains a function "register_all_protocols()"
56 # that calls the register routines for all protocols.
57 #
58 # We do this by grepping through sources.  If that turns out to be too slow,
59 # maybe we could just require every .o file to have an register routine
60 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
61 #
62 # Formatting conventions:  The name of the proto_register_* routines must
63 # start in column zero, or must be preceded only by "void " starting in
64 # column zero, and must not be inside #if.
65 #
66 # We assume that all dissector routines are in "packet-XXX.c" files.
67 #
68 # For some unknown reason, having a big "for" loop in the Makefile
69 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
70 # they seem to pass only the first few names in the list to the shell,
71 # for some reason.
72 #
73 # Therefore, we have a script to generate the "register.c" file.
74 #
75 # The first argument is the name of the file to write.
76 # The second argument is the directory in which the source files live.
77 # All subsequent arguments are the files to scan.
78 #
79 register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc $(srcdir)/make-reg-dotc.py
80         @if test -n $(PYTHON); then \
81                 echo Making register.c with python ; \
82                 $(PYTHON) $(srcdir)/make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
83         else \
84                 echo Making register.c with shell script ; \
85                 $(srcdir)/make-reg-dotc register.c $(srcdir) \
86                         $(plugin_src) $(DISSECTOR_SRC) ; \
87         fi
88
89 #
90 # Currently register.c can be included in the distribution because
91 # we always build all protocol dissectors. We used to have to check
92 # whether or not to build the snmp dissector. If we again need to
93 # variably build something, making register.c non-portable, uncomment
94 # the dist-hook line below.
95 #
96 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
97 # its contents depend on the configuration, and therefore we want it
98 # to be built when the first "make" is done; however, Automake insists
99 # on putting *all* source into the distribution.
100 #
101 # We work around this by having a "dist-hook" rule that deletes
102 # "register.c", so that "dist" won't pick it up.
103 #
104 #dist-hook:
105 #       @rm -f $(distdir)/register.c
106
107
108 MAINTAINERCLEANFILES =  \
109         register.c      \
110         packet-ncp2222.c
111
112 CLEANFILES = \
113         libdissectors.a         \
114         libdissectors.la        \
115         x11-declarations.h      \
116         x11-register-info.h     \
117         *~