Remove obsolete comments regarding the shell version of make-dissector-reg
[metze/wireshark/wip.git] / epan / dissectors / Makefile.am
1 # Makefile.am
2 #
3 # Wireshark - Network traffic analyzer
4 # By Gerald Combs <gerald@wireshark.org>
5 # Copyright 2004 Gerald Combs
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 noinst_LTLIBRARIES = libdirtydissectors.la libfiledissectors.la libdissectors.la
22
23 AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. \
24         $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
25
26 include Makefile.common
27
28 libdirtydissectors_la_SOURCES = \
29         $(DIRTY_DISSECTOR_SRC)          \
30         $(DIRTY_ASN1_DISSECTOR_SRC)     \
31         $(DIRTY_PIDL_DISSECTOR_SRC)
32
33 if HAVE_WARNINGS_AS_ERRORS
34 AM_CLEAN_CFLAGS = -Werror
35 endif
36
37 libfiledissectors_la_SOURCES = \
38         $(FILE_DISSECTOR_SRC)
39
40 libdissectors_la_SOURCES = \
41         $(DISSECTOR_SRC) \
42         $(ASN1_DISSECTOR_SRC) \
43         $(PIDL_DISSECTOR_SRC) \
44         $(DISSECTOR_SUPPORT_SRC)
45 libdissectors_la_CFLAGS = $(AM_CLEAN_CFLAGS)
46
47 # include dceprc and pidl in the source tarball. But nothing to build...
48 DIST_SUBDIRS = dcerpc pidl
49
50 EXTRA_DIST = \
51         Custom.common           \
52         Makefile.common         \
53         Makefile.nmake          \
54         packet-ncp2222.inc      \
55         README.X11              \
56         x11-fields
57
58 packet-ncp2222.c : $(top_srcdir)/tools/ncp2222.py
59         $(PYTHON) $< -o $@
60
61 # Target to rebuild the X11 dissector header files.
62 # See README.X11 before using this--it requires the xcb and mesa source.
63 x11-dissector: $(top_srcdir)/tools/process-x11-fields.pl x11-fields $(top_srcdir)/tools/process-x11-xcb.pl
64         $(PERL) $(top_srcdir)/tools/process-x11-fields.pl < x11-fields
65         $(PERL) $(top_srcdir)/tools/process-x11-xcb.pl
66
67 #
68 # Build register.c, which contains a function register_all_protocols()
69 # that calls the register routines for all protocols and a function
70 # register_all_protocol_handoffs() that calls the handoff registration
71 # routines for all protocols.
72 #
73 # We do this by scanning through sources. If that turns out to be too slow,
74 # maybe we could just require every .o file to have an register routine
75 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
76 #
77 # Formatting conventions: The name of the proto_register_* routines an
78 # proto_reg_handoff_* routines must start in column zero, or must be
79 # preceded only by "void " starting in column zero, and must not be
80 # inside #if.
81 #
82 # ALL_DISSECTORS_SRC is assumed to have all the files that need to be scanned.
83 #
84 # For some unknown reason, having a big "for" loop in the Makefile
85 # to scan all the files doesn't work with some "make"s; they seem to
86 # pass only the first few names in the list to the shell, for some
87 # reason.
88 #
89 # Therefore, we use a script to generate the register.c file.
90 # The first argument is the directory in which the source files live.
91 # The second argument is "dissectors", to indicate that we should build
92 # a register.c file for libwireshark.
93 # All subsequent arguments are the files to scan.
94 #
95 register.c: $(plugin_src) $(ALL_DISSECTORS_SRC) Makefile.common Custom.common \
96         $(top_srcdir)/tools/make-dissector-reg.py
97         @echo Making register.c ; \
98         $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
99                 dissectors $(ALL_DISSECTORS_SRC) ;
100 #
101 # Currently register.c can be included in the distribution because
102 # we always build all protocol dissectors. We used to have to check
103 # whether or not to build the snmp dissector. If we again need to
104 # variably build something, making register.c non-portable, uncomment
105 # the dist-hook line below.
106 #
107 # Oh, yuk. We don't want to include "register.c" in the distribution, as
108 # its contents depend on the configuration, and therefore we want it
109 # to be built when the first "make" is done; however, Automake insists
110 # on putting *all* source into the distribution.
111 #
112 # We work around this by having a "dist-hook" rule that deletes
113 # "register.c", so that "dist" won't pick it up.
114 #
115 #dist-hook:
116 #       @rm -f $(distdir)/register.c
117
118 # XXX - We may want to add register-cache.pkl to the distribution at
119 # some point. It should be portable across architectures.
120 CLEANFILES = \
121         libdissectors.a                 \
122         libdissectors.la                \
123         libdirtydissectors.a            \
124         libdirtydissectors.la           \
125         register.c-tmp                  \
126         register-cache.pkl              \
127         $(GENERATED_HEADER_FILES)       \
128         *~
129
130 MAINTAINERCLEANFILES =  \
131         $(GENERATED_FILES)      \
132         Makefile.in
133
134 checkapi:
135         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \
136         -sourcedir=$(srcdir) \
137         $(ALL_DISSECTORS_SRC) $(DISSECTOR_INCLUDES) $(DISSECTOR_SUPPORT_SRC)