Include "Makefile.common" in the list of files to put into the
[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@ethereal.com>
7 # Copyright 2004 Gerald Combs
8
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 noinst_LTLIBRARIES = libdissectors.la
24
25 INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/..
26
27 include Makefile.common
28
29 libdissectors_la_SOURCES = \
30         $(DISSECTOR_SRC) \
31         $(DISSECTOR_SUPPORT_SRC)
32
33 EXTRA_DIST = \
34         Makefile.common         \
35         Makefile.nmake          \
36         make-reg-dotc           \
37         make-reg-dotc.py        \
38         ncp2222.py              \
39         packet-ncp2222.inc      \
40         process-x11-fields.pl   \
41         x11-fields
42
43 packet-ncp2222.c : $(srcdir)/ncp2222.py
44         $(PYTHON) $< -o $@
45
46 #
47 # Build various header files for the X11 dissector.
48 #
49 PROC_X11_FIELDS = $(srcdir)/process-x11-fields.pl
50 X11_FIELDS = $(srcdir)/x11-fields
51
52 x11-declarations.h x11-register-info.h: $(PROC_X11_FIELDS) $(X11_FIELDS)
53         $(PERL) $(PROC_X11_FIELDS) < $(X11_FIELDS)
54
55 #
56 # Build "register.c", which contains a function "register_all_protocols()"
57 # that calls the register routines for all protocols.
58 #
59 # We do this by grepping through sources.  If that turns out to be too slow,
60 # maybe we could just require every .o file to have an register routine
61 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
62 #
63 # Formatting conventions:  The name of the proto_register_* routines must
64 # start in column zero, or must be preceded only by "void " starting in
65 # column zero, and must not be inside #if.
66 #
67 # We assume that all dissector routines are in "packet-XXX.c" files.
68 #
69 # For some unknown reason, having a big "for" loop in the Makefile
70 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
71 # they seem to pass only the first few names in the list to the shell,
72 # for some reason.
73 #
74 # Therefore, we have a script to generate the "register.c" file.
75 #
76 # The first argument is the name of the file to write.
77 # The second argument is the directory in which the source files live.
78 # All subsequent arguments are the files to scan.
79 #
80 register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc $(srcdir)/make-reg-dotc.py
81         @if test -n $(PYTHON); then \
82                 echo Making register.c with python ; \
83                 $(PYTHON) $(srcdir)/make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
84         else \
85                 echo Making register.c with shell script ; \
86                 $(srcdir)/make-reg-dotc register.c $(srcdir) \
87                         $(plugin_src) $(DISSECTOR_SRC) ; \
88         fi
89
90 #
91 # Currently register.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 register.c non-portable, uncomment
95 # the dist-hook line below.
96 #
97 # Oh, yuk.  We don't want to include "register.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 # "register.c", so that "dist" won't pick it up.
104 #
105 #dist-hook:
106 #       @rm -f $(distdir)/register.c
107
108
109 MAINTAINERCLEANFILES =  \
110         register.c      \
111         packet-ncp2222.c
112
113 CLEANFILES = \
114         libdissectors.a         \
115         libdissectors.la        \
116         $(GENERATED_HEADER_FILES)       \
117         *~