MSWSP: append to proto column instaed of overwriting it
[wireshark-wip.git] / plugins / wimaxasncp / Makefile.nmake
blob1f3008c3cfc155ed515d6a8fa166153b2ffeabf2
1 # Makefile.nmake
2 # nmake file for wimaxasncp plugin
4 # $Id$
7 include ..\..\config.nmake
8 include ..\..\Makefile.nmake.inc
10 include moduleinfo.nmake
12 include Makefile.common
14 # We use DIRTY_CFLAGS to get around flex's non-LLP64-compliant output
15 DIRTY_CFLAGS=\
16         $(STANDARD_CFLAGS) \
17         /I../.. $(GLIB_CFLAGS) /I$(LEMON) \
18         /I$(PCAP_DIR)\include
20 CFLAGS=$(WARNINGS_ARE_ERRORS) $(DIRTY_CFLAGS)
22 .c.obj::
23         $(CC) $(CFLAGS) -Fd.\ -c $<
25 LDFLAGS = $(PLUGIN_LDFLAGS)
27 !IFDEF ENABLE_LIBWIRESHARK
28 LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib ..\..\wsutil\libwsutil.lib
29 CFLAGS=$(CFLAGS)
31 OBJECTS = $(C_FILES:.c=.obj) $(CPP_FILES:.cpp=.obj) plugin.obj
33 RESOURCE=$(PLUGIN_NAME).res
35 all: $(PLUGIN_NAME).dll
37 $(PLUGIN_NAME).rc : moduleinfo.nmake
38         sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
39         -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
40         -e s/@RC_VERSION@/$(RC_VERSION)/ \
41         -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
42         -e s/@PACKAGE@/$(PACKAGE)/ \
43         -e s/@VERSION@/$(VERSION)/ \
44         -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \
45         < plugin.rc.in > $@
47 $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
48         link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
49         $(GLIB_LIBS) $(RESOURCE)
52 # Build plugin.c, which contains the plugin version[] string, a
53 # function plugin_register() that calls the register routines for all
54 # protocols, and a function plugin_reg_handoff() that calls the handoff
55 # registration routines for all protocols.
57 # We do this by scanning sources.  If that turns out to be too slow,
58 # maybe we could just require every .o file to have an register routine
59 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
61 # Formatting conventions:  The name of the proto_register_* routines an
62 # proto_reg_handoff_* routines must start in column zero, or must be
63 # preceded only by "void " starting in column zero, and must not be
64 # inside #if.
66 # REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
68 # For some unknown reason, having a big "for" loop in the Makefile
69 # to scan all the files doesn't work with some "make"s; they seem to
70 # pass only the first few names in the list to the shell, for some
71 # reason.
73 # Therefore, we have a script to generate the plugin.c file.
74 # The shell script runs slowly, as multiple greps and seds are run
75 # for each input file; this is especially slow on Windows.  Therefore,
76 # if Python is present (as indicated by PYTHON being defined), we run
77 # a faster Python script to do that work instead.
79 # The first argument is the directory in which the source files live.
80 # The second argument is "plugin", to indicate that we should build
81 # a plugin.c file for a plugin.
82 # All subsequent arguments are the files to scan.
84 !IFDEF PYTHON
85 plugin.c: $(REGISTER_SRC_FILES) moduleinfo.h Makefile.common ../../tools/make-dissector-reg.py
86         @echo Making plugin.c (using python)
87         @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(REGISTER_SRC_FILES) $(NODIST_REGISTER_SRC_FILES)
88 !ELSE
89 plugin.c: $(REGISTER_SRC_FILES) moduleinfo.h Makefile.common ../../tools/make-dissector-reg
90         @echo Making plugin.c (using sh)
91         @$(SH) ../../tools/make-dissector-reg . plugin $(REGISTER_SRC_FILES) $(NODIST_REGISTER_SRC_FILES)
92 !ENDIF
94 !ENDIF
96 clean:
97         rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb *.sbr \
98             $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \
99             $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc
102 # We remove the Flex-generated files with "distclean" because files
103 # generated by Flex need different #includes for UN*X and Windows (UN*X
104 # versions of Flex make it include <unistd.h>, but that's a UN*X-only
105 # header), so if you're going to build from source, you need to re-generate
106 # the files from the distribution that were generated by Flex.
108 distclean: clean
109         rm -f $(FLEX_GENERATED_SRC_FILES) \
110                 $(FLEX_GENERATED_HEADER_FILES)
112 maintainer-clean: distclean
113         rm -f $(GENERATED_SRC_FILES) \
114                 $(GENERATED_HEADER_FILES)
116 RUNLEX = ..\..\tools\runlex.sh
119 # In order to generate wimaxasncp_dict_lex.h, we need to run Flex on
120 # wimaxasncp_dict.l; that's done by generating wimaxasncp_dict.c.
122 wimaxasncp_dict_lex.h : wimaxasncp_dict.c
125 # We compile this specially because it's Flex-generated and thus
126 # "warnings are errors" will fail because there's a bunch of
127 # warnings we can't eliminate.
129 wimaxasncp_dict.obj :   wimaxasncp_dict.c
130         $(CC) $(DIRTY_CFLAGS) -Fd.\ -c $?
132 checkapi:
133         $(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput -build \
134                 $(CLEAN_SRC_FILES) $(CLEAN_HEADER_FILES)