aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/codecs/Makefile.am.inc
blob: fb1b6d7770384a833a8841f7f1492f109b181de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Makefile.am.inc
# Include file with common automake definitions for codec plugins
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#

include $(top_srcdir)/plugins/Makefile.am.inc

#
# Build plugin.c, which contains the plugin_version[] and plugin_release[]
# string, and a function plugin_register() that calls the register routines
# for all codecs.
#
# We do this by scanning sources.  If that turns out to be too slow,
# maybe we could just require every .o file to have an register routine
# of a given name (packet-aarp.o -> proto_register_aarp, etc.).
#
# Formatting conventions:  The name of the codec_register_* routines must
# start in column zero, or must be preceded only by "void " starting in
# column zero, and must not be inside #if.
#
# REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
#
# For some unknown reason, having a big "for" loop in the Makefile
# to scan all the files doesn't work with some "make"s; they seem to
# pass only the first few names in the list to the shell, for some
# reason.
#
# Therefore, we use a script to generate the register.c file.
# The first argument is the directory in which the source files live.
# The second argument is "plugin_codec", to indicate that we should build
# a plugin.c file for a codec plugin.
# All subsequent arguments are the files to scan.
#
plugin.c: $(REGISTER_SRC_FILES) $(top_srcdir)/tools/make-plugin-reg.py
	@echo Making plugin.c
	@$(PYTHON) $(top_srcdir)/tools/make-plugin-reg.py $(srcdir) \
		plugin_codec $(REGISTER_SRC_FILES)