forked from osmocom/wireshark
![Michael Mann](/assets/img/avatar_default.png)
Change-Id: I86a01bdd778f2242aa534a687275a85a2f329c02 Reviewed-on: https://code.wireshark.org/review/15071 Reviewed-by: Michael Mann <mmann78@netscape.net>
467 lines
12 KiB
Makefile
467 lines
12 KiB
Makefile
## Makefile for building wireshark.exe with Microsoft C and nmake
|
|
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
|
|
#
|
|
|
|
include ..\config.nmake
|
|
include <win32.mak>
|
|
include ..\Makefile.nmake.inc
|
|
|
|
include Makefile.common
|
|
|
|
LINK= link
|
|
|
|
#
|
|
# These are the flags for all source files.
|
|
#
|
|
COMMON_CFLAGS=\
|
|
$(STANDARD_CFLAGS) \
|
|
/I. /I.. $(GLIB_CFLAGS) \
|
|
$(ZLIB_CFLAGS) $(C_ARES_CFLAGS) \
|
|
$(LUA_CFLAGS) $(GNUTLS_CFLAGS) /I$(PCAP_DIR)\include \
|
|
$(SMI_CFLAGS) $(GEOIP_CFLAGS)
|
|
|
|
#
|
|
# These are the flags for generated source files; we don't include
|
|
# $(WARNINGS_ARE_ERRORS), so that we flex's non-LLP64-compliant output
|
|
# doesn't cause compilation to fail.
|
|
#
|
|
GENERATED_CFLAGS=\
|
|
$(COMMON_CFLAGS) -DWS_BUILD_DLL
|
|
|
|
#
|
|
# These are the flags for test programs; we don't include -DWS_BUILD_DLL,
|
|
# as we're building test programs that link with the library, not routines
|
|
# incorporated into the library, so they should *import* stuff from the
|
|
# library, not *export* stuff from the library.
|
|
#
|
|
TEST_CFLAGS=\
|
|
$(WARNINGS_ARE_ERRORS) $(COMMON_CFLAGS)
|
|
|
|
#
|
|
# These are flags for everything else; we include $(WARNINGS_ARE_ERRORS),
|
|
# as the code should be warning-free, and we include -DWS_BUILD_DLL,
|
|
# as these are library routines, not test programs.
|
|
#
|
|
CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS) -DWS_BUILD_DLL
|
|
|
|
!IFDEF LUA_DIR
|
|
WSLUA_LIB=wslua\wslua.lib
|
|
WSLUA_DIR=wslua
|
|
!ELSE
|
|
WSLUA_LIB=
|
|
WSLUA_DIR=
|
|
!ENDIf
|
|
|
|
# For use when making libwireshark.dll
|
|
libwireshark_LIBS = \
|
|
$(GLIB_LIBS) \
|
|
$(C_ARES_LIBS) \
|
|
$(KFW_LIBS) \
|
|
$(ZLIB_LIBS) \
|
|
$(GNUTLS_LIBS) \
|
|
$(LUA_LIBS) \
|
|
$(SMI_LIBS) \
|
|
$(GEOIP_LIBS) \
|
|
..\wsutil\libwsutil.lib \
|
|
..\wiretap\wiretap-$(WTAP_VERSION).lib \
|
|
compress\lzxpress.lib \
|
|
crypt\airpdcap.lib \
|
|
ftypes\ftypes.lib \
|
|
dfilter\dfilter.lib \
|
|
wmem\wmem.lib \
|
|
$(WSLUA_LIB) \
|
|
nghttp2\nghttp2.lib \
|
|
dissectors\dissectors.lib
|
|
|
|
.c.obj::
|
|
$(CC) $(CFLAGS) -Fd.\ -c $<
|
|
|
|
LIBWIRESHARK_OBJECTS = $(LIBWIRESHARK_ALL_SRC:.c=.obj)
|
|
|
|
EXTRA_OBJECTS = \
|
|
!IF defined(NASM) && "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
|
|
asm_utils_win32_x86.obj
|
|
!ELSE
|
|
asm_utils.obj
|
|
!ENDIF
|
|
|
|
!IFDEF DOXYGEN
|
|
DOXYGEN_DEP=doxygen
|
|
!ENDIF
|
|
|
|
!IFDEF ENABLE_LIBWIRESHARK
|
|
all: compress crypt ftypes dfilter wmem $(WSLUA_DIR) nghttp2 dissectors libwireshark.dll
|
|
!ELSE
|
|
all: compress crypt ftypes dfilter wmem $(WSLUA_DIR) nghttp2 dissectors libwireshark.lib
|
|
!ENDIF
|
|
|
|
# For use when making libwireshark.dll
|
|
libwireshark.lib: libwireshark.dll
|
|
libwireshark.exp: libwireshark.dll
|
|
|
|
libwireshark.dll: ..\config.h $(LIBWIRESHARK_OBJECTS) compress crypt ftypes dfilter wmem $(WSLUA_DIR) nghttp2 dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
|
|
crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib wmem\wmem.lib dissectors\dissectors.lib $(WSLUA_LIB) nghttp2\nghttp2.lib ..\image\libwireshark.res
|
|
@echo Linking libwireshark.dll
|
|
$(link) $(dlllflags) $(conlibsdll) shell32.lib psapi.lib \
|
|
$(LOCAL_LDFLAGS) $(DLL_LDFLAGS) \
|
|
/OUT:libwireshark.dll \
|
|
/IMPLIB:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
|
|
$(libwireshark_LIBS) ..\image\libwireshark.res \
|
|
..\wsutil\ws_version_info.obj dissectors\register.obj \
|
|
$(EXTRA_OBJECTS)
|
|
|
|
libwireshark.lib : ..\config.h $(LIBWIRESHARK_OBJECTS) compress crypt ftypes dfilter wmem $(WSLUA_DIR) nghttp2 dissectors $(DOXYGEN_DEP) $(EXTRA_OBJECTS) \
|
|
crypt\airpdcap.lib ftypes\ftypes.lib dfilter\dfilter.lib wmem\wmem.lib $(WSLUA_LIB) nghttp2\nghttp2.lib dissectors\dissectors.lib
|
|
link /lib /out:libwireshark.lib $(LIBWIRESHARK_OBJECTS) \
|
|
$(EXTRA_OBJECTS)
|
|
|
|
..\config.h : ..\config.h.win32 ..\config.nmake
|
|
cd ..
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
|
|
cd epan
|
|
|
|
clean-local:
|
|
rm -f $(LIBWIRESHARK_OBJECTS) $(EXTRA_OBJECTS) \
|
|
libwireshark.lib libwireshark.dll *.manifest libwireshark.exp \
|
|
*.nativecodeanalysis.xml *.pdb *.sbr doxygen.cfg html/*.* \
|
|
exntest.obj exntest.exe exntest.exp reassemble_test.obj reassemble_test.exe tvbtest.obj tvbtest.exe tvbtest.exp oids_test.obj oids_test.exe oids_test.exp
|
|
if exist html rm -rf html
|
|
|
|
clean: clean-local
|
|
cd compress
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../crypt
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../ftypes
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../dfilter
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../dissectors
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../wmem
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../wslua
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ../nghttp2
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
|
cd ..
|
|
|
|
#
|
|
# We remove the Flex-generated files with "distclean" because they need
|
|
# different #includes for UN*X and Windows (UN*X versions of Flex make it
|
|
# include <unistd.h>, but that's a UN*X-only header), so if you're going
|
|
# to build from source, you need to build those scanners from the
|
|
# corresponding ".l" files with Flex.
|
|
# This might not be necessary for "dtd_grammar.{c,h}", but we handle them
|
|
# the same for now.
|
|
#
|
|
distclean-local: clean-local
|
|
rm -f config.h register.c mkstemp.c \
|
|
$(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
|
|
$(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES) \
|
|
$(LIBWIRESHARK_GENERATED_C_FILES) \
|
|
$(LIBWIRESHARK_GENERATED_HEADER_FILES) \
|
|
dtd_grammar.out
|
|
|
|
distclean: distclean-local
|
|
cd compress
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../crypt
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../ftypes
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../dfilter
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../dissectors
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../wmem
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../wslua
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ../nghttp2
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
|
cd ..
|
|
|
|
maintainer-clean-local: distclean-local
|
|
|
|
maintainer-clean: maintainer-clean-local
|
|
cd compress
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../crypt
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../ftypes
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../dfilter
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../dissectors
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../wmem
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../wslua
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ../nghttp2
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
|
cd ..
|
|
|
|
crypt:: ..\config.h
|
|
cd crypt
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
compress:: ..\config.h
|
|
cd compress
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
ftypes:: ..\config.h
|
|
cd ftypes
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
dfilter:: ..\config.h
|
|
cd dfilter
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
dissectors:: ..\config.h
|
|
cd dissectors
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
wmem:: ..\config.h
|
|
cd wmem
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
wslua:: ..\config.h
|
|
cd wslua
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
nghttp2:: ..\config.h
|
|
cd nghttp2
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
|
cd ..
|
|
|
|
doxygen.cfg: ..\config.nmake doxygen.cfg.in
|
|
sed -e s/@VERSION@/$(VERSION)/ \
|
|
< doxygen.cfg.in > $@
|
|
|
|
doxygen-run:
|
|
!IFDEF DOXYGEN
|
|
$(DOXYGEN) doxygen.cfg
|
|
!ENDIF
|
|
|
|
doxygen: doxygen.cfg doxygen-run
|
|
|
|
# Rules for making unit tests
|
|
exntest: exntest.exe
|
|
reassemble_test: reassemble_test.exe
|
|
tvbtest: tvbtest.exe
|
|
oids_test: oids_test.exe
|
|
|
|
# Object files for exntest
|
|
EXNTEST_OBJ=exntest.obj except.obj
|
|
|
|
exntest.exe: $(EXNTEST_OBJ)
|
|
@echo Linking $@
|
|
$(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
|
|
$(GLIB_LIBS) $(EXNTEST_OBJ)
|
|
!IFDEF MANIFEST_INFO_REQUIRED
|
|
mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
|
|
!ENDIF
|
|
|
|
# Object files for tvbtest
|
|
TVBTEST_OBJ=tvbtest.obj
|
|
TVBTEST_LIBS= ..\wiretap\wiretap-$(WTAP_VERSION).lib \
|
|
wsock32.lib user32.lib \
|
|
$(GLIB_LIBS) \
|
|
..\wsutil\libwsutil.lib \
|
|
$(GNUTLS_LIBS) \
|
|
!IFDEF ENABLE_LIBWIRESHARK
|
|
libwireshark.lib \
|
|
!ELSE
|
|
dissectors\dissectors.lib \
|
|
wireshark.lib \
|
|
compress\lzxpress.lib \
|
|
crypt\airpdcap.lib \
|
|
dfilter\dfilter.lib \
|
|
ftypes\ftypes.lib \
|
|
$(C_ARES_LIBS) \
|
|
$(ZLIB_LIBS)
|
|
!ENDIF
|
|
|
|
tvbtest.exe: $(TVBTEST_OBJ)
|
|
@echo Linking $@
|
|
$(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
|
|
$(TVBTEST_LIBS) $(GLIB_LIBS) $(ZLIB_LIBS) $(TVBTEST_OBJ)
|
|
!IFDEF MANIFEST_INFO_REQUIRED
|
|
mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
|
|
!ENDIF
|
|
|
|
# Object files for oids_test
|
|
OIDS_TEST_OBJ=oids_test.obj
|
|
OIDS_TEST_LIBS= ..\wiretap\wiretap-$(WTAP_VERSION).lib \
|
|
wsock32.lib user32.lib \
|
|
$(GLIB_LIBS) \
|
|
..\wsutil\libwsutil.lib \
|
|
$(GNUTLS_LIBS) \
|
|
!IFDEF ENABLE_LIBWIRESHARK
|
|
libwireshark.lib \
|
|
!ELSE
|
|
dissectors\dissectors.lib \
|
|
wireshark.lib \
|
|
compress\lzxpress.lib \
|
|
crypt\airpdcap.lib \
|
|
dfilter\dfilter.lib \
|
|
ftypes\ftypes.lib \
|
|
wmem\wmem.lib \
|
|
$(C_ARES_LIBS) \
|
|
$(ZLIB_LIBS)
|
|
!ENDIF
|
|
|
|
oids_test.exe: $(OIDS_TEST_OBJ)
|
|
@echo Linking $@
|
|
$(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
|
|
$(OIDS_TEST_LIBS) $(GLIB_LIBS) $(ZLIB_LIBS) $(OIDS_TEST_OBJ)
|
|
!IFDEF MANIFEST_INFO_REQUIRED
|
|
mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
|
|
!ENDIF
|
|
|
|
# Object files for reassemble_test
|
|
REASSEMBLE_TEST_OBJ=reassemble_test.obj
|
|
REASSEMBLE_TEST_LIBS= ..\wiretap\wiretap-$(WTAP_VERSION).lib \
|
|
wsock32.lib user32.lib \
|
|
$(GLIB_LIBS) \
|
|
..\wsutil\libwsutil.lib \
|
|
$(GNUTLS_LIBS) \
|
|
!IFDEF ENABLE_LIBWIRESHARK
|
|
libwireshark.lib \
|
|
!ELSE
|
|
dissectors\dissectors.lib \
|
|
wireshark.lib \
|
|
compress\lzxpress.lib \
|
|
crypt\airpdcap.lib \
|
|
dfilter\dfilter.lib \
|
|
ftypes\ftypes.lib \
|
|
$(C_ARES_LIBS) \
|
|
$(ZLIB_LIBS)
|
|
!ENDIF
|
|
|
|
reassemble_test.exe: $(REASSEMBLE_TEST_OBJ)
|
|
@echo Linking $@
|
|
$(LINK) /OUT:$@ $(conflags) $(conlibsdll) $(LOCAL_LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console \
|
|
$(REASSEMBLE_TEST_LIBS) $(GLIB_LIBS) $(ZLIB_LIBS) $(REASSEMBLE_TEST_OBJ)
|
|
!IFDEF MANIFEST_INFO_REQUIRED
|
|
mt.exe -nologo -manifest "$@.manifest" -outputresource:$@;1
|
|
!ENDIF
|
|
|
|
exntest_install: exntest.exe
|
|
set copycmd=/y
|
|
xcopy exntest.exe ..\$(INSTALL_DIR) /d
|
|
|
|
tvbtest_install: tvbtest.exe
|
|
set copycmd=/y
|
|
xcopy tvbtest.exe ..\$(INSTALL_DIR) /d
|
|
|
|
oids_test_install: oids_test.exe
|
|
set copycmd=/y
|
|
xcopy oids_test.exe ..\$(INSTALL_DIR) /d
|
|
|
|
reassemble_test_install: reassemble_test.exe
|
|
set copycmd=/y
|
|
xcopy reassemble_test.exe ..\$(INSTALL_DIR) /d
|
|
|
|
test-programs: exntest_install tvbtest_install oids_test_install reassemble_test_install
|
|
cd wmem
|
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake test-programs
|
|
cd ..
|
|
|
|
#
|
|
# Compile some time critical code from assembler if NASM available
|
|
#
|
|
!IFDEF NASM
|
|
asm_utils_win32_x86.obj: asm_utils_win32_x86.asm
|
|
$(NASM) -f $(WIRESHARK_TARGET_PLATFORM) -o $@ $?
|
|
!ENDIF
|
|
|
|
update-sminmpec:
|
|
$(PERL) ../tools/make-sminmpec.pl
|
|
|
|
RUNLEX=../tools/runlex.sh
|
|
|
|
#
|
|
# We compile these specially because they're Flex-generated and thus
|
|
# "warnings are errors" will fail because there's a bunch of
|
|
# warnings we can't eliminate.
|
|
#
|
|
diam_dict_lex.h: diam_dict.c
|
|
diam_dict.obj : diam_dict.c
|
|
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?
|
|
|
|
#
|
|
# This depends on dtd_grammar.h to force dtd_grammar.h to be
|
|
# built before we try to compile it, as dtd_parse.c includes
|
|
# dtd_grammar.h, and dtd_grammar.h is not distributed with
|
|
# the source (it's generated with Lemon). That means we can't
|
|
# use $?, as that would make it try to compile dtd_grammar.h.
|
|
#
|
|
dtd_parse_lex.h: dtd_parse.c
|
|
dtd_parse.obj : dtd_grammar.h
|
|
dtd_parse.obj : dtd_parse.c
|
|
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c dtd_parse.c
|
|
|
|
dtd_preparse_lex.h: dtd_preparse.c
|
|
dtd_preparse.obj : dtd_preparse.c
|
|
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?
|
|
|
|
radius_dict_lex.h: radius_dict.c
|
|
radius_dict.obj : radius_dict.c
|
|
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?
|
|
|
|
uat_load_lex.h: uat_load.c
|
|
uat_load.obj : uat_load.c
|
|
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?
|
|
|
|
LEMON=..\tools\lemon
|
|
|
|
dtd_grammar.h: dtd_grammar.c
|
|
dtd_grammar.c: $(LEMON)\lemon.exe $(LEMON)\lempar.c dtd_grammar.lemon
|
|
$(LEMON)\lemon T=$(LEMON)\lempar.c dtd_grammar.lemon
|
|
|
|
#
|
|
# We compile these specially because they're test programs, not library
|
|
# routines, and thus they import stuff from the library rather than
|
|
# exporting stuff from the library.
|
|
#
|
|
exntest.obj: exntest.c
|
|
$(CC) $(TEST_CFLAGS) -Fd.\ -c $?
|
|
|
|
reassemble_test.obj: reassemble_test.c
|
|
$(CC) $(TEST_CFLAGS) -Fd.\ -c $?
|
|
|
|
tvbtest.obj: tvbtest.c
|
|
$(CC) $(TEST_CFLAGS) -Fd.\ -c $?
|
|
|
|
oids_test.obj: oids_test.c
|
|
$(CC) $(TEST_CFLAGS) -Fd.\ -c $?
|
|
|
|
ps.c: ..\tools\rdps.py print.ps
|
|
$(PYTHON) ..\tools\rdps.py print.ps ps.c
|
|
|
|
checkapi:
|
|
$(PERL) ../tools/checkAPIs.pl -g termoutput -build $(LIBWIRESHARK_SRC)
|
|
|
|
#
|
|
# Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
#
|
|
# Local variables:
|
|
# c-basic-offset: 8
|
|
# tab-width: 8
|
|
# indent-tabs-mode: t
|
|
# End:
|
|
#
|
|
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
# :indentSize=8:tabSize=8:noTabs=false:
|
|
#
|