Wireshark-dev: Re: [Wireshark-dev] What are nmake commands required to build dissector
If you are building on 0.99.4 the DON'T cut and hack the make file.
Simply edit the Makefile.common file by adding your plug-in name at the
top and putting the source and includes where indicated:
--------------------------------
# the name of the plugin
PLUGIN_NAME = foo
# the dissector sources (without any helpers)
DISSECTOR_SRC = \
foo.c
# corresponding headers
DISSECTOR_INCLUDES = \
foo.h
--------------------------------
You then should modify the moduleinfo.h file replacing the define for
yours. You might also want to adjust the version (shows up in About):
--------------------------------
#define PACKAGE "foo"
#define VERSION "0.0.1"
--------------------------------
You can also modify the AUTHORS and ChangeLog files:
--------------------------------
Authors :
Hal Lander <hlander@xxxxxxxxxxxxxxx>
--------------------------------
Compile the file from the same directory as the plugin (foo)
Here is the batch file I call from my editor
--------------------------------
@echo off
call VCVARS32.BAT
echo Make...
nmake -f Makefile.nmake
echo.
if not errorlevel 1 goto pass1
echo
************************************************************************
********
goto done
:pass1
echo Make OK
echo Copy...
copy /y foo.dll ..\0.99.4\foo.dll > nul
if not errorlevel 1 goto pass2
echo
************************************************************************
********
goto done
:pass2
echo Copy OK
:done
--------------------------------
-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Hal Lander
Sent: Monday, November 13, 2006 9:13 AM
To: wireshark-dev@xxxxxxxxxxxxx
Subject: [Wireshark-dev] What are nmake commands required to build
dissector
I have cut an pasted the Windows Makefile.nmake below from the developer
guide.
My dissector is the sample one from the guide, and I have stuck with the
name foo.
I think I have followed the edits in README.plugins correctly, but I am
not familiar with nmake and I get lost at section 4.
My questions are;
1. What command do I type at the command line to build the dissector
dll, and which directory should I be in when I type it ( I only want to
build the disssector as a plugin, I have built Wireshark from the source
and it works). ?
2. To get Wireshark to use the new dissector do I just need to put the
dll where the other dissector dlls are i.e. in
wireshark-gtk2\plugins\0.99.4 ?
TIA
Hal
include ..\..\config.nmake
############### no need to modify below this line #########
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
!IFDEF ENABLE_LIBWIRESHARK
LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
OBJECTS=foo.obj
foo.dll foo.exp foo.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
link -dll /out:foo.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
$(GLIB_LIBS)
!ENDIF
clean:
rm -f $(OBJECTS) foo.dll foo.exp foo.lib *.pdb
distclean: clean
maintainer-clean: distclean
_________________________________________________________________
Find a local pizza place, music store, museum and morethen map the best
route! http://local.live.com?FORM=MGA001