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 CFLAGS=-WX -DHAVE_CONFIG_H /I. /I.. /I../wiretap $(GLIB_CFLAGS) \
15 $(ZLIB_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) /I$(PCAP_DIR)\include \
16 -D_U_="" $(LOCAL_CFLAGS)
18 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
21 WSLUA_LIB=wslua\wslua.lib
28 # For use when making libwireshark.dll
39 ..\wiretap\wiretap-$(WTAP_VERSION).lib \
40 $(ICONV_DIR)\lib\iconv.lib \
45 dissectors\dissectors.lib
48 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
50 LIBWIRESHARK_OBJECTS = $(LIBWIRESHARK_ALL_SRC:.c=.obj)
65 !IFDEF ENABLE_LIBWIRESHARK
66 all: crypt ftypes dfilter $(WSLUA_DIR) dissectors libwireshark.dll
68 all: crypt ftypes dfilter $(WSLUA_DIR) dissectors libwireshark.lib
71 # For use when making libwireshark.dll
72 libwireshark.lib: libwireshark.dll
73 libwireshark.exp: libwireshark.dll
75 libwireshark.dll: ..\config.h $(LIBWIRESHARK_OBJECTS) libwireshark.def crypt ftypes dfilter $(WSLUA_DIR) dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
76 crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib dissectors\dissectors.lib $(WSLUA_LIB) ..\image\libwireshark.res
77 @echo Linking libwireshark.dll
78 $(link) $(dlllflags) $(conlibsdll) shell32.lib \
80 /DEF:libwireshark.def /OUT:libwireshark.dll \
81 /IMPLIB:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
82 $(libwireshark_LIBS) ..\image\libwireshark.res \
83 dissectors\register.obj \
85 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
86 mt.exe -nologo -manifest "libwireshark.dll.manifest" -outputresource:libwireshark.dll;2
90 libwireshark.lib : ..\config.h $(LIBWIRESHARK_OBJECTS) crypt ftypes dfilter $(WSLUA_DIR) dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
91 crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib $(WSLUA_LIB) dissectors\dissectors.lib
92 link /lib /out:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
95 ..\config.h : ..\config.h.win32 ..\config.nmake
97 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
101 rm -f $(LIBWIRESHARK_OBJECTS) $(EXTRA_OBJECTS) \
102 libwireshark.lib libwireshark.dll libwireshark.dll.manifest libwireshark.exp libwireshark.pdb \
103 vc60.pdb vc80.pdb doxygen.cfg html/*.* \
104 exntest.obj exntest.exe reassemble_test.obj reassemble_test.exe tvbtest.obj tvbtest.exe
106 if exist html rmdir html
108 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
110 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
112 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
114 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
116 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
120 # We remove the Flex-generated files with "distclean" because they need
121 # different #includes for UN*X and Windows (UN*X versions of Flex make it
122 # include <unistd.h>, but that's a UN*X-only header), so if you're going
123 # to build from source, you need to build those scanners from the
124 # corresponding ".l" files with Flex.
125 # This might not be necessary for "dtd_grammar.{c,h}", but we handle them
129 rm -f config.h register.c mkstemp.c strptime.c \
130 inet_ntop.c inet_pton.c \
131 $(LIBWIRESHARK_DISTCLEAN_GENERATED_SRC) \
132 $(LIBWIRESHARK_NODISTCLEAN_GENERATED_SRC) \
133 dtd_grammar.out dtd_grammar.h sminmpec.c
135 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
137 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
139 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
141 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
143 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
146 maintainer-clean: distclean
148 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
150 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
152 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
154 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
156 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
161 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
166 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
169 dfilter:: ..\config.h
171 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
174 dissectors:: ..\config.h
176 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
181 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
184 doxygen.cfg: ..\config.nmake doxygen.cfg.in
185 sed -e s/@VERSION@/$(VERSION)/ \
186 < doxygen.cfg.in > $@
190 $(DOXYGEN) doxygen.cfg
193 doxygen: doxygen.cfg doxygen-run
195 # Rules for making unit tests
197 reassemble_test: reassemble_test.exe
202 exntest.exe: exntest.obj except.obj
204 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
205 $(GLIB_LIBS) exntest.obj except.obj
206 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
207 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
210 tvbtest.exe: tvbtest.obj tvbuff.obj except.obj strutil.obj emem.obj
212 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
213 $(GLIB_LIBS) $(ZLIB_LIBS) tvbtest.obj tvbuff.obj except.obj strutil.obj emem.obj
214 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
215 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
218 reassemble_test.exe: reassemble_test.obj tvbuff.obj except.obj strutil.obj emem.obj \
221 $(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
222 $(GLIB_LIBS) $(ZLIB_LIBS) reassemble_test.obj tvbuff.obj \
223 except.obj strutil.obj emem.obj reassemble.obj
224 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
225 mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
230 if exist exntest.exe xcopy exntest.exe $(INSTALL_DIR) /d
234 if exist tvbtest.exe xcopy tvbtest.exe $(INSTALL_DIR) /d
236 reassemble_test_install:
238 if exist reassemble_test.exe xcopy reassemble_test.exe $(INSTALL_DIR) /d
241 # (Windows only) Copy some sources from /trunk to /trunk/epan.
242 # It is a cleaner to compile these sources seperately with this makefile than
243 # using the object code compiled by the makefile in /trunk for both dynamically
244 # and statically linking
246 mkstemp.c: ..\mkstemp.c
247 xcopy ..\mkstemp.c . /d
249 strptime.c: ..\strptime.c
250 xcopy ..\strptime.c . /d
252 inet_ntop.c: ..\inet_ntop.c
253 xcopy ..\inet_ntop.c . /d
255 inet_pton.c: ..\inet_pton.c
256 xcopy ..\inet_pton.c . /d
258 sminmpec.c: enterprise-numbers make-sminmpec.pl
259 $(PERL) make-sminmpec.pl enterprise-numbers sminmpec.c
261 dtd_grammar.h: dtd_grammar.c
263 radius_dict.obj : radius_dict.c
265 diam_dict.obj : diam_dict.c
267 dtd_parse.obj : dtd_parse.c
269 dtd_preparse.obj : dtd_preparse.c
271 uat_load.obj : uat_load.c
275 dtd_grammar.c: dtd_grammar.lemon $(LEMON)\lemon.exe
276 $(LEMON)\lemon t=$(LEMON)\lempar.c dtd_grammar.lemon