2 # nmake file for OpcUa plugin
7 include ..\..\config.nmake
8 include ..\..\Makefile.nmake.inc
10 include moduleinfo.nmake
12 include Makefile.common
14 CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \
15 /I../.. $(GLIB_CFLAGS) \
19 $(CC) $(CFLAGS) -Fd.\ -c $<
21 LDFLAGS = $(PLUGIN_LDFLAGS)
23 !IFDEF ENABLE_LIBWIRESHARK
24 LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
27 OBJECTS = $(C_FILES:.c=.obj) $(CPP_FILES:.cpp=.obj) plugin.obj
29 RESOURCE=$(PLUGIN_NAME).res
31 all: $(PLUGIN_NAME).dll
33 $(PLUGIN_NAME).rc : moduleinfo.nmake
34 sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
35 -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
36 -e s/@RC_VERSION@/$(RC_VERSION)/ \
37 -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
38 -e s/@PACKAGE@/$(PACKAGE)/ \
39 -e s/@VERSION@/$(VERSION)/ \
40 -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \
43 $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
44 link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
45 $(GLIB_LIBS) $(RESOURCE)
48 # Build plugin.c, which contains the plugin version[] string, a
49 # function plugin_register() that calls the register routines for all
50 # protocols, and a function plugin_reg_handoff() that calls the handoff
51 # registration routines for all protocols.
53 # We do this by scanning sources. If that turns out to be too slow,
54 # maybe we could just require every .o file to have an register routine
55 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
57 # Formatting conventions: The name of the proto_register_* routines an
58 # proto_reg_handoff_* routines must start in column zero, or must be
59 # preceded only by "void " starting in column zero, and must not be
62 # REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
64 # For some unknown reason, having a big "for" loop in the Makefile
65 # to scan all the files doesn't work with some "make"s; they seem to
66 # pass only the first few names in the list to the shell, for some
69 # Therefore, we have a script to generate the plugin.c file.
70 # The shell script runs slowly, as multiple greps and seds are run
71 # for each input file; this is especially slow on Windows. Therefore,
72 # if Python is present (as indicated by PYTHON being defined), we run
73 # a faster Python script to do that work instead.
75 # The first argument is the directory in which the source files live.
76 # The second argument is "plugin", to indicate that we should build
77 # a plugin.c file for a plugin.
78 # All subsequent arguments are the files to scan.
81 plugin.c: $(REGISTER_SRC_FILES) moduleinfo.h Makefile.common ../../tools/make-dissector-reg.py
82 @echo Making plugin.c (using python)
83 @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(REGISTER_SRC_FILES)
85 plugin.c: $(REGISTER_SRC_FILES) moduleinfo.h Makefile.common ../../tools/make-dissector-reg
86 @echo Making plugin.c (using sh)
87 @$(SH) ../../tools/make-dissector-reg . plugin $(REGISTER_SRC_FILES)
93 rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb *.sbr \
94 $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \
95 $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc
99 maintainer-clean: distclean
102 $(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput -build \
103 $(CLEAN_SRC_FILES) $(CLEAN_HEADER_FILES)