1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
6 include ..\config.nmake
8 include ..\Makefile.nmake.inc
10 include Makefile.common
14 # We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
17 /I. /I.. /I../wiretap $(GLIB_CFLAGS) \
18 $(ZLIB_CFLAGS) $(C_ARES_CFLAGS) $(ADNS_CFLAGS) \
19 $(LUA_CFLAGS) $(GNUTLS_CFLAGS) /I$(PCAP_DIR)\include \
20 $(PYTHON_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS)
22 CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)
25 WSLUA_LIB=wslua\wslua.lib
33 WSPYTHON_LIB=wspython\wspython.lib
40 # For use when making libwireshark.dll
53 ..\wsutil\libwsutil.lib \
54 ..\wiretap\wiretap-$(WTAP_VERSION).lib \
60 dissectors\dissectors.lib
63 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
65 LIBWIRESHARK_OBJECTS = $(LIBWIRESHARK_ALL_SRC:.c=.obj)
68 !IF defined(NASM) && "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
69 asm_utils_win32_x86.obj
78 !IFDEF ENABLE_LIBWIRESHARK
79 all: crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors libwireshark.dll
81 all: crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors libwireshark.lib
84 # For use when making libwireshark.dll
85 libwireshark.lib: libwireshark.dll
86 libwireshark.exp: libwireshark.dll
88 libwireshark.dll: ..\config.h $(LIBWIRESHARK_OBJECTS) libwireshark.def crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
89 crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib dissectors\dissectors.lib $(WSLUA_LIB) $(WSPYTHON_LIB) ..\image\libwireshark.res
90 @echo Linking libwireshark.dll
91 $(link) $(dlllflags) $(conlibsdll) shell32.lib \
92 $(LOCAL_LDFLAGS) $(DLL_LDFLAGS) \
93 /DEF:libwireshark.def /OUT:libwireshark.dll \
94 /IMPLIB:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
95 $(libwireshark_LIBS) ..\image\libwireshark.res \
96 dissectors\register.obj \
99 libwireshark.lib : ..\config.h $(LIBWIRESHARK_OBJECTS) crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
100 crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib $(WSLUA_LIB) $(WSPYTHON_LIB) dissectors\dissectors.lib
101 link /lib /out:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
104 ..\config.h : ..\config.h.win32 ..\config.nmake
106 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
110 rm -f $(LIBWIRESHARK_OBJECTS) $(EXTRA_OBJECTS) \
111 libwireshark.lib libwireshark.dll *.manifest libwireshark.exp \
112 *.pdb *.sbr doxygen.cfg html/*.* \
113 exntest.obj exntest.exe reassemble_test.obj reassemble_test.exe tvbtest.obj tvbtest.exe
114 if exist html rm -rf html
118 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
120 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
122 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
124 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
126 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
128 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
132 # We remove the Flex-generated files with "distclean" because they need
133 # different #includes for UN*X and Windows (UN*X versions of Flex make it
134 # include <unistd.h>, but that's a UN*X-only header), so if you're going
135 # to build from source, you need to build those scanners from the
136 # corresponding ".l" files with Flex.
137 # This might not be necessary for "dtd_grammar.{c,h}", but we handle them
140 distclean-local: clean-local
141 rm -f config.h register.c mkstemp.c \
142 $(LIBWIRESHARK_DISTCLEAN_GENERATED_SRC) \
143 $(LIBWIRESHARK_DISTCLEAN_GENERATED_INCLUDES) \
144 $(LIBWIRESHARK_NODISTCLEAN_GENERATED_SRC) \
145 $(LIBWIRESHARK_NODISTCLEAN_GENERATED_INCLUDES) \
146 dtd_grammar.out sminmpec.c
148 distclean: distclean-local
150 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
152 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
154 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
156 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
158 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
160 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
163 maintainer-clean-local: distclean-local
165 maintainer-clean: maintainer-clean-local
167 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
169 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
171 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
173 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
175 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
177 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
182 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
187 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
190 dfilter:: ..\config.h
192 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
195 dissectors:: ..\config.h
197 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
202 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
205 wspython:: ..\config.h
207 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
210 doxygen.cfg: ..\config.nmake doxygen.cfg.in
211 sed -e s/@VERSION@/$(VERSION)/ \
212 < doxygen.cfg.in > $@
216 $(DOXYGEN) doxygen.cfg
219 doxygen: doxygen.cfg doxygen-run
221 # Rules for making unit tests
223 reassemble_test: reassemble_test.exe
226 # Object files for exntest
227 EXNTEST_OBJ=exntest.obj except.obj
229 exntest.exe: $(EXNTEST_OBJ)
231 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
232 $(GLIB_LIBS) $(EXNTEST_OBJ)
233 !IFDEF MANIFEST_INFO_REQUIRED
234 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
237 # Object files for tvbtest
238 TVBTEST_OBJ=tvbtest.obj \
246 tvbtest.exe: $(TVBTEST_OBJ)
248 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
249 $(GLIB_LIBS) $(ZLIB_LIBS) $(TVBTEST_OBJ)
250 !IFDEF MANIFEST_INFO_REQUIRED
251 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
254 # Object files for reassemble_test
255 REASSEMBLE_TEST_OBJ=reassemble_test.obj \
264 reassemble_test.exe: $(REASSEMBLE_TEST_OBJ)
266 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
267 $(GLIB_LIBS) $(ZLIB_LIBS) $(REASSEMBLE_TEST_OBJ)
268 !IFDEF MANIFEST_INFO_REQUIRED
269 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
274 if exist exntest.exe xcopy exntest.exe $(INSTALL_DIR) /d
278 if exist tvbtest.exe xcopy tvbtest.exe $(INSTALL_DIR) /d
280 reassemble_test_install:
282 if exist reassemble_test.exe xcopy reassemble_test.exe $(INSTALL_DIR) /d
286 # Compile some time critical code from assembler if NASM available
289 asm_utils_win32_x86.obj: asm_utils_win32_x86.asm
290 $(NASM) -f $(WIRESHARK_TARGET_PLATFORM) -o $@ $?
293 sminmpec.c: enterprise-numbers ..\tools\make-sminmpec.pl
294 $(PERL) ../tools/make-sminmpec.pl enterprise-numbers sminmpec.c
296 RUNLEX=..\tools\runlex.sh
298 diam_dict_lex.h: diam_dict.c
299 diam_dict.obj : diam_dict.c
300 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
302 dtd_parse_lex.h: dtd_parse.c
303 dtd_parse.obj : dtd_parse.c
304 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
306 dtd_preparse_lex.h: dtd_preparse.c
307 dtd_preparse.obj : dtd_preparse.c
308 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
310 radius_dict_lex.h: radius_dict.c
311 radius_dict.obj : radius_dict.c
312 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
314 uat_load_lex.h: uat_load.c
315 uat_load.obj : uat_load.c
316 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
320 dtd_grammar.h: dtd_grammar.c
321 dtd_grammar.c: $(LEMON)\lemon.exe $(LEMON)\lempar.c dtd_grammar.lemon
322 $(LEMON)\lemon t=$(LEMON)\lempar.c dtd_grammar.lemon
325 $(PERL) ../tools/checkAPIs.pl -g termoutput $(LIBWIRESHARK_SRC)