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 \
61 dissectors\dissectors.lib
64 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
66 LIBWIRESHARK_OBJECTS = $(LIBWIRESHARK_ALL_SRC:.c=.obj)
69 !IF defined(NASM) && "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
70 asm_utils_win32_x86.obj
79 !IFDEF ENABLE_LIBWIRESHARK
80 all: crc crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors libwireshark.dll
82 all: crc crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors libwireshark.lib
85 # For use when making libwireshark.dll
86 libwireshark.lib: libwireshark.dll
87 libwireshark.exp: libwireshark.dll
89 libwireshark.dll: ..\config.h $(LIBWIRESHARK_OBJECTS) libwireshark.def crc crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
90 crc\crc.lib crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib dissectors\dissectors.lib $(WSLUA_LIB) $(WSPYTHON_LIB) ..\image\libwireshark.res
91 @echo Linking libwireshark.dll
92 $(link) $(dlllflags) $(conlibsdll) shell32.lib \
93 $(LOCAL_LDFLAGS) $(DLL_LDFLAGS) \
94 /DEF:libwireshark.def /OUT:libwireshark.dll \
95 /IMPLIB:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
96 $(libwireshark_LIBS) ..\image\libwireshark.res \
97 dissectors\register.obj \
100 libwireshark.lib : ..\config.h $(LIBWIRESHARK_OBJECTS) crc crypt ftypes dfilter $(WSLUA_DIR) $(WSPYTHON_DIR) dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
101 crc\crc.lib crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib $(WSLUA_LIB) $(WSPYTHON_LIB) dissectors\dissectors.lib
102 link /lib /out:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
105 ..\config.h : ..\config.h.win32 ..\config.nmake
107 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
111 rm -f $(LIBWIRESHARK_OBJECTS) $(EXTRA_OBJECTS) \
112 libwireshark.lib libwireshark.dll *.manifest libwireshark.exp \
113 *.pdb doxygen.cfg html/*.* \
114 exntest.obj exntest.exe reassemble_test.obj reassemble_test.exe tvbtest.obj tvbtest.exe
115 if exist html rm -rf html
119 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
121 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
123 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
125 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
127 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
129 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
131 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
135 # We remove the Flex-generated files with "distclean" because they need
136 # different #includes for UN*X and Windows (UN*X versions of Flex make it
137 # include <unistd.h>, but that's a UN*X-only header), so if you're going
138 # to build from source, you need to build those scanners from the
139 # corresponding ".l" files with Flex.
140 # This might not be necessary for "dtd_grammar.{c,h}", but we handle them
143 distclean-local: clean-local
144 rm -f config.h register.c mkstemp.c \
145 $(LIBWIRESHARK_DISTCLEAN_GENERATED_SRC) \
146 $(LIBWIRESHARK_DISTCLEAN_GENERATED_INCLUDES) \
147 $(LIBWIRESHARK_NODISTCLEAN_GENERATED_SRC) \
148 $(LIBWIRESHARK_NODISTCLEAN_GENERATED_INCLUDES) \
149 dtd_grammar.out sminmpec.c
151 distclean: distclean-local
153 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
155 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
157 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
159 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
161 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
163 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
165 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
168 maintainer-clean-local: distclean-local
170 maintainer-clean: maintainer-clean-local
172 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
174 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
176 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
178 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
180 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
182 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
184 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
189 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
194 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
199 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
202 dfilter:: ..\config.h
204 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
207 dissectors:: ..\config.h
209 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
214 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
217 wspython:: ..\config.h
219 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
222 doxygen.cfg: ..\config.nmake doxygen.cfg.in
223 sed -e s/@VERSION@/$(VERSION)/ \
224 < doxygen.cfg.in > $@
228 $(DOXYGEN) doxygen.cfg
231 doxygen: doxygen.cfg doxygen-run
233 # Rules for making unit tests
235 reassemble_test: reassemble_test.exe
238 # Object files for exntest
239 EXNTEST_OBJ=exntest.obj except.obj
241 exntest.exe: $(EXNTEST_OBJ)
243 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
244 $(GLIB_LIBS) $(EXNTEST_OBJ)
245 !IFDEF MANIFEST_INFO_REQUIRED
246 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
249 # Object files for tvbtest
250 TVBTEST_OBJ=tvbtest.obj \
258 tvbtest.exe: $(TVBTEST_OBJ)
260 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
261 $(GLIB_LIBS) $(ZLIB_LIBS) $(TVBTEST_OBJ)
262 !IFDEF MANIFEST_INFO_REQUIRED
263 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
266 # Object files for reassemble_test
267 REASSEMBLE_TEST_OBJ=reassemble_test.obj \
276 reassemble_test.exe: $(REASSEMBLE_TEST_OBJ)
278 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
279 $(GLIB_LIBS) $(ZLIB_LIBS) $(REASSEMBLE_TEST_OBJ)
280 !IFDEF MANIFEST_INFO_REQUIRED
281 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
286 if exist exntest.exe xcopy exntest.exe $(INSTALL_DIR) /d
290 if exist tvbtest.exe xcopy tvbtest.exe $(INSTALL_DIR) /d
292 reassemble_test_install:
294 if exist reassemble_test.exe xcopy reassemble_test.exe $(INSTALL_DIR) /d
298 # Compile some time critical code from assembler if NASM available
301 asm_utils_win32_x86.obj: asm_utils_win32_x86.asm
302 $(NASM) -f $(WIRESHARK_TARGET_PLATFORM) -o $@ $?
305 sminmpec.c: enterprise-numbers ..\tools\make-sminmpec.pl
306 $(PERL) ../tools/make-sminmpec.pl enterprise-numbers sminmpec.c
308 RUNLEX=..\tools\runlex.sh
310 diam_dict_lex.h: diam_dict.c
311 diam_dict.obj : diam_dict.c
312 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
314 dtd_parse_lex.h: dtd_parse.c
315 dtd_parse.obj : dtd_parse.c
316 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
318 dtd_preparse_lex.h: dtd_preparse.c
319 dtd_preparse.obj : dtd_preparse.c
320 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
322 radius_dict_lex.h: radius_dict.c
323 radius_dict.obj : radius_dict.c
324 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
326 uat_load_lex.h: uat_load.c
327 uat_load.obj : uat_load.c
328 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
332 dtd_grammar.h: dtd_grammar.c
333 dtd_grammar.c: $(LEMON)\lemon.exe $(LEMON)\lempar.c dtd_grammar.lemon
334 $(LEMON)\lemon t=$(LEMON)\lempar.c dtd_grammar.lemon
337 $(PERL) ../tools/checkAPIs.pl -g termoutput $(LIBWIRESHARK_SRC)