From ed237c129d8445a45dbe5e8819353c468e6d24ee Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Wed, 12 Apr 2000 21:52:11 +0000 Subject: [PATCH] Build tethereal and editcap on Win32. Add RCS ID tags to Makefile.nmake's. svn path=/trunk/; revision=1836 --- Makefile.nmake | 47 +++++++++++++++++++++++++++++----- config.nmake | 2 +- editcap.c | 21 ++++++++++++++- getopt.c | 11 ++++---- plugins/Makefile.nmake | 4 +++ plugins/gryphon/Makefile.nmake | 4 +++ wiretap/Makefile.nmake | 3 +++ 7 files changed, 78 insertions(+), 14 deletions(-) diff --git a/Makefile.nmake b/Makefile.nmake index 1ff8c40d79..b9b6314282 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -1,5 +1,7 @@ ## Makefile for building ethereal.exe with Microsoft C and nmake ## Use: nmake -f makefile.nmake +# +# $Id: Makefile.nmake,v 1.24 2000/04/12 21:51:27 gram Exp $ include config.nmake @@ -9,7 +11,7 @@ CC = cl LINK= link LDFLAGS = /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /MACHINE:I386 \ - $(LOCAL_LDFLAGS) /OUT:ethereal.exe + $(LOCAL_LDFLAGS) CFLAGS=/MT -DHAVE_CONFIG_H $(LOCAL_CFLAGS) /I$(GLIB_DIR) /I$(GLIB_DIR)\gmodule \ /I$(GTK_DIR) /Iwiretap /I$(GTK_DIR)\gdk /I$(GTK_DIR)\gdk\win32 \ @@ -90,6 +92,7 @@ DISSECTOR_OBJECTS = \ packet-raw.obj \ packet-rip.obj \ packet-ripng.obj \ + packet-rlogin.obj \ packet-rpc.obj \ packet-rsvp.obj \ packet-rtsp.obj \ @@ -159,7 +162,12 @@ ethereal_OBJECTS = \ file.obj \ summary.obj \ -EXTRA_ethereal_OBJECTS = \ +tethereal_OBJECTS = \ + $(DISSECTOR_OBJECTS) \ + $(ETHEREAL_COMMON_OBJECTS) \ + tethereal.obj + +EXTRA_OBJECTS = \ snprintf.obj \ strerror.obj \ mkstemp.obj \ @@ -167,18 +175,39 @@ EXTRA_ethereal_OBJECTS = \ inet_pton.obj \ inet_ntop.obj -LIBS= wiretap\libwtap.lib gtk\libui.lib wsock32.lib user32.lib \ +ethereal_LIBS= wiretap\libwtap.lib gtk\libui.lib wsock32.lib user32.lib \ $(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \ $(GTK_DIR)\gdk\win32\gdk-$(GTK_VERSION).lib \ $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \ $(GLIB_DIR)\gmodule-$(GLIB_VERSION).lib \ $(PCAP_DIR)\lib\libpcap.lib -all: ethereal.exe +tethereal_LIBS= wiretap\libwtap.lib wsock32.lib user32.lib \ + $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \ + $(GLIB_DIR)\gmodule-$(GLIB_VERSION).lib \ + $(PCAP_DIR)\lib\libpcap.lib -ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_ethereal_OBJECTS) wiretap gtk plugins +editcap_LIBS= wiretap\libwtap.lib wsock32.lib user32.lib \ + $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \ + $(GLIB_DIR)\gmodule-$(GLIB_VERSION).lib + +EXECUTABLES=ethereal.exe tethereal.exe editcap.exe + +all: $(EXECUTABLES) + +ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) wiretap gtk plugins $(LINK) @<< - $(LDFLAGS) $(LIBS) $(ethereal_OBJECTS) $(EXTRA_ethereal_OBJECTS) + /OUT:ethereal.exe $(LDFLAGS) $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) +<< + +tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) wiretap plugins + $(LINK) @<< + /OUT:tethereal.exe $(LDFLAGS) $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) +<< + +editcap.exe : config.h editcap.obj getopt.obj wiretap + $(LINK) @<< + /OUT:editcap.exe $(LDFLAGS) editcap.obj getopt.obj $(editcap_LIBS) << config.h : config.h.win32 @@ -195,8 +224,12 @@ dfilter-scanner.c : dfilter-scanner.l dfilter-grammar.c dfilter-grammar.h : dfilter-grammar.y $(YACC) $(YACC_OPTS) -d -p dfilter_ dfilter-grammar.y -o dfilter-grammar.c +# +# TODO: Create register.c +# + clean: - rm -f $(ethereal_OBJECTS) $(EXTRA_ethereal_OBJECTS) ethereal.exe + rm -f $(ethereal_OBJECTS) $(EXTRA_OBJECTS) $(EXECUTABLES) tethereal.obj editcap.obj cd wiretap nmake -f Makefile.nmake clean cd ../gtk diff --git a/config.nmake b/config.nmake index 5056a3816a..151c66d5ef 100644 --- a/config.nmake +++ b/config.nmake @@ -5,7 +5,7 @@ GLIB_VERSION=1.3 GLIB_DIR=T:\w32-ix86\ethereal\glib GTK_DIR=T:\w32-ix86\ethereal\gtk+ -PCAP_DIR=T:\w32-ix86\ethereal\WDdpack +PCAP_DIR=T:\w32-ix86\ethereal\WPdpack LOCAL_CFLAGS=-Zi LOCAL_LDFLAGS=/DEBUG diff --git a/editcap.c b/editcap.c index 5efff45f75..63f79fba9b 100644 --- a/editcap.c +++ b/editcap.c @@ -1,21 +1,40 @@ /* Edit capture files. We can delete records, or simply convert from one * format to another format. * - * $Id: editcap.c,v 1.6 2000/01/17 20:21:40 guy Exp $ + * $Id: editcap.c,v 1.7 2000/04/12 21:51:27 gram Exp $ * * Originally written by Richard Sharpe. * Improved by Guy Harris. * Further improved by Richard Sharpe. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include + +#ifdef HAVE_UNISTD_H #include +#endif + +#ifdef HAVE_SYS_TIME_H #include +#endif + +#ifdef HAVE_WINSOCK_H +#include +#endif + #include #include "wtap.h" +#ifdef NEED_GETOPT_H +#include "getopt.h" +#endif + /* * Some globals so we can pass things to various routines */ diff --git a/getopt.c b/getopt.c index 38547d215a..a9c230d71f 100644 --- a/getopt.c +++ b/getopt.c @@ -1,4 +1,7 @@ /* Getopt for GNU. + + $Id: getopt.c,v 1.2 2000/04/12 21:51:28 gram Exp $ + NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! @@ -19,12 +22,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - + + #ifdef HAVE_CONFIG_H -/* We use instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because getopt.c was found in $srcdir). */ -#include +#include "config.h" #endif #ifndef __STDC__ diff --git a/plugins/Makefile.nmake b/plugins/Makefile.nmake index 575680f8d1..761b755d6e 100644 --- a/plugins/Makefile.nmake +++ b/plugins/Makefile.nmake @@ -1,3 +1,7 @@ +# +# $Id: Makefile.nmake,v 1.4 2000/04/12 21:51:39 gram Exp $ +# + include ..\config.nmake ############### no need to modify below this line ######### diff --git a/plugins/gryphon/Makefile.nmake b/plugins/gryphon/Makefile.nmake index eaceda1474..0e9f3a758f 100644 --- a/plugins/gryphon/Makefile.nmake +++ b/plugins/gryphon/Makefile.nmake @@ -1,3 +1,7 @@ +# +# $Id: Makefile.nmake,v 1.4 2000/04/12 21:51:53 gram Exp $ +# + include ..\..\config.nmake ############### no need to modify below this line ######### diff --git a/wiretap/Makefile.nmake b/wiretap/Makefile.nmake index 3a79aeb7e8..d58068abf9 100644 --- a/wiretap/Makefile.nmake +++ b/wiretap/Makefile.nmake @@ -1,3 +1,6 @@ +# +# $Id: Makefile.nmake,v 1.11 2000/04/12 21:52:11 gram Exp $ +# include ..\config.nmake